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'},
forced:true,
mark:true,
temp:true,
intro:{
content:'摸牌阶段摸牌数+1'
},
@ -1596,6 +1597,7 @@ card.swd={
}
},
nopop:true,
temp:true,
trigger:{global:'phaseBegin'},
forced:true,
popup:false,

View File

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

View File

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

View File

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

View File

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