This commit is contained in:
libccy 2016-09-14 23:16:33 +08:00
parent a056f6ddd2
commit c9fc4075c9
7 changed files with 125 additions and 43 deletions

View File

@ -1569,6 +1569,7 @@ card.swd={
trigger:{player:'phaseDrawBegin'}, trigger:{player:'phaseDrawBegin'},
forced:true, forced:true,
mark:true, mark:true,
temp:true,
intro:{ intro:{
content:'摸牌阶段摸牌数+1' content:'摸牌阶段摸牌数+1'
}, },
@ -1596,6 +1597,7 @@ card.swd={
} }
}, },
nopop:true, nopop:true,
temp:true,
trigger:{global:'phaseBegin'}, trigger:{global:'phaseBegin'},
forced:true, forced:true,
popup:false, popup:false,

View File

@ -1748,7 +1748,7 @@ character.ow={
var current=game.findPlayer(function(player){ var current=game.findPlayer(function(player){
return player.hasSkill('luan2'); return player.hasSkill('luan2');
}); });
if(current){ if(current&&ai.get.attitude(player,current)<0){
return 0; return 0;
} }
return -1; return -1;

View File

@ -99,6 +99,9 @@ character.yijiang={
skill:{ skill:{
taoluan:{ taoluan:{
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){
return !player.hasSkill('taoluan3');
},
init:function(player){ init:function(player){
player.storage.taoluan=[]; player.storage.taoluan=[];
}, },
@ -116,6 +119,9 @@ character.yijiang={
list[i]=['锦囊','',list[i]]; list[i]=['锦囊','',list[i]];
} }
} }
if(list.length==0){
return ui.create.dialog('滔乱已无可用牌');
}
return ui.create.dialog([list,'vcard']); return ui.create.dialog([list,'vcard']);
}, },
filter:function(button,player){ filter:function(button,player){
@ -193,7 +199,6 @@ character.yijiang={
order:4, order:4,
result:{ result:{
player:function(player){ player:function(player){
if(player.hasSkill('taoluan3')) return 0;
var allshown=true; var allshown=true;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].ai.shown==0){ if(game.players[i].ai.shown==0){
@ -209,7 +214,7 @@ character.yijiang={
}, },
threaten:1.6, threaten:1.6,
}, },
group:['taoluan2','taoluan4','taoluan5'] group:['taoluan2']
}, },
taoluan2:{ taoluan2:{
trigger:{player:['useCardAfter','respondAfter']}, trigger:{player:['useCardAfter','respondAfter']},
@ -237,7 +242,7 @@ character.yijiang={
event.target=target; event.target=target;
player.line(target,'green'); player.line(target,'green');
var type=get.type(trigger.card,'trick'); var type=get.type(trigger.card,'trick');
target.chooseCard('滔乱<br><br><div class="text center">交给'+get.translation(player)+'一张'+get.translation(type)+'牌,或令其失去一点体力',function(card,player,target){ target.chooseCard('滔乱<br><br><div class="text center">交给'+get.translation(player)+'一张'+get.translation(type)+'牌,或令其失去一点体力且滔乱无效直到回合',function(card,player,target){
return get.type(card,'trick')==_status.event.cardType; return get.type(card,'trick')==_status.event.cardType;
}).set('cardType',type).set('ai',function(card){ }).set('cardType',type).set('ai',function(card){
if(_status.event.att){ if(_status.event.att){
@ -267,7 +272,6 @@ character.yijiang={
return true; return true;
}, },
check:function(event,player){ check:function(event,player){
if(player.hasSkill('taoluan3')) return 0;
var allshown=true; var allshown=true;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('h')>1&&ai.get.attitude(player,game.players[i])>0){ if(game.players[i]!=player&&game.players[i].num('h')>1&&ai.get.attitude(player,game.players[i])>0){
@ -7246,7 +7250,7 @@ character.yijiang={
taoluan4:'滔乱', taoluan4:'滔乱',
taoluan5:'滔乱', taoluan5:'滔乱',
taoluan_backup:'滔乱', taoluan_backup:'滔乱',
taoluan_info:'出牌或濒死阶段你可视为使用任意一张基本牌或非延时类锦囊牌此牌不得是本局游戏你以此法使用过的牌然后你令一名其他角色选择一项1.交给你一张与你以此法使用的牌类别相同的牌2.你失去1点体力', taoluan_info:'出牌阶段你可视为使用任意一张基本牌或非延时类锦囊牌此牌不得是本局游戏你以此法使用过的牌然后你令一名其他角色选择一项1.交给你一张与你以此法使用的牌类别相同的牌2.你失去1点体力且滔乱无效直到回合结束',
jiaozhao:'矫诏', jiaozhao:'矫诏',
jiaozhao2:'矫诏', jiaozhao2:'矫诏',
jiaozhao_info:'出牌阶段限一次,你可以展示一张手牌,然后选择距离最近的一名其他角色,该角色声明一张基本牌的牌名。在此出牌阶段内,你可以将此手牌当声明的牌使用且你不能被选择为目标', jiaozhao_info:'出牌阶段限一次,你可以展示一张手牌,然后选择距离最近的一名其他角色,该角色声明一张基本牌的牌名。在此出牌阶段内,你可以将此手牌当声明的牌使用且你不能被选择为目标',

View File

@ -59,12 +59,13 @@ play.cardpile={
var rand=function(){ var rand=function(){
return Math.ceil(Math.random()*13); return Math.ceil(Math.random()*13);
}; };
var getn=function(i,j){
return Math.round(data[i][j]*parseFloat(lib.config['cardpile_'+i+'_playpackconfig']));
};
var num=0; var num=0;
for(var i in data){ for(var i in data){
if(lib.config['cardpile_'+i+'_playpackconfig']){ for(var j in data[i]){
for(var j in data[i]){ num+=getn(i,j);
num+=data[i][j];
}
} }
} }
var dn=num*(lib.card.list.length-data.total)/(data.total-num); var dn=num*(lib.card.list.length-data.total)/(data.total-num);
@ -72,19 +73,17 @@ play.cardpile={
if(dn>0){ if(dn>0){
var p=0; var p=0;
for(var i in data){ for(var i in data){
if(lib.config['cardpile_'+i+'_playpackconfig']){ for(var j in data[i]){
for(var j in data[i]){ var n=Math.round(dn*getn(i,j)/num);
var n=Math.round(dn*data[i][j]/num); while(n--){
while(n--){ if(i=='huosha'){
if(i=='huosha'){ lib.card.list.push([j,rand(),'sha','fire']);
lib.card.list.push([j,rand(),'sha','fire']); }
} else if(i=='leisha'){
else if(i=='leisha'){ lib.card.list.push([j,rand(),'sha','thunder']);
lib.card.list.push([j,rand(),'sha','thunder']); }
} else{
else{ lib.card.list.push([j,rand(),i]);
lib.card.list.push([j,rand(),i]);
}
} }
} }
} }

View File

@ -1594,51 +1594,111 @@
}, },
sha:{ sha:{
name:'杀', name:'杀',
init:true, init:'1',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
huosha:{ huosha:{
name:'火杀', name:'火杀',
init:true, init:'1',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
leisha:{ leisha:{
name:'雷杀', name:'雷杀',
init:true, init:'1',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
shan:{ shan:{
name:'闪', name:'闪',
init:true, init:'1',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
tao:{ tao:{
name:'桃', name:'桃',
init:true, init:'0.5',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
jiu:{ jiu:{
name:'酒', name:'酒',
init:true, init:'0.5',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
wuxie:{ wuxie:{
name:'无懈可击', name:'无懈可击',
init:false, init:'0.5',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
nanman:{ nanman:{
name:'南蛮入侵', name:'南蛮入侵',
init:false, init:'0',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
wanjian:{ wanjian:{
name:'万箭齐发', name:'万箭齐发',
init:false, init:'0',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
guohe:{ guohe:{
name:'过河拆桥', name:'过河拆桥',
init:false, init:'0',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
shunshou:{ shunshou:{
name:'顺手牵羊', name:'顺手牵羊',
init:false, init:'0',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
tiesuo:{ tiesuo:{
name:'铁索连环', name:'铁索连环',
init:false, init:'0',
item:{
'1':'补充全部',
'0.5':'补充一半',
'0':'不补充'
}
}, },
hide:{ hide:{
name:'隐藏此扩展', name:'隐藏此扩展',
@ -3711,6 +3771,10 @@
require('electron').remote.getCurrentWindow().toggleDevTools(); require('electron').remote.getCurrentWindow().toggleDevTools();
} }
}; };
if(ui.updatep1){
ui.updatep1.style.display='';
ui.updatep2.style.display='';
}
game.download=function(url,folder,onsuccess,onerror){ game.download=function(url,folder,onsuccess,onerror){
if(url.indexOf('web/')==0){ if(url.indexOf('web/')==0){
url='http://'+lib.hallURL+'/'+url; url='http://'+lib.hallURL+'/'+url;
@ -3833,6 +3897,10 @@
} }
}); });
} }
if(ui.updatep1){
ui.updatep1.style.display='';
ui.updatep2.style.display='';
}
game.download=function(url,folder,onsuccess,onerror){ game.download=function(url,folder,onsuccess,onerror){
var fileTransfer = new FileTransfer(); var fileTransfer = new FileTransfer();
url=get.url()+url; url=get.url()+url;
@ -8348,7 +8416,7 @@
info[4]=[]; info[4]=[];
} }
var skills=info[3]; var skills=info[3];
this.clearSkills(); this.clearSkills(true);
this.classList.add('fullskin'); this.classList.add('fullskin');
if(!game.minskin&&lib.isNewLayout()&&!info[4].contains('minskin')){ if(!game.minskin&&lib.isNewLayout()&&!info[4].contains('minskin')){
this.classList.remove('minskin'); this.classList.remove('minskin');
@ -8538,7 +8606,7 @@
delete this.hp; delete this.hp;
delete this.maxHp; delete this.maxHp;
delete this.hujia; delete this.hujia;
this.clearSkills(); this.clearSkills(true);
this.node.identity.style.backgroundColor=''; this.node.identity.style.backgroundColor='';
this.node.intro.innerHTML=''; this.node.intro.innerHTML='';
this.node.name.innerHTML=''; this.node.name.innerHTML='';
@ -11123,14 +11191,14 @@
if(typeof ai.get.attitude=='function') return ai.get.attitude(this,target); if(typeof ai.get.attitude=='function') return ai.get.attitude(this,target);
return 0; return 0;
}, },
clearSkills:function(){ clearSkills:function(all){
var list=[]; var list=[];
var exclude=[]; var exclude=[];
for(var i=0;i<arguments.length;i++){ for(var i=0;i<arguments.length;i++){
exclude.push(arguments[i]); exclude.push(arguments[i]);
} }
for(i=0;i<this.skills.length;i++){ for(i=0;i<this.skills.length;i++){
if(lib.skill[this.skills[i]].temp) continue; if(!all&&lib.skill[this.skills[i]].temp) continue;
if(!exclude.contains(this.skills[i])){ if(!exclude.contains(this.skills[i])){
list.push(this.skills[i]); list.push(this.skills[i]);
} }
@ -13045,9 +13113,11 @@
else{ else{
parent=this.parent; parent=this.parent;
} }
if(!parent) return {};
if(typeof level=='number'){ if(typeof level=='number'){
for(var i=1;i<level;i++){ for(var i=1;i<level;i++){
parent=parent.parent; parent=parent.parent;
if(!parent) return {};
} }
} }
return parent; return parent;
@ -25244,7 +25314,12 @@
var li2=document.createElement('li'); var li2=document.createElement('li');
li1.innerHTML='游戏版本:'+lib.version+'<p style="margin-top:8px;white-space:nowrap"></p>'; li1.innerHTML='游戏版本:'+lib.version+'<p style="margin-top:8px;white-space:nowrap"></p>';
li2.innerHTML='素材版本:'+(lib.config.asset_version||'无')+'<p style="margin-top:8px"></p>'; li2.innerHTML='素材版本:'+(lib.config.asset_version||'无')+'<p style="margin-top:8px"></p>';
ui.updatep1=li1.querySelector('p');
ui.updatep2=li2;
if(!game.download){
ui.updatep1.style.display='none';
ui.updatep2.style.display='none';
}
var button1,button2,button3; var button1,button2,button3;
var span1,includeskin; var span1,includeskin;
@ -25356,14 +25431,14 @@
} }
} }
game.saveConfig('check_version',update.version); game.saveConfig('check_version',update.version);
if(update.version!=lib.version||lib.config.dev){ if(update.version!=lib.version||lib.config.debug){
var files; var files;
var version=lib.version; var version=lib.version;
if(update.files&&update.files[version]){ if(update.files&&update.files[version]){
files=update.files.global.concat(update.files[version]); files=update.files.global.concat(update.files[version]);
} }
var str; var str;
if(lib.config.dev){ if(lib.config.debug){
str='开发版仅供测试使用,可能存在风险,是否确定更新?' str='开发版仅供测试使用,可能存在风险,是否确定更新?'
} }
else{ else{
@ -30579,7 +30654,7 @@
}, },
}, },
url:function(tag){ url:function(tag){
if(lib.config.dev){ if(lib.config.debug){
switch(tag){ switch(tag){
case 'version':return lib.sourceURL.replace(/\$version\$/,'master'); case 'version':return lib.sourceURL.replace(/\$version\$/,'master');
case 'source':return lib.sourceURL.replace(/\$version\$/,'master'); case 'source':return lib.sourceURL.replace(/\$version\$/,'master');

View File

@ -20,3 +20,4 @@ window.noname_update={
//增加牌堆补充扩展 //增加牌堆补充扩展
//改进塔防模式 //改进塔防模式
//新武将

View File

@ -9018,6 +9018,7 @@ mode.stone={
popup:false, popup:false,
priority:15, priority:15,
filter:function(event,player){ filter:function(event,player){
console.log(1);
return !player.isMin(); return !player.isMin();
}, },
content:function(){ content:function(){