From f3bfc693882b135ab04d1da0cf372bb653a303b3 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Fri, 9 Aug 2019 14:52:26 +0800 Subject: [PATCH] v1.9.91.3 --- card/guozhan.js | 85 ++++++++++++++++++++++++++------------------ character/shenhua.js | 2 +- character/sp.js | 16 ++++++--- character/yijiang.js | 45 +++++++++++------------ game/game.js | 29 ++++++++++++++- game/update.js | 11 ++---- mode/boss.js | 14 ++++++-- mode/doudizhu.js | 53 +++++++++++++++++++++------ mode/guozhan.js | 13 +++---- mode/versus.js | 7 ++++ 10 files changed, 180 insertions(+), 95 deletions(-) diff --git a/card/guozhan.js b/card/guozhan.js index 02653e931..5fe738472 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -277,53 +277,69 @@ game.import('card',function(lib,game,ui,get,ai,_status){ fullskin:true, type:'trick', 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){ - 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){ - var target=targets[0]; - targets.push(player); - if(target.identity!='ye'){ + if(get.mode()=='guozhan'){ + var target=targets[0]; + targets.push(player); + if(target.identity!='ye'){ game.filterPlayer(function(current){ return target!=current&&target.identity==current.identity&&!current.hasSkill('diaohulishan'); - },targets); + },targets); + } } }, contentBefore:function(){ - var evt=event.getParent(); - if(evt&&evt.targets&&evt.targets.contains(player)){ - evt.fixedSeat=true; - evt.targets.remove(player); - evt.targets.push(player); + if(get.mode()=='guozhan'){ + var evt=event.getParent(); + if(evt&&evt.targets&&evt.targets.contains(player)){ + evt.fixedSeat=true; + evt.targets.remove(player); + evt.targets.push(player); + } } }, content:function(){ 'step 0' - if(target==player){ - var num=targets.length-1; - event.num=num; - var damaged=target.maxHp-target.hp; - if(damaged==0){ - target.draw(num); - event.finish(); - } - else{ - var list=[]; - for(var i=0;i<=Math.min(num,damaged);i++){ - list.push('摸'+i+'回'+(num-i)); - } - target.chooseControl(list).set('prompt','请分配自己的摸牌数和回复量').ai=function(){ - if(player.hasSkill('diaohulishan')) return 0; - if(_status._aozhan) return list.length-1; - return list.randomGet(); - }; - } + if(get.mode()!='guozhan'){ + if(player==target) target.draw(game.players.length); + else target.chooseDrawRecover(true); + event.finish(); } else{ - target.draw(); + if(target==player){ + var num=targets.length-1; + event.num=num; + var damaged=target.maxHp-target.hp; + if(damaged==0){ + target.draw(num); + event.finish(); + } + else{ + var list=[]; + for(var i=0;i<=Math.min(num,damaged);i++){ + list.push('摸'+i+'回'+(num-i)); + } + target.chooseControl(list).set('prompt','请分配自己的摸牌数和回复量').ai=function(){ + if(player.hasSkill('diaohulishan')) return 0; + if(_status._aozhan) return list.length-1; + return list.randomGet(); + }; + } + } + else{ + target.draw(); + } } 'step 1' if(target!=player) target.link(false); @@ -340,7 +356,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ value:4, useful:2, result:{ - player:1.3, + player:1.5, target:1, }, }, @@ -1330,7 +1346,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){ lulitongxin:'勠力同心', lulitongxin_info:'出牌阶段,对所有大势力角色或所有小势力角色使用。若目标角色:不处于“连环状态”,其横置;处于“连环状态”,其摸一张牌', lianjunshengyan:'联军盛宴', - lianjunshengyan_info:'出牌阶段,对你和你选择的除你的势力外的一个势力的所有角色。若目标角色:为你,你摸X张牌或回复X点体力(X为该势力的角色数);不为你,其摸一张牌,然后重置', + lianjunshengyan_info:'出牌阶段,对你和你选择的除你的势力外的一个势力的所有角色。若目标角色:为你,你摸X张牌或回复X点体力(X为该势力的角色数);不为你,其摸一张牌,然后重置。', + lianjunshengyan_info_boss:'出牌阶段,对场上所有角色使用。你摸X张牌(X为目存活角色数),其他角色依次选择回复1点体力或摸一张牌。', chiling:'敕令', chiling_info:'出牌阶段,对所有没有势力的角色使用。目标角色选择一项:1、明置一张武将牌,然后摸一张牌;2、弃置一张装备牌;3、失去1点体力。当【敕令】因判定或弃置而置入弃牌堆时,系统将之移出游戏,然后系统于当前回合结束后视为对所有没有势力的角色使用【敕令】', diaohulishan:'调虎离山', diff --git a/character/shenhua.js b/character/shenhua.js index 819ee9ea8..f642b72bb 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -3843,7 +3843,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'useCardAfter'}, forced:true, 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(){ player.gain(trigger.cards,'gain2'); diff --git a/character/sp.js b/character/sp.js index de6008923..6535c06c2 100755 --- a/character/sp.js +++ b/character/sp.js @@ -5743,9 +5743,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ enable:'phaseUse', filter:function(event,player){ var num; - if(get.mode()=='identity'){ + var mode=get.mode(); + if(mode=='identity'){ num=get.population('fan'); } + else if(mode=='versus'){ + num=player.getEnemies().length; + } else{ num=1; } @@ -9386,14 +9390,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ priority:9, audio:2, 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){ return get.tag(event.card,'multineg')||get.effect(player,event.card,event.player,player)<=0; }, - trigger:{target:'useCardToBefore'}, + trigger:{global:'useCard'}, content:function(){ - trigger.cancel(); + trigger.excluded.add(player); player.draw(); }, ai:{ @@ -12690,7 +12694,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ hongde:'弘德', hongde_info:'当你一次获得或失去至少两张牌后,你可以令一名其他角色摸一张牌', 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_info:'锁定技,你视为拥有当前主公的主公技', juesi:'决死', diff --git a/character/yijiang.js b/character/yijiang.js index 13d723572..74e30bb79 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -3781,16 +3781,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ jinjiu:{ mod:{ 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){ - 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){ - 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){ - 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'], @@ -5127,41 +5127,35 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return event.parent.skill=='zhanjue'; }, content:function(){ - player.storage.zhanjue2=trigger.player; + trigger.player.addTempSkill('zhanjue5'); } }, zhanjue4:{ audio:false, - trigger:{player:'juedouAfter'}, + trigger:{player:'useCardAfter'}, forced:true, popup:false, filter:function(event,player){ return event.skill=='zhanjue'; }, 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'){ player.storage.zhanjue=0; } - if(player.storage.zhanjue2==player){ - player.draw(2); - player.storage.zhanjue+=2; - } - 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; + player.storage.zhanjue+=num; + game.asyncDraw(list,function(current){ + return current==player?num:1; + }); } }, + zhanjue5:{}, qinwang:{ audio:'qinwang1', unique:true, @@ -5366,7 +5360,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, zuoding2:{}, zuoding3:{ - trigger:{global:'damageEnd'}, + trigger:{global:'damage'}, silent:true, content:function(){ 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}, position:'he', popname:true, + ignoreMod:true, precontent:function(){ 'step 0' player.logSkill('huomo'); diff --git a/game/game.js b/game/game.js index 50f62bd20..b6dcd78d4 100644 --- a/game/game.js +++ b/game/game.js @@ -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{ targets=game.filterPlayer(function(target){ 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{ targets=game.filterPlayer(function(target){ if(func&&!func(target)) return false; @@ -19268,6 +19280,9 @@ if(player.identity=='unknown'||player.identity=='ye') return false; return this.identity==player.identity; } + if(get.mode()=='doudizhu'){ + return this.identity==player.identity; + } if(this.side!=undefined&&typeof player.side=='boolean'){ return this.side==player.side; } @@ -21885,7 +21900,15 @@ if(info.selectButton!=undefined) this.selectButton=info.selectButton; if(info.filterTarget!=undefined) this.filterTarget=get.filter(info.filterTarget); 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.position!=undefined) this.position=info.position; 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].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'){ game.players[i].init(players[i].name,players[i].name2); game.players[i].classList.add('noidentity'); diff --git a/game/update.js b/game/update.js index cd3d40360..4a0e8db15 100644 --- a/game/update.js +++ b/game/update.js @@ -1,25 +1,18 @@ window.noname_update={ - version:'1.9.91.2', - update:'1.9.91.1', + version:'1.9.91.3', + update:'1.9.91.2', changeLog:[ - '新虎牢关(by 烟雨墨染)', - '斗地主模式(支持联机)', 'BUG修复', ], files:[ 'card/guozhan.js', - 'character/extra.js', - 'character/refresh.js', 'character/shenhua.js', 'character/sp.js', - 'character/xinghuoliaoyuan.js', 'character/yijiang.js', 'mode/boss.js', 'mode/doudizhu.js', 'mode/guozhan.js', 'mode/versus.js', - 'game/config.js', - 'game/package.js', 'game/game.js', ] }; diff --git a/mode/boss.js b/mode/boss.js index 87d1dc3eb..72e5f9ffa 100644 --- a/mode/boss.js +++ b/mode/boss.js @@ -1873,7 +1873,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ boss_lvbu1:{ loopType:2, 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(){ 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('fangtian'); lib.inpile.remove('muniu'); - lib.inpile.addArray(['wushuangfangtianji','shufazijinguan','hongmianbaihuapao','linglongshimandai']); + lib.inpile.addArray(['wushuangfangtianji','shufazijinguan','hongmianbaihuapao','linglongshimandai','lianjunshengyan']); var equiplist=[]; for(var i=0;i1; + return (player.getEquip(3)||player.getEquip(4)); }, content:function(){ trigger.num++; diff --git a/mode/doudizhu.js b/mode/doudizhu.js index 19ae214e8..ad59a4b82 100644 --- a/mode/doudizhu.js +++ b/mode/doudizhu.js @@ -64,7 +64,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ game.syncState(); event.trigger('gameStart'); - + var players=get.players(lib.sort.position); var info=[]; for(var i=0;i'; + } + } + 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('
游戏模式:'+(lib.configOL.identity_mode=='zhong'?'明忠':'标准')); uiintro.add('
双将模式:'+(lib.configOL.double_character?'开启':'关闭')); - if(lib.configOL.identity_mode!='zhong'){ - uiintro.add('
双内奸:'+(lib.configOL.double_nei?'开启':'关闭')); - uiintro.add('
加强主公:'+(lib.configOL.enhance_zhu?'开启':'关闭')); - } - else{ - uiintro.add('
卡牌替换:'+(lib.configOL.zhong_card?'开启':'关闭')); - } - var last=uiintro.add('
出牌时限:'+lib.configOL.choose_timeout+'秒'); // uiintro.add('
屏蔽弱将:'+(lib.configOL.ban_weak?'开启':'关闭')); // var last=uiintro.add('
屏蔽强将:'+(lib.configOL.ban_strong?'开启':'关闭')); if(lib.configOL.banned.length){ diff --git a/mode/guozhan.js b/mode/guozhan.js index f6fcbbfe2..0f7259837 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -6609,10 +6609,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ else{ data[identity][1]++; } - var list=['wei','shu','wu','qun','ye']; + var list=lib.group.slice(0); + list.add('ye'); var str=''; for(var i=0;i'; } } @@ -6758,18 +6759,18 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } if(game.me.identity=='ye'){ if(game.me.classList.contains('dead')){ - game.over('战斗失败'); + game.over(false); } else{ - game.over('战斗胜利'); + game.over(true); } } else{ if(get.population(game.me.identity)==0){ - game.over('战斗失败'); + game.over(false); } else{ - game.over('战斗胜利'); + game.over(true); } } game.showIdentity(); diff --git a/mode/versus.js b/mode/versus.js index 10a60e822..bb3aee2a2 100644 --- a/mode/versus.js +++ b/mode/versus.js @@ -528,6 +528,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ last.style.paddingBottom='8px'; }, getVideoName:function(){ + if(_status.mode=='three'){ + var zhu=game.findPlayer(function(current){ + return current.side==game.me.side&¤t.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); if(game.me.name2){ str+='/'+get.translation(game.me.name2);