diff --git a/character/boss.js b/character/boss.js index 600e56c14..cf22b9da1 100644 --- a/character/boss.js +++ b/character/boss.js @@ -1029,7 +1029,7 @@ character.boss={ "step 1" var targets=[]; if(result.color=='red'){ - game.playAudio('boss_biantianx2'); + game.trySkillAudio('boss_biantianx2'); for(var i=0;i0; diff --git a/character/sp.js b/character/sp.js index d926f782e..4c5625086 100755 --- a/character/sp.js +++ b/character/sp.js @@ -404,6 +404,7 @@ character.sp={ if(!player.num('he')) return false; if(event.targets.length>1) return false; if(!event.target) return false; + if(event.target.hp>=player.hp) return false; var card=event.card; if(card.name=='sha') return true; diff --git a/game/config.js b/game/config.js index beb4ae5c2..3f37d0013 100755 --- a/game/config.js +++ b/game/config.js @@ -1,13 +1,9 @@ window.config={ forbidai:['zuoci','caiwenji'], - forbidsingle:['menghuo','huanggai','machao','pangde','yanwen','xiahoudun','xuzhu','luxun', - 'xuhuang','yujin','xiaoqiao','daqiao','zhangjiao','zhangbao'], - forbidall:['xiahouyuan','huangzhong','weiyan','dianwei','zhangjiao'], - forbidpack:{ - refresh:['caocao','simayi','guanyu','zhangfei','zhaoyun','ganning','lvmeng','lvbu','gongsunzan'] - }, + forbidall:['xiahouyuan','huangzhong','weiyan','dianwei','zhangjiao', + 'caocao','simayi','guanyu','zhangfei','zhaoyun','ganning','lvmeng','lvbu','gongsunzan'], forbidversus:['swd_kangnalishi'], - forbidstone:['zhugedan','pal_xuanxiao','hs_malfurion','lusu','chenlin', + forbidstone:['zhugedan','pal_xuanxiao','hs_malfurion','lusu','chenlin','hs_siwangzhiyi', 'gjqt_bailitusu','yuanshao','swd_anka','swd_nicole','daqiao','re_daqiao', 'zhuran','huatuo','swd_tuwei','hs_guldan','wangyi','caoang','swd_guyue', 'swd_jiangziya','guojia','re_guojia','shen_caocao','swd_qiner','caopi','hs_yngvar', diff --git a/game/game.js b/game/game.js index 72b420cde..52c440cbf 100755 --- a/game/game.js +++ b/game/game.js @@ -2042,6 +2042,11 @@ }, restart:true, }, + ban_weak:{ + name:'屏蔽强将', + init:false, + restart:true, + }, ban_strong:{ name:'屏蔽强将', init:false, @@ -3594,11 +3599,6 @@ delete lib.cardPack.mode_derivation; } } - for(i in lib.config.forbidpack){ - if(lib.config.characters.contains(i)){ - lib.config.forbidall=lib.config.forbidall.concat(lib.config.forbidpack[i]); - } - } var pilecfg=lib.config.customcardpile[get.config('cardpilename')]; if(pilecfg){ @@ -3745,7 +3745,7 @@ else if(lib.config.mode=='connect'){ _status.connectMode=true; } - if(lib.config.cheat&&(!_status.connectMode||lib.config.debug)){ + if(lib.config.cheat&&!lib.storage.test&&(!_status.connectMode||lib.config.debug)){ cheat.i(); } else{ @@ -10900,6 +10900,33 @@ filterButton:function(button){ return true; }, + characterDisabled:function(i){ + if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) return true; + if(lib.config.forbidai.contains(i)) return true; + if(lib.config.banned.contains(i)) return true; + var double_character=false; + if(lib.config.mode=='guozhan'){ + double_character=true; + } + else if(get.config('double_character')&&(lib.config.mode=='identity'||lib.config.mode=='stone')){ + double_character=true; + } + else if(get.config('double_character_jiange')&&(lib.config.mode=='versus'&&_status.mode=='jiange')){ + double_character=true; + } + if(double_character&&lib.config.forbiddouble.contains(i)){ + return true; + } + if(get.config('ban_weak')){ + if(lib.config.forbidall.contains(i)) return true; + if(!double_character&&(lib.rank.c.contains(i)||lib.rank.d.contains(i))){ + return true; + } + } + if(get.config('ban_strong')&&(lib.rank.s.contains(i)||lib.rank.ap.contains(i))){ + return true; + } + }, cardEnabled:function(card,player,event){ if(player==undefined) player=_status.event.player; var filter=get.info(card).enable; @@ -19742,6 +19769,7 @@ var g={}; var logs=[]; var logindex=-1; + var cheat=lib.cheat; var runCommand=function(e){ if(text2.value){ logindex=-1; @@ -19753,9 +19781,7 @@ else{ try{ var result=eval(text2.value); - if(result!==undefined){ - game.print(result); - } + game.print(result); } catch(e){ game.print(e); @@ -20161,6 +20187,9 @@ alert('当前版本已是最新'); } },function(){ + if(forcecheck===false){ + return; + } alert('连接失败'); button1.disabled=false; button1.innerHTML='检查游戏更新'; diff --git a/mode/boss.js b/mode/boss.js index c6ace74d4..57217d856 100755 --- a/mode/boss.js +++ b/mode/boss.js @@ -520,13 +520,8 @@ mode.boss={ if(lib.character[i][4].contains('boss')) continue; if(lib.character[i][4].contains('hiddenboss')) continue; if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue; - if(lib.config.forbidai.contains(i)) continue; - if(lib.config.forbidall.contains(i)) continue; if(lib.config.forbidboss.contains(i)) continue; - if(lib.config.banned.contains(i)) continue; - if(get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue; - if(get.config('ban_weak')&&(lib.rank.c.contains(i)||lib.rank.d.contains(i))) continue; - if(get.config('ban_strong')&&(lib.rank.s.contains(i)||lib.rank.ap.contains(i))) continue; + if(lib.filter.characterDisabled(i)) continue; list.push(i); } list.randomSort(); diff --git a/mode/chess.js b/mode/chess.js index ed4041a73..6157badf1 100755 --- a/mode/chess.js +++ b/mode/chess.js @@ -523,16 +523,10 @@ mode.chess={ for(i in lib.character){ if(i.indexOf('treasure_')==0) continue; if(i.indexOf('chess_mech_')==0) continue; - if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue; if(lib.character[i][4].contains('minskin')) continue; - if(lib.config.forbidai.contains(i)) continue; - if(lib.config.forbidall.contains(i)) continue; if(lib.config.forbidchess.contains(i)) continue; - if(lib.config.banned.contains(i)) continue; - if(get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue; - if(get.config('ban_weak')&&(lib.rank.c.contains(i)||lib.rank.d.contains(i))) continue; - if(get.config('ban_strong')&&(lib.rank.s.contains(i)||lib.rank.ap.contains(i))) continue; if(lib.character[i][4].contains('boss')) continue; + if(lib.filter.characterDisabled(i)) continue; list.push(i); } list.randomSort(); @@ -3789,15 +3783,9 @@ mode.chess={ } if(i.indexOf('treasure_')==0) continue; if(i.indexOf('chess_mech_')==0) continue; - if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue; if(lib.character[i][4].contains('minskin')) continue; - if(lib.config.forbidai.contains(i)) continue; - if(lib.config.forbidall.contains(i)) continue; - if(lib.config.banned.contains(i)) continue; if(lib.config.forbidchess.contains(i)) continue; - if(get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue; - if(get.config('ban_strong')&&(lib.rank.s.contains(i)||lib.rank.ap.contains(i))) continue; - + if(lib.filter.characterDisabled(i)) continue; list.push(i); } list.randomSort(); diff --git a/mode/guozhan.js b/mode/guozhan.js index fcf0ead83..2fd40ed93 100755 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -281,12 +281,7 @@ mode.guozhan={ event.list=[]; for(i in lib.character){ if(chosen.contains(i)) continue; - if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue; - if(lib.config.forbidai.contains(i)) continue; - if(lib.config.forbidall.contains(i)) continue; - if(lib.config.forbiddouble.contains(i)) continue; - if(lib.config.banned.contains(i)) continue; - if(get.config('ban_strong')&&(lib.rank.s.contains(i)||lib.rank.ap.contains(i))) continue; + if(lib.filter.characterDisabled(i)) continue; if(lib.character[i][2]==3||lib.character[i][2]==4||lib.character[i][2]==5) event.list.push(i); } diff --git a/mode/identity.js b/mode/identity.js index 077edbda8..1846ed41c 100755 --- a/mode/identity.js +++ b/mode/identity.js @@ -736,14 +736,7 @@ mode.identity={ game.me.setIdentity(); for(i in lib.character){ if(chosen.contains(i)) continue; - if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue; - if(lib.config.forbidai.contains(i)) continue; - if(lib.config.forbidall.contains(i)) continue; - if(lib.config.banned.contains(i)) continue; - if(!get.config('double_character')&&get.config('ban_weak')&& - (lib.config.forbidsingle.contains(i)||lib.rank.c.contains(i)||lib.rank.d.contains(i))) continue; - if(get.config('ban_strong')&&(lib.rank.s.contains(i)||lib.rank.ap.contains(i))) continue; - if(get.config('double_character')&&lib.config.forbiddouble.contains(i)) continue; + if(lib.filter.characterDisabled(i)) continue; event.list.push(i); if(lib.character[i][4]&&lib.character[i][4].contains('zhu')){ list2.push(i); diff --git a/mode/stone.js b/mode/stone.js index d0ed6f2d3..7587c6da8 100755 --- a/mode/stone.js +++ b/mode/stone.js @@ -1434,17 +1434,10 @@ mode.stone={ var list=[]; event.list=list; for(i in lib.character){ - if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue; if(lib.character[i][4]&&lib.character[i][4].contains('minskin')) continue; if(lib.character[i][4]&&lib.character[i][4].contains('stonehidden')) continue; - if(lib.config.forbidai.contains(i)) continue; - if(lib.config.forbidall.contains(i)) continue; if(lib.config.forbidstone.contains(i)) continue; - if(lib.config.banned.contains(i)) continue; - if(!get.config('double_character')&&get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue; - if(!get.config('double_character')&&get.config('ban_weak')&&(lib.rank.c.contains(i)||lib.rank.d.contains(i))) continue; - if(get.config('ban_strong')&&(lib.rank.s.contains(i)||lib.rank.ap.contains(i))) continue; - if(get.config('double_character')&&lib.config.forbiddouble.contains(i)) continue; + if(lib.filter.characterDisabled(i)) continue; list.push(i); } list.randomSort(); diff --git a/mode/versus.js b/mode/versus.js index 2d7621aa5..e260039cf 100755 --- a/mode/versus.js +++ b/mode/versus.js @@ -322,14 +322,7 @@ mode.versus={ list[lib.character[i][1]+'mech'].push(i);continue; } } - if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue; - if(lib.config.forbidai.contains(i)) continue; - if(lib.config.forbidall.contains(i)) continue; - if(lib.config.banned.contains(i)) continue; - if(!get.config('double_character')&&get.config('ban_weak')&& - (lib.config.forbidsingle.contains(i)||lib.rank.c.contains(i)||lib.rank.d.contains(i))) continue; - if(get.config('ban_strong')&&(lib.rank.s.contains(i)||lib.rank.ap.contains(i))) continue; - if(get.config('double_character')&&lib.config.forbiddouble.contains(i)) continue; + if(lib.filter.characterDisabled(i)) continue; if(lib.character[i][1]=='wei'){ list.weilist.push(i); } @@ -517,14 +510,7 @@ mode.versus={ } for(i in lib.character){ if(event.filterChoice(i)) continue; - if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue; - if(lib.config.forbidai.contains(i)) continue; - if(lib.config.forbidall.contains(i)) continue; - if(lib.config.banned.contains(i)) continue; - if(!get.config('double_character')&&get.config('ban_weak')&& - (lib.config.forbidsingle.contains(i)||lib.rank.c.contains(i)||lib.rank.d.contains(i))) continue; - if(get.config('ban_strong')&&(lib.rank.s.contains(i)||lib.rank.ap.contains(i))) continue; - if(get.config('double_character')&&lib.config.forbiddouble.contains(i)) continue; + if(lib.filter.characterDisabled(i)) continue; event.list.push(i); if(lib.character[i][4]&&lib.character[i][4].contains('zhu')){ list2.push(i); @@ -711,14 +697,8 @@ mode.versus={ _status.color=Math.random()<0.5; var i,list=[]; for(i in lib.character){ - if(lib.config.forbidai.contains(i)) continue; if(lib.config.forbidversus.contains(i)) continue; - if(lib.config.banned.contains(i)) continue; - if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue; - if(get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue; - if(get.config('ban_weak')&&lib.config.forbidall.contains(i)) continue; - if(get.config('ban_weak')&&(lib.rank.c.contains(i)||lib.rank.d.contains(i))) continue; - if(get.config('ban_strong')&&(lib.rank.s.contains(i)||lib.rank.ap.contains(i))) continue; + if(lib.filter.characterDisabled(i)) continue; list.push(i); } var groupSort=function(name){