v1.9.91.3

This commit is contained in:
Spmario233 2019-08-09 14:52:26 +08:00 committed by GitHub
parent d7eb6507f2
commit f3bfc69388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 180 additions and 95 deletions

View File

@ -277,13 +277,19 @@ game.import('card',function(lib,game,ui,get,ai,_status){
fullskin:true, fullskin:true,
type:'trick', type:'trick',
enable:function(card,player){ enable:function(card,player){
return !player.isUnseen(); if(get.mode()=='guozhan') return !player.isUnseen();
return true;
}, },
mode:['guozhan'], mode:['guozhan','boss'],
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.identity!='unknown'&&(target.identity!=player.identity||target.identity=='ye'); if(get.mode()=='guozhan') return target!=player&&target.identity!='unknown'&&(target.identity!=player.identity||target.identity=='ye');
return true;
},
selectTarget:function(){
return get.mode()=='guozhan'?1:-1;
}, },
changeTarget:function(player,targets){ changeTarget:function(player,targets){
if(get.mode()=='guozhan'){
var target=targets[0]; var target=targets[0];
targets.push(player); targets.push(player);
if(target.identity!='ye'){ if(target.identity!='ye'){
@ -291,17 +297,26 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return target!=current&&target.identity==current.identity&&!current.hasSkill('diaohulishan'); return target!=current&&target.identity==current.identity&&!current.hasSkill('diaohulishan');
},targets); },targets);
} }
}
}, },
contentBefore:function(){ contentBefore:function(){
if(get.mode()=='guozhan'){
var evt=event.getParent(); var evt=event.getParent();
if(evt&&evt.targets&&evt.targets.contains(player)){ if(evt&&evt.targets&&evt.targets.contains(player)){
evt.fixedSeat=true; evt.fixedSeat=true;
evt.targets.remove(player); evt.targets.remove(player);
evt.targets.push(player); evt.targets.push(player);
} }
}
}, },
content:function(){ content:function(){
'step 0' 'step 0'
if(get.mode()!='guozhan'){
if(player==target) target.draw(game.players.length);
else target.chooseDrawRecover(true);
event.finish();
}
else{
if(target==player){ if(target==player){
var num=targets.length-1; var num=targets.length-1;
event.num=num; event.num=num;
@ -325,6 +340,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
else{ else{
target.draw(); target.draw();
} }
}
'step 1' 'step 1'
if(target!=player) target.link(false); if(target!=player) target.link(false);
else if(typeof result.control=='string'){ else if(typeof result.control=='string'){
@ -340,7 +356,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
value:4, value:4,
useful:2, useful:2,
result:{ result:{
player:1.3, player:1.5,
target:1, target:1,
}, },
}, },
@ -1330,7 +1346,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){
lulitongxin:'勠力同心', lulitongxin:'勠力同心',
lulitongxin_info:'出牌阶段,对所有大势力角色或所有小势力角色使用。若目标角色:不处于“连环状态”,其横置;处于“连环状态”,其摸一张牌', lulitongxin_info:'出牌阶段,对所有大势力角色或所有小势力角色使用。若目标角色:不处于“连环状态”,其横置;处于“连环状态”,其摸一张牌',
lianjunshengyan:'联军盛宴', lianjunshengyan:'联军盛宴',
lianjunshengyan_info:'出牌阶段对你和你选择的除你的势力外的一个势力的所有角色。若目标角色为你你摸X张牌或回复X点体力X为该势力的角色数不为你其摸一张牌然后重置', lianjunshengyan_info:'出牌阶段对你和你选择的除你的势力外的一个势力的所有角色。若目标角色为你你摸X张牌或回复X点体力X为该势力的角色数不为你其摸一张牌然后重置。',
lianjunshengyan_info_boss:'出牌阶段对场上所有角色使用。你摸X张牌X为目存活角色数其他角色依次选择回复1点体力或摸一张牌。',
chiling:'敕令', chiling:'敕令',
chiling_info:'出牌阶段对所有没有势力的角色使用。目标角色选择一项1、明置一张武将牌然后摸一张牌2、弃置一张装备牌3、失去1点体力。当【敕令】因判定或弃置而置入弃牌堆时系统将之移出游戏然后系统于当前回合结束后视为对所有没有势力的角色使用【敕令】', chiling_info:'出牌阶段对所有没有势力的角色使用。目标角色选择一项1、明置一张武将牌然后摸一张牌2、弃置一张装备牌3、失去1点体力。当【敕令】因判定或弃置而置入弃牌堆时系统将之移出游戏然后系统于当前回合结束后视为对所有没有势力的角色使用【敕令】',
diaohulishan:'调虎离山', diaohulishan:'调虎离山',

View File

@ -3843,7 +3843,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{global:'useCardAfter'}, trigger:{global:'useCardAfter'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return (event.card.name=='nanman'&&event.player!=player&&get.position(event.cards[0])=='d'&&get.itemtype(event.cards)=='cards'); return (event.card.name=='nanman'&&event.player!=player&&get.itemtype(event.cards)=='cards'&&get.position(event.cards[0])=='d');
}, },
content:function(){ content:function(){
player.gain(trigger.cards,'gain2'); player.gain(trigger.cards,'gain2');

View File

@ -5743,9 +5743,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
var num; var num;
if(get.mode()=='identity'){ var mode=get.mode();
if(mode=='identity'){
num=get.population('fan'); num=get.population('fan');
} }
else if(mode=='versus'){
num=player.getEnemies().length;
}
else{ else{
num=1; num=1;
} }
@ -9386,14 +9390,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
priority:9, priority:9,
audio:2, audio:2,
filter:function(event,player){ filter:function(event,player){
return event.player!=player&&get.type(event.card)=='trick'&&event.targets&&event.targets.length>1; return event.player!=player&&!event.excluded.contains(player)&&get.type(event.card)=='trick'&&event.targets&&event.targets.length>1&&event.targets.contains(player);
}, },
check:function(event,player){ check:function(event,player){
return get.tag(event.card,'multineg')||get.effect(player,event.card,event.player,player)<=0; return get.tag(event.card,'multineg')||get.effect(player,event.card,event.player,player)<=0;
}, },
trigger:{target:'useCardToBefore'}, trigger:{global:'useCard'},
content:function(){ content:function(){
trigger.cancel(); trigger.excluded.add(player);
player.draw(); player.draw();
}, },
ai:{ ai:{
@ -12690,7 +12694,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
hongde:'弘德', hongde:'弘德',
hongde_info:'当你一次获得或失去至少两张牌后,你可以令一名其他角色摸一张牌', hongde_info:'当你一次获得或失去至少两张牌后,你可以令一名其他角色摸一张牌',
dingpan:'定叛', dingpan:'定叛',
dingpan_info:'出牌阶段限X次你可以令一名装备区里有牌的角色摸一张牌然后其选择一项1.令你弃置其装备区里的一张牌2.获得其装备区里的所有牌若如此做你对其造成1点伤害X为场上存活的反贼数非身份模式改为1', dingpan_info_identity:'出牌阶段限X次你可以令一名装备区里有牌的角色摸一张牌然后其选择一项1.令你弃置其装备区里的一张牌2.获得其装备区里的所有牌若如此做你对其造成1点伤害X为场上存活的反贼数',
dingpan_info_versus:'出牌阶段限X次你可以令一名装备区里有牌的角色摸一张牌然后其选择一项1.令你弃置其装备区里的一张牌2.获得其装备区里的所有牌若如此做你对其造成1点伤害X为场上存活的敌方角色数',
dingpan_info:'出牌阶段限一次你可以令一名装备区里有牌的角色摸一张牌然后其选择一项1.令你弃置其装备区里的一张牌2.获得其装备区里的所有牌若如此做你对其造成1点伤害',
weidi:'伪帝', weidi:'伪帝',
weidi_info:'锁定技,你视为拥有当前主公的主公技', weidi_info:'锁定技,你视为拥有当前主公的主公技',
juesi:'决死', juesi:'决死',

View File

@ -3781,16 +3781,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
jinjiu:{ jinjiu:{
mod:{ mod:{
cardEnabled:function(card,player){ cardEnabled:function(card,player){
if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false; if(card.name=='jiu'&&get.position(card)=='h'&&_status.event.skill==undefined) return false;
}, },
cardUsable:function(card,player){ cardUsable:function(card,player){
if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false; if(card.name=='jiu'&&get.position(card)=='h'&&_status.event.skill==undefined) return false;
}, },
cardRespondable:function(card,player){ cardRespondable:function(card,player){
if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false; if(card.name=='jiu'&&get.position(card)=='h'&&_status.event.skill==undefined) return false;
}, },
cardSavable:function(card,player){ cardSavable:function(card,player){
if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false; if(card.name=='jiu'&&get.position(card)=='h'&&_status.event.skill==undefined) return false;
}, },
}, },
enable:['chooseToUse','chooseToRespond'], enable:['chooseToUse','chooseToRespond'],
@ -5127,41 +5127,35 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return event.parent.skill=='zhanjue'; return event.parent.skill=='zhanjue';
}, },
content:function(){ content:function(){
player.storage.zhanjue2=trigger.player; trigger.player.addTempSkill('zhanjue5');
} }
}, },
zhanjue4:{ zhanjue4:{
audio:false, audio:false,
trigger:{player:'juedouAfter'}, trigger:{player:'useCardAfter'},
forced:true, forced:true,
popup:false, popup:false,
filter:function(event,player){ filter:function(event,player){
return event.skill=='zhanjue'; return event.skill=='zhanjue';
}, },
content:function(){ content:function(){
var num=1;
if(player.hasSkill('zhanjue5')) num++;
var list=game.filterPlayer(function(current){
var bool=(current==player||current.hasSkill('zhanjue5'));
if(bool) current.removeSkill('zhanjue5');
return bool;
});
if(typeof player.storage.zhanjue!='number'){ if(typeof player.storage.zhanjue!='number'){
player.storage.zhanjue=0; player.storage.zhanjue=0;
} }
if(player.storage.zhanjue2==player){ player.storage.zhanjue+=num;
player.draw(2); game.asyncDraw(list,function(current){
player.storage.zhanjue+=2; return current==player?num:1;
} });
else if(player.storage.zhanjue2){
if(player.storage.zhanjue2.isAlive()){
game.asyncDraw([player,player.storage.zhanjue2]);
}
else{
player.draw();
}
player.storage.zhanjue++;
}
else{
player.draw();
player.storage.zhanjue++;
}
delete player.storage.zhanjue2;
} }
}, },
zhanjue5:{},
qinwang:{ qinwang:{
audio:'qinwang1', audio:'qinwang1',
unique:true, unique:true,
@ -5366,7 +5360,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
zuoding2:{}, zuoding2:{},
zuoding3:{ zuoding3:{
trigger:{global:'damageEnd'}, trigger:{global:'damage'},
silent:true, silent:true,
content:function(){ content:function(){
player.addTempSkill('zuoding2'); player.addTempSkill('zuoding2');
@ -5505,6 +5499,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
viewAs:{name:links[0][2],nature:links[0][3],suit:null,number:null}, viewAs:{name:links[0][2],nature:links[0][3],suit:null,number:null},
position:'he', position:'he',
popname:true, popname:true,
ignoreMod:true,
precontent:function(){ precontent:function(){
'step 0' 'step 0'
player.logSkill('huomo'); player.logSkill('huomo');

View File

@ -19201,6 +19201,12 @@
}); });
} }
} }
else if(mode=='doudizhu'){
targets=game.filterPlayer(function(target){
if(func&&!func(target)) return false;
return target.identity!=player.identity;
});
}
else{ else{
targets=game.filterPlayer(function(target){ targets=game.filterPlayer(function(target){
if(func&&!func(target)) return false; if(func&&!func(target)) return false;
@ -19244,6 +19250,12 @@
}); });
} }
} }
else if(mode=='doudizhu'){
targets=game.filterPlayer(function(target){
if(func&&!func(target)) return false;
return target.identity==player.identity;
});
}
else{ else{
targets=game.filterPlayer(function(target){ targets=game.filterPlayer(function(target){
if(func&&!func(target)) return false; if(func&&!func(target)) return false;
@ -19268,6 +19280,9 @@
if(player.identity=='unknown'||player.identity=='ye') return false; if(player.identity=='unknown'||player.identity=='ye') return false;
return this.identity==player.identity; return this.identity==player.identity;
} }
if(get.mode()=='doudizhu'){
return this.identity==player.identity;
}
if(this.side!=undefined&&typeof player.side=='boolean'){ if(this.side!=undefined&&typeof player.side=='boolean'){
return this.side==player.side; return this.side==player.side;
} }
@ -21885,7 +21900,15 @@
if(info.selectButton!=undefined) this.selectButton=info.selectButton; if(info.selectButton!=undefined) this.selectButton=info.selectButton;
if(info.filterTarget!=undefined) this.filterTarget=get.filter(info.filterTarget); if(info.filterTarget!=undefined) this.filterTarget=get.filter(info.filterTarget);
if(info.selectTarget!=undefined) this.selectTarget=info.selectTarget; if(info.selectTarget!=undefined) this.selectTarget=info.selectTarget;
if(info.filterCard!=undefined) this.filterCard=get.filter(info.filterCard); if(info.filterCard!=undefined){
this.filterCard=function(card,player,event){
if(!info.ignoreMod&&player){
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player);
if(mod!='unchanged') return mod;
}
return get.filter(info.filterCard)(card,player,event);
};
}
if(info.selectCard!=undefined) this.selectCard=info.selectCard; if(info.selectCard!=undefined) this.selectCard=info.selectCard;
if(info.position!=undefined) this.position=info.position; if(info.position!=undefined) this.position=info.position;
if(info.forced!=undefined) this.forced=info.forced; if(info.forced!=undefined) this.forced=info.forced;
@ -25687,6 +25710,10 @@
game.players[i].init(players[i].name,players[i].name2); game.players[i].init(players[i].name,players[i].name2);
game.players[i].setIdentity(players[i].identity); game.players[i].setIdentity(players[i].identity);
} }
else if(lib.config.mode=='doudizhu'){
game.players[i].init(players[i].name,players[i].name2);
game.players[i].setIdentity(players[i].identity);
}
else if(lib.config.mode=='stone'){ else if(lib.config.mode=='stone'){
game.players[i].init(players[i].name,players[i].name2); game.players[i].init(players[i].name,players[i].name2);
game.players[i].classList.add('noidentity'); game.players[i].classList.add('noidentity');

View File

@ -1,25 +1,18 @@
window.noname_update={ window.noname_update={
version:'1.9.91.2', version:'1.9.91.3',
update:'1.9.91.1', update:'1.9.91.2',
changeLog:[ changeLog:[
'新虎牢关by 烟雨墨染)',
'斗地主模式(支持联机)',
'BUG修复', 'BUG修复',
], ],
files:[ files:[
'card/guozhan.js', 'card/guozhan.js',
'character/extra.js',
'character/refresh.js',
'character/shenhua.js', 'character/shenhua.js',
'character/sp.js', 'character/sp.js',
'character/xinghuoliaoyuan.js',
'character/yijiang.js', 'character/yijiang.js',
'mode/boss.js', 'mode/boss.js',
'mode/doudizhu.js', 'mode/doudizhu.js',
'mode/guozhan.js', 'mode/guozhan.js',
'mode/versus.js', 'mode/versus.js',
'game/config.js',
'game/package.js',
'game/game.js', 'game/game.js',
] ]
}; };

View File

@ -1873,7 +1873,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
boss_lvbu1:{ boss_lvbu1:{
loopType:2, loopType:2,
gameDraw:function(player){ gameDraw:function(player){
return player==game.boss?8:4; if(player==game.boss) return 8;
if(player==game.boss.previous) return 5;
return 4;
},
loopFirst:function(){
return game.boss.nextSeat;
}, },
init:function(){ init:function(){
lib.inpile.remove('wugu'); lib.inpile.remove('wugu');
@ -1882,7 +1887,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
lib.inpile.remove('tengjia'); lib.inpile.remove('tengjia');
lib.inpile.remove('fangtian'); lib.inpile.remove('fangtian');
lib.inpile.remove('muniu'); lib.inpile.remove('muniu');
lib.inpile.addArray(['wushuangfangtianji','shufazijinguan','hongmianbaihuapao','linglongshimandai']); lib.inpile.addArray(['wushuangfangtianji','shufazijinguan','hongmianbaihuapao','linglongshimandai','lianjunshengyan']);
var equiplist=[]; var equiplist=[];
for(var i=0;i<ui.cardPile.childElementCount;i++){ for(var i=0;i<ui.cardPile.childElementCount;i++){
var node=ui.cardPile.childNodes[i]; var node=ui.cardPile.childNodes[i];
@ -1902,6 +1907,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
node.init([node.suit,node.number,'shufazijinguan']); node.init([node.suit,node.number,'shufazijinguan']);
equiplist.push(node); equiplist.push(node);
} }
else if(node.name=='wugu'||node.name=='taoyuan'){
node.init([node.suit,node.number,'lianjunshengyan']);
}
} }
equiplist.randomSort(); equiplist.randomSort();
var next=game.createEvent('boss_jingjia'); var next=game.createEvent('boss_jingjia');
@ -1970,7 +1978,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
forced:true, forced:true,
filter:function (event,player){ filter:function (event,player){
return (player.getEquip(3)||player.getEquip(4))&&event.num>1; return (player.getEquip(3)||player.getEquip(4));
}, },
content:function(){ content:function(){
trigger.num++; trigger.num++;

View File

@ -74,24 +74,55 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
identity:players[i].identity identity:players[i].identity
}); });
} }
_status.videoInited=true, _status.videoInited=true;
game.addVideo('init',null,info); game.addVideo('init',null,info);
game.gameDraw(game.zhu||_status.firstAct||game.me); game.gameDraw(game.zhu||_status.firstAct||game.me);
game.phaseLoop(game.zhu||_status.firstAct||game.me); game.phaseLoop(game.zhu||_status.firstAct||game.me);
}, },
game:{ game:{
getRoomInfo:function(uiintro){ addRecord:function(bool){
uiintro.add('<div class="text chat">游戏模式:'+(lib.configOL.identity_mode=='zhong'?'明忠':'标准')); if(typeof bool=='boolean'){
uiintro.add('<div class="text chat">双将模式:'+(lib.configOL.double_character?'开启':'关闭')); var data=lib.config.gameRecord.doudizhu.data;
if(lib.configOL.identity_mode!='zhong'){ var identity=game.me.identity;
uiintro.add('<div class="text chat">双内奸:'+(lib.configOL.double_nei?'开启':'关闭')); if(!data[identity]){
uiintro.add('<div class="text chat">加强主公:'+(lib.configOL.enhance_zhu?'开启':'关闭')); data[identity]=[0,0];
}
if(bool){
data[identity][0]++;
} }
else{ else{
uiintro.add('<div class="text chat">卡牌替换:'+(lib.configOL.zhong_card?'开启':'关闭')); data[identity][1]++;
} }
var last=uiintro.add('<div class="text chat">出牌时限:'+lib.configOL.choose_timeout+'秒'); var list=['zhu','fan'];
var str='';
for(var i=0;i<list.length;i++){
if(data[list[i]]){
str+=lib.translate[list[i]+'2']+''+data[list[i]][0]+'胜'+' '+data[list[i]][1]+'负<br>';
}
}
lib.config.gameRecord.doudizhu.str=str;
game.saveConfig('gameRecord',lib.config.gameRecord);
}
},
getState:function(){
var state={};
for(var i in lib.playerOL){
var player=lib.playerOL[i];
state[i]={identity:player.identity};
}
return state;
},
updateState:function(state){
for(var i in state){
var player=lib.playerOL[i];
if(player){
player.identity=state[i].identity;
}
}
},
getRoomInfo:function(uiintro){
uiintro.add('<div class="text chat">双将模式:'+(lib.configOL.double_character?'开启':'关闭'));
// uiintro.add('<div class="text chat">屏蔽弱将:'+(lib.configOL.ban_weak?'开启':'关闭')); // uiintro.add('<div class="text chat">屏蔽弱将:'+(lib.configOL.ban_weak?'开启':'关闭'));
// var last=uiintro.add('<div class="text chat">屏蔽强将:'+(lib.configOL.ban_strong?'开启':'关闭')); // var last=uiintro.add('<div class="text chat">屏蔽强将:'+(lib.configOL.ban_strong?'开启':'关闭'));
if(lib.configOL.banned.length){ if(lib.configOL.banned.length){

View File

@ -6609,10 +6609,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
else{ else{
data[identity][1]++; data[identity][1]++;
} }
var list=['wei','shu','wu','qun','ye']; var list=lib.group.slice(0);
list.add('ye');
var str=''; var str='';
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
if(data[list[i]]){ if(list[i]!='shen'&&data[list[i]]){
str+=lib.translate[list[i]+'2']+''+data[list[i]][0]+'胜'+' '+data[list[i]][1]+'负<br>'; str+=lib.translate[list[i]+'2']+''+data[list[i]][0]+'胜'+' '+data[list[i]][1]+'负<br>';
} }
} }
@ -6758,18 +6759,18 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
if(game.me.identity=='ye'){ if(game.me.identity=='ye'){
if(game.me.classList.contains('dead')){ if(game.me.classList.contains('dead')){
game.over('战斗失败'); game.over(false);
} }
else{ else{
game.over('战斗胜利'); game.over(true);
} }
} }
else{ else{
if(get.population(game.me.identity)==0){ if(get.population(game.me.identity)==0){
game.over('战斗失败'); game.over(false);
} }
else{ else{
game.over('战斗胜利'); game.over(true);
} }
} }
game.showIdentity(); game.showIdentity();

View File

@ -528,6 +528,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
last.style.paddingBottom='8px'; last.style.paddingBottom='8px';
}, },
getVideoName:function(){ getVideoName:function(){
if(_status.mode=='three'){
var zhu=game.findPlayer(function(current){
return current.side==game.me.side&&current.identity=='zhu';
});
var str=(game.me.side?'暖/':'冷/')+get.translation(zhu.previousSeat.name)+'/'+get.translation(zhu.name)+'/'+get.translation(zhu.nextSeat.name);
return ['统率三军',str]
}
var str=get.translation(game.me.name); var str=get.translation(game.me.name);
if(game.me.name2){ if(game.me.name2){
str+='/'+get.translation(game.me.name2); str+='/'+get.translation(game.me.name2);