diff --git a/audio/die/clan_zhonghui.mp3 b/audio/die/clan_zhonghui.mp3 new file mode 100644 index 000000000..5533aff58 Binary files /dev/null and b/audio/die/clan_zhonghui.mp3 differ diff --git a/audio/die/xizheng.mp3 b/audio/die/xizheng.mp3 new file mode 100644 index 000000000..6e5392aa5 Binary files /dev/null and b/audio/die/xizheng.mp3 differ diff --git a/audio/effect/chicken_you_are_so_beautiful.mp3 b/audio/effect/chicken_you_are_so_beautiful.mp3 new file mode 100644 index 000000000..ecf8dd27e Binary files /dev/null and b/audio/effect/chicken_you_are_so_beautiful.mp3 differ diff --git a/audio/effect/chickun.wav b/audio/effect/chickun.wav new file mode 100644 index 000000000..38d62e430 Binary files /dev/null and b/audio/effect/chickun.wav differ diff --git a/audio/effect/croatian_rhapsody.mp3 b/audio/effect/croatian_rhapsody.mp3 new file mode 100644 index 000000000..d56eec3db Binary files /dev/null and b/audio/effect/croatian_rhapsody.mp3 differ diff --git a/audio/effect/hitsound.wav b/audio/effect/hitsound.wav new file mode 100644 index 000000000..8f3cbc7f0 Binary files /dev/null and b/audio/effect/hitsound.wav differ diff --git a/audio/effect/ignotus.mp3 b/audio/effect/ignotus.mp3 index 2c0116e8c..1d8b8f988 100644 Binary files a/audio/effect/ignotus.mp3 and b/audio/effect/ignotus.mp3 differ diff --git a/audio/effect/pigstep.mp3 b/audio/effect/pigstep.mp3 new file mode 100644 index 000000000..a023780da Binary files /dev/null and b/audio/effect/pigstep.mp3 differ diff --git a/audio/effect/rakshasa_sea_city.mp3 b/audio/effect/rakshasa_sea_city.mp3 new file mode 100644 index 000000000..aa6be6b42 Binary files /dev/null and b/audio/effect/rakshasa_sea_city.mp3 differ diff --git a/audio/effect/sm3dw_overworld.mp3 b/audio/effect/sm3dw_overworld.mp3 index 583421880..21c82fefb 100644 Binary files a/audio/effect/sm3dw_overworld.mp3 and b/audio/effect/sm3dw_overworld.mp3 differ diff --git a/audio/skill/clanbaozu_clan_zhonghui1.mp3 b/audio/skill/clanbaozu_clan_zhonghui1.mp3 new file mode 100644 index 000000000..7dce19dc9 Binary files /dev/null and b/audio/skill/clanbaozu_clan_zhonghui1.mp3 differ diff --git a/audio/skill/clanbaozu_clan_zhonghui2.mp3 b/audio/skill/clanbaozu_clan_zhonghui2.mp3 new file mode 100644 index 000000000..2b2f457d0 Binary files /dev/null and b/audio/skill/clanbaozu_clan_zhonghui2.mp3 differ diff --git a/audio/skill/clanxieshu1.mp3 b/audio/skill/clanxieshu1.mp3 new file mode 100644 index 000000000..c0885d4e6 Binary files /dev/null and b/audio/skill/clanxieshu1.mp3 differ diff --git a/audio/skill/clanxieshu2.mp3 b/audio/skill/clanxieshu2.mp3 new file mode 100644 index 000000000..de469bbe1 Binary files /dev/null and b/audio/skill/clanxieshu2.mp3 differ diff --git a/audio/skill/clanyuzhi1.mp3 b/audio/skill/clanyuzhi1.mp3 new file mode 100644 index 000000000..923cb4399 Binary files /dev/null and b/audio/skill/clanyuzhi1.mp3 differ diff --git a/audio/skill/clanyuzhi2.mp3 b/audio/skill/clanyuzhi2.mp3 new file mode 100644 index 000000000..186a67244 Binary files /dev/null and b/audio/skill/clanyuzhi2.mp3 differ diff --git a/audio/skill/dcdanyi1.mp3 b/audio/skill/dcdanyi1.mp3 new file mode 100644 index 000000000..68c699d12 Binary files /dev/null and b/audio/skill/dcdanyi1.mp3 differ diff --git a/audio/skill/dcdanyi2.mp3 b/audio/skill/dcdanyi2.mp3 new file mode 100644 index 000000000..993b868fd Binary files /dev/null and b/audio/skill/dcdanyi2.mp3 differ diff --git a/audio/skill/dcwencan1.mp3 b/audio/skill/dcwencan1.mp3 new file mode 100644 index 000000000..db8771bcc Binary files /dev/null and b/audio/skill/dcwencan1.mp3 differ diff --git a/audio/skill/dcwencan2.mp3 b/audio/skill/dcwencan2.mp3 new file mode 100644 index 000000000..17289b70d Binary files /dev/null and b/audio/skill/dcwencan2.mp3 differ diff --git a/audio/skill/spyanji3.mp3 b/audio/skill/spyanji3.mp3 index b72af5b3c..465b0c8b9 100644 Binary files a/audio/skill/spyanji3.mp3 and b/audio/skill/spyanji3.mp3 differ diff --git a/audio/skill/zhujian.mp3 b/audio/skill/zhujian2.mp3 similarity index 100% rename from audio/skill/zhujian.mp3 rename to audio/skill/zhujian2.mp3 diff --git a/card/extra.js b/card/extra.js index 1162425e8..12f570962 100644 --- a/card/extra.js +++ b/card/extra.js @@ -399,7 +399,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ ai:{ value:function(card,player,index,method){ if(player.isDisabled(2)) return 0.01; - if(card==player.getEquip(2)){ + if(player.getEquips('tengjia').contains(card)){ if(player.hasSkillTag('noDirectDamage')) return 10; if(game.hasPlayer(function(current){ return current!=player&&get.attitude(current,player)<0&¤t.hasSkillTag('fireAttack',null,null,true); @@ -555,7 +555,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ cards.splice(i--,1); } } - var muniu=player.getEquip(5); + var muniu=player.getEquip('muniu'); if(!muniu||!cards.length){ for(var i=0;i=3&&get.attitude(current,player)>=3){ return true; } @@ -579,15 +580,15 @@ game.import('card',function(lib,game,ui,get,ai,_status){ players.sort(lib.sort.seat); var choice=players[0]; var next=player.chooseTarget('是否移动木牛流马?',function(card,player,target){ - return !target.isMin()&&player!=target&&target.isEmpty(5); - }); + return !target.isMin()&&player!=target&&target.canEquip(_status.event.muniu); + }).set('muniu',muniu) next.set('ai',function(target){ return target==_status.event.choice?1:-1; }); next.set('choice',choice); "step 3" if(result.bool){ - var card=player.getEquip(5); + var card=player.getEquip('muniu'); result.targets[0].equip(card); player.$give(card,result.targets[0]); player.line(result.targets,'green'); @@ -618,7 +619,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ mark:true, intro:{ content:function(storage,player){ - var muniu=player.getEquip(5); + var muniu=player.getEquip('muniu'); if(!muniu||!muniu.cards||!muniu.cards.length) return '共有〇张牌'; if(player.isUnderControl(true)){ return get.translation(muniu.cards); @@ -628,7 +629,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ } }, mark:function(dialog,storage,player){ - var muniu=player.getEquip(5); + var muniu=player.getEquip('muniu'); if(!muniu||!muniu.cards||!muniu.cards.length) return '共有〇张牌'; if(player.isUnderControl(true)){ dialog.addAuto(muniu.cards); @@ -638,7 +639,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ } }, markcount:function(storage,player){ - var muniu=player.getEquip(5); + var muniu=player.getEquip('muniu'); if(muniu&&muniu.cards) return muniu.cards.length; return 0; } @@ -658,7 +659,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }).length>0; }, content:function(){ - var muniu=player.getEquip(5); + var muniu=player.getEquip('muniu'); if(muniu&&muniu.cards){ muniu.cards.removeArray(trigger.ss); lib.skill.muniu_skill.sync(muniu); @@ -787,7 +788,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ //if(card.name=='nanman'||card.name=='wanjian'||card.name=='chuqibuyi') return 'zerotarget'; if(card.name=='nanman'||card.name=='wanjian') return 'zerotarget'; if(card.name=='sha'){ - var equip1=player.getEquip(1); + var equip1=player.getEquip('zhuque'); if(equip1&&equip1.name=='zhuque') return 1.9; if(!card.nature) return 'zerotarget'; } diff --git a/card/guozhan.js b/card/guozhan.js index b595096c9..235033d7f 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -264,17 +264,14 @@ game.import('card',function(lib,game,ui,get,ai,_status){ fullskin:true, type:'equip', subtype:'equip6', + subtypes:['equip3','equip4'], nomod:true, nopower:true, - unique:true, + //unique:true, distance:{ globalFrom:-1, globalTo:+1, }, - customSwap:function(card){ - var type=get.subtype(card,false); - return type=='equip3'||type=='equip4'||type=='equip6'; - }, skills:['liulongcanjia'], ai:{ equipValue:function(card,player){ @@ -833,8 +830,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){ subtype:"equip2", skills:['huxinjing'], filterTarget:function(card,player,target){ - if(get.mode()!='guozhan') return true; - return player==target; + if(get.mode()=='guozhan'&&player!=target) return false; + return target.canEquip(card,true); }, selectTarget:function(){ return get.mode()=='guozhan'?-1:1; @@ -1221,8 +1218,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){ liulongcanjia:{ equipSkill:true, mod:{ - targetEnabled:function(card,player,target){ - if(['equip3','equip4'].contains(get.subtype(card))) return false; + canBeReplaced:function(card,player){ + return false; }, }, }, @@ -1282,7 +1279,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return [1,player.maxHp]; }, filterCard:function(card,player){ - return card!=player.getEquip(5); + var cards=player.getEquips('dinglanyemingzhu'); + if(cards.length) return cards.some(card2=>card2!=card&&!ui.selected.cards.contains(card2)) + return true; }, prompt:'出牌阶段限一次,你可以弃置至多X张牌(X为你的体力上限),然后摸等量的牌' }, @@ -1729,13 +1728,15 @@ game.import('card',function(lib,game,ui,get,ai,_status){ target:player, card:event.card })) return false; + var cards=player.getEquips('huxinjing'); + if(!cards.length) return false; if(get.mode()!='guozhan'&&event.num>1) return true; return event.num>=player.hp; }, content:function(){ trigger.cancel(); - var e2=player.getEquip('huxinjing'); - if(e2){ + var e2=player.getEquips('huxinjing'); + if(e2.length){ player.discard(e2); } player.removeSkill('huxinjing'); @@ -1799,7 +1800,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }, translate:{ liulongcanjia:'六龙骖驾', - liulongcanjia_info:'锁定技。①你计算与其他角色的距离-1,其他角色计算与你的距离+1。②当此牌进入你的装备区时,你弃置你装备区内其他坐骑牌。③你的装备区内不能置入其他坐骑牌。', + liulongcanjia_info:'锁定技。此牌占用1个进攻坐骑和1个防御坐骑槽位,且不可被替换。你计算与其他角色的距离-1,其他角色计算与你的距离+1。', minguangkai:'明光铠', minguangkai_cancel:'明光铠', minguangkai_link:'明光铠', @@ -1862,8 +1863,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){ jingfanma_info:'你的进攻距离+1', huxinjing_bg:'镜', huxinjing:'护心镜', - huxinjing_info:'此牌可对其他角色使用。当你受到伤害时,若伤害值大于1或大于等于你的体力值,则你可以将【护心镜】置入弃牌堆,然后防止此伤害。', - huxinjing_info_guozhan:'当你受到伤害时,若伤害值大于等于你的体力值,则你可以将【护心镜】置入弃牌堆,然后防止此伤害。', + huxinjing_info:'此牌可对其他角色使用。当你受到伤害时,若伤害值大于1或大于等于你的体力值,则你可以将所有【护心镜】置入弃牌堆,然后防止此伤害。', + huxinjing_info_guozhan:'当你受到伤害时,若伤害值大于等于你的体力值,则你可以将所有【护心镜】置入弃牌堆,然后防止此伤害。', gz_haolingtianxia:'号令天下', gz_haolingtianxia_info:'出牌阶段,对一名体力值不为全场最少的角色使用。所有其他角色依次选择一项:①弃置一张牌(魏势力角色无需弃牌),视为对目标角色使用一张【杀】;②弃置目标角色的一张牌(魏势力角色改为获得其一张牌)。', gz_kefuzhongyuan:'克复中原', diff --git a/card/sp.js b/card/sp.js index ee72624c6..7aa5a6957 100644 --- a/card/sp.js +++ b/card/sp.js @@ -47,7 +47,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ enable:true, filterTarget:function(card,player,target){ if(target==player) return false; - if(target.getEquip(5)){ + if(target.getEquips(5).length){ return target.countCards('e')>1; } else{ @@ -467,11 +467,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){ trigger:{player:'damageBegin4'}, forced:true, filter:function(event,player){ - return event.card&&event.card.name=='sha'&&player.getEquip('lanyinjia'); + return event.card&&event.card.name=='sha'&&player.getEquips('lanyinjia').length>0; }, content:function(){ - var card=player.getEquip('lanyinjia'); - if(card){ + var card=player.getEquips('lanyinjia'); + if(card.length){ player.discard(card); } }, diff --git a/card/standard.js b/card/standard.js index 1838c17ad..e18416e8e 100644 --- a/card/standard.js +++ b/card/standard.js @@ -1588,7 +1588,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ multicheck:function(){ var card={name:'sha',isCard:true}; return game.hasPlayer(function(current){ - if(current.getEquip(1)){ + if(current.getEquips(1).length>0){ return game.hasPlayer(function(current2){ return current.inRange(current2)&&lib.filter.targetEnabled(card,current,current2); }) @@ -1597,7 +1597,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }, filterTarget:function(card,player,target){ var card={name:'sha',isCard:true}; - return player!=target&&target.getEquip(1)&&game.hasPlayer(function(current){ + return player!=target&&target.getEquips(1).length>0&&game.hasPlayer(function(current){ return target!=current&&target.inRange(current)&&lib.filter.targetEnabled(card,target,current); }); }, @@ -1621,7 +1621,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ } "step 1" if(event.directfalse||result.bool==false){ - var cards=target.getCards('e',{subtype:'equip1'}); + var cards=target.getEquips(1); if(cards.length) player.gain(cards,target,'give','bySelf'); } }, @@ -2043,17 +2043,20 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }, mod:{ cardUsable:function(card,player,num){ - var cardx=player.getEquip('zhuge'); - if(card.name=='sha'&&(!cardx||player.hasSkill('zhuge_skill',null,false)||(!_status.zhuge_temp&&!ui.selected.cards.contains(cardx)))){ - if(get.is.versus()||get.is.changban()){ - return num+3; + var cards=player.getEquips('zhuge') + if(card.name=='sha'){ + if(!cards.length||player.hasSkill('zhuge_skill',null,false)||cards.some(card=>(card!=_status.zhuge_temp&&!ui.selected.cards.contains(card)))){ + if(get.is.versus()||get.is.changban()){ + return num+3; + } + return Infinity; } - return Infinity; } }, cardEnabled2:function(card,player){ if(!_status.event.addCount_extra||player.hasSkill('zhuge_skill',null,false)) return; - if(card&&card==player.getEquip('zhuge')){ + var cards=player.getEquips('zhuge'); + if(card&&cards.contains(card)){ try{ var cardz=get.card(); } @@ -2061,7 +2064,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return; } if(!cardz||cardz.name!='sha') return; - _status.zhuge_temp=true; + _status.zhuge_temp=card; var bool=lib.filter.cardUsable(get.autoViewAs({name:'sha'},ui.selected.cards.concat([card])),player); delete _status.zhuge_temp; if(!bool) return false; @@ -2158,7 +2161,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ "step 0" player.chooseToUse(get.prompt('qinglong',trigger.target),function(card,player,event){ if(get.name(card)!='sha') return false; - if(player.getEquip('qinglong')==card) return false; + if(!player.hasSkill('qinglong_skill',null,false)){ + var cards=player.getEquips('qinglong'); + if(!cards.some(card2=>card2!=card&&!ui.selected.cards.contains(card2))) return false; + } return lib.filter.filterCard.apply(this,arguments); },trigger.target,-1).set('addCount',false).logSkill='qinglong_skill'; } @@ -2195,16 +2201,20 @@ game.import('card',function(lib,game,ui,get,ai,_status){ direct:true, audio:true, filter:function(event,player){ - if(event.type!='card'||event.card.name!='sha') return false; - return player.countCards('he',function(card){ - return card!=player.getEquip('guanshi'); - })>=2&&event.target.isAlive(); + if(event.type!='card'||event.card.name!='sha'||!event.target.isIn()) return false; + var min=2; + if(!player.hasSkill('guanshi_skill',null,false)) min+=get.sgn(player.getEquips('guanshi').length) + return player.countCards('he')>=min; }, content:function(){ "step 0" - var next=player.chooseToDiscard(get.prompt('guanshi'),2,'he',function(card){ - return _status.event.player.getEquip('guanshi')!=card; - }); + //装备区内可能有多个贯石斧 或者玩家可能通过其他渠道获得贯石斧技能 只要留一张贯石斧不扔掉即可 + var next=player.chooseToDiscard(get.prompt('guanshi'),2,'he',function(card,player){ + if(_status.event.ignoreCard) return true; + var cards=player.getEquips('guanshi'); + if(!cards.contains(card)) return true; + return cards.some(cardx=>(cardx!=card&&!ui.selected.cards.contains(cardx))); + }).set('ignoreCard',player.hasSkill('guanshi_skill',null,false)).set('complexCard',true) next.logSkill='guanshi_skill'; next.set('ai',function(card){ var evt=_status.event.getTrigger(); @@ -3244,7 +3254,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ wuxie_info:'一张锦囊牌生效前,对此牌使用。抵消此牌对一名角色产生的效果,或抵消另一张【无懈可击】产生的效果。', lebu_info:'出牌阶段,对一名其他角色使用。若判定结果不为红桃,跳过其出牌阶段。', shandian_info:'出牌阶段,对自己使用。若判定结果为黑桃2~9,则目标角色受到3点雷电伤害。若判定不为黑桃2~9,将之移动到下家的判定区里。', - icesha_skill:'冰杀', + icesha_skill:'冰冻', icesha_skill_info:'防止即将造成的伤害,改为依次弃置其两张牌。', qinggang2:'破防', }, diff --git a/card/yongjian.js b/card/yongjian.js index 9f9649581..993c0e56f 100644 --- a/card/yongjian.js +++ b/card/yongjian.js @@ -161,7 +161,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ ai:{ order:9, value:function(card,player){ - if(player.getEquip(1)==card) return 0; + if(player.getEquips(1).contains(card)) return 0; return 4; }, equipValue:function(card,player){ @@ -195,7 +195,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 2; }, value:function(card,player){ - if(player.getEquip(1)==card) return -3; + if(player.getEquips(1).contains(card)) return -3; return 3; }, basic:{ @@ -229,7 +229,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 2; }, value:function(card,player){ - if(player.getEquip(2)==card) return -3; + if(player.getEquips(2).contains(card)) return -3; return 3; }, basic:{ @@ -263,7 +263,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 1; }, value:function(card,player){ - if(player.getEquip(2)==card) return -2.5; + if(player.getEquips(2).contains(card)) return -2.5; return 2.5; }, basic:{ @@ -297,7 +297,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ order:9, equipValue:0, value:function(card,player){ - if(player.getEquip(2)==card) return 0; + if(player.getEquips(2).contains(card)) return 0; return 0.5; }, basic:{ @@ -706,7 +706,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ yonglv_info:'锁定技。其他角色至你的距离视为1。', yonglv_append:'它旁边的就是王仲宣。', zhanxiang:'战象', - zhanxiang_info:'锁定技。当你成为〖赠予〗的目标后,你将此次赠予的效果改为“将赠予牌移动至弃牌堆”。', + zhanxiang_info:'锁定技。①其他角色至你的距离+1。②当你成为〖赠予〗的目标后,你将此次赠予的效果改为“将赠予牌移动至弃牌堆”。', xinge:'信鸽', xinge_info:'出牌阶段限一次。你可以将一张手牌交给一名其他角色。', xinge_append:'咕咕咕。', diff --git a/card/zhulu.js b/card/zhulu.js index 1755a0355..886d7ee99 100644 --- a/card/zhulu.js +++ b/card/zhulu.js @@ -81,7 +81,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ var equips=[]; for(var i=0;i1){ var next=target.chooseButton(true,function(button){ @@ -281,7 +281,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }, result:{ target:function(player,target){ - var e5=target.getEquip(5); + var e5=target.getEquip('muniu'); if(e5&&e5.name=='muniu'&&e5.cards&&e5.cards.length>1) return -1; if(target.countCards('e',function(card){ return get.value(card,target)<=0; @@ -322,7 +322,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ fullskin:true, type:'equip', subtype:'equip4', - filterTarget:lib.filter.notMe, + filterTarget:function(card,player,target){ + if(player==target) return false; + return target.canEquip(card,true) + }, selectTarget:1, toself:false, loseThrow:true, @@ -332,7 +335,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ ai:{ order:9, value:function(card,player){ - if(player.getEquip(4)==card) return 0; + if(player.getEquips(4).contains(card)) return 0; return 4; }, equipValue:function(card,player){ @@ -380,7 +383,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ fullskin:true, type:'equip', subtype:'equip1', - filterTarget:lib.filter.notMe, + filterTarget:function(card,player,target){ + if(player==target) return false; + return target.canEquip(card,true) + }, selectTarget:1, toself:false, skills:['wufengjian_skill'], @@ -391,7 +397,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 2; }, value:function(card,player){ - if(player.getEquip(1)==card) return -1.5; + if(player.getEquips(1).contains(card)) return -1.5; return 1.5; }, basic:{ @@ -416,7 +422,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ fullskin:true, type:'equip', subtype:'equip1', - filterTarget:lib.filter.notMe, + filterTarget:function(card,player,target){ + if(player==target) return false; + return target.canEquip(card,true) + }, selectTarget:1, toself:false, distance:{attackFrom:1}, @@ -427,7 +436,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 2; }, value:function(card,player){ - if(player.getEquip(1)==card) return -3; + if(player.getEquips(1).contains(card)) return -3; return 3; }, basic:{ @@ -452,7 +461,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ fullskin:true, type:'equip', subtype:'equip2', - filterTarget:lib.filter.notMe, + filterTarget:function(card,player,target){ + if(player==target) return false; + return target.canEquip(card,true) + }, selectTarget:1, toself:false, skills:['yinfengjia_skill'], @@ -463,7 +475,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 1; }, value:function(card,player){ - if(player.getEquip(2)==card) return -2.5; + if(player.getEquips(2).contains(card)) return -2.5; return 2.5; }, basic:{ @@ -488,7 +500,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ fullskin:true, type:'equip', subtype:'equip2', - filterTarget:lib.filter.notMe, + filterTarget:function(card,player,target){ + if(player==target) return false; + return target.canEquip(card,true) + }, selectTarget:1, toself:false, loseDelay:false, @@ -517,7 +532,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ ai:{ order:9.5, equipValue:function(card,player){ - if(card==player.getEquip(2)){ + if(player.getEquips(2).contains(card)){ if(player.sex!='male') return 0; var num=player.countCards('he',function(cardx){ return cardx!=card; @@ -575,7 +590,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ fullskin:true, type:'equip', subtype:'equip5', - filterTarget:lib.filter.notMe, + filterTarget:function(card,player,target){ + if(player==target) return false; + return target.canEquip(card,true) + }, selectTarget:1, toself:false, skills:['jinhe_skill'], @@ -630,7 +648,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ ai:{ order:9.5, equipValue:function(card,player){ - if(card!=player.getEquip(5)) return 5; + if(!player.getEquips(5).contains(card)) return 5; if(_status.jinhe&&_status.jinhe[card.cardid]&&_status.event.name!='gainPlayerCard') return 3*player.countCards('h'); return 0; }, @@ -712,11 +730,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){ enable:'phaseUse', filter:function(event,player){ if(!_status.jinhe) return false; - var card=player.getEquip(5); + var card=player.getEquip('jinhe'); return card&&card.name=='jinhe'&&_status.jinhe[card.cardid]!=undefined; }, prepare:function(cards,player){ - var card=player.getEquip(5); + var card=player.getEquip('jinhe'); if(card&&card.name=='jinhe'&&_status.jinhe[card.cardid]){ var tothrow=_status.jinhe[card.cardid].card; player.$throw(tothrow); @@ -725,7 +743,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }, content:function(){ "step 0" - var card=player.getEquip(5); + var card=player.getEquip('jinhe'); if(card&&card.name=='jinhe'&&_status.jinhe[card.cardid]){ game.cardsDiscard(_status.jinhe[card.cardid].card); event.suit=get.suit(_status.jinhe[card.cardid].card); @@ -748,7 +766,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ order:1, result:{ player:function(player){ - var suit=get.suit(_status.jinhe[player.getEquip(5).cardid].card); + var suit=get.suit(_status.jinhe[player.getEquip('jinhe').cardid].card); var hs=player.getCards('h',function(card){ return get.suit(card)==suit; }); @@ -763,10 +781,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ mod:{ targetEnabled:function(card,player,target){ if(get.color(card)=='black'&&get.type(card,'trick')=='trick'&&!target.hasSkillTag('unequip2')&&!player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:target, - card:card - })) return false; + name:card?card.name:null, + target:target, + card:card + })) return false; }, }, }, @@ -791,16 +809,16 @@ game.import('card',function(lib,game,ui,get,ai,_status){ forced:true, filter:function(event,player){ if(event.card.name!='sha') return false; - var card=player.getEquip('wufengjian'); - return player.countCards('he',function(cardx){ - return cardx!=card; - })>0; + var cards=player.getEquips('wufengjian'); + return player.hasCard(function(card){ + return !cards.contains(card); + },'he'); }, content:function(){ if(player!=game.me&&!player.isUnderControl()&&!player.isOnline()) game.delayx(); player.chooseToDiscard(true,'he',function(card){ - return card!=_status.event.card; - }).set('card',player.getEquip('wufengjian')); + return !_status.event.cards.contains(card); + }).set('cards',player.getEquips('wufengjian')); }, }, yajiaoqiang_skill:{ diff --git a/character/clan.js b/character/clan.js index 677866d9f..505af2ff3 100644 --- a/character/clan.js +++ b/character/clan.js @@ -17,17 +17,251 @@ game.import('character',function(lib,game,ui,get,ai,_status){ clan_wangling:['male','wei',4,['clanbolong','clanzhongliu'],['clan:太原王氏']], clan_zhongyan:['female','jin',3,['clanguangu','clanxiaoyong','clanbaozu'],['clan:颍川钟氏']], clan_wangyun:['male','qun',3,['clanjiexuan','clanmingjie','clanzhongliu'],['clan:太原王氏']], + clan_wanghun:['male','jin',3,['clanfuxun','clanchenya','clanzhongliu'],['clan:太原王氏']], + clan_zhonghui:['male','wei','3/4',['clanyuzhi','clanxieshu','clanbaozu'],['clan:颍川钟氏']], }, characterSort:{ clan:{ clan_wu:['clan_wuxian','clan_wuban','clan_wukuang'], clan_xun:['clan_xunshu','clan_xunchen','clan_xuncai','clan_xuncan'], clan_han:['clan_hanshao','clan_hanrong'], - clan_wang:['clan_wangling','clan_wangyun'], - clan_zhong:['clan_zhongyan'], + clan_wang:['clan_wangling','clan_wangyun','clan_wanghun'], + clan_zhong:['clan_zhongyan','clan_zhonghui'], }, }, skill:{ + //族钟会 + clanyuzhi:{ + mod:{ + aiOrder:function(player,card,num){ + if(card.name=='tao') return num/114514; + }, + }, + audio:2, + trigger:{global:'roundStart'}, + direct:true, + locked:true, + content:function(){ + 'step 0' + var num1=0,num2=0,num3=0,bool=true; + var history=player.actionHistory; + for(var i=history.length-2;i>=0;i--){ + for(var evt of history[i].gain){ + if(evt.getParent().name=='draw'&&evt.getParent(2).name=='clanyuzhi'){ + if(bool) num1+=evt.cards.length; + else num2+=evt.cards.length; + } + } + if(bool) num3+=history[i].useCard.length; + if(history[i].isRound){ + if(bool) bool=false; + else break; + } + } + event.num1=num1; + if(num1>0&&(num2>0&&num1>num2)||num1>num3){ + player.logSkill('clanyuzhi'); + if(num2>0&&num1>num2) game.log(player,'的野心已开始膨胀','#y('+num1+'张>'+num2+'张)'); + if(num1>num3) game.log(player,'的行动未达到野心','#y('+num3+'张<'+num1+'张)'); + if(player.hasSkill('clanbaozu',null,false,false)) player.chooseBool('迂志:是否失去〖保族〗?','若选择“否”,则你失去1点体力').set('choice',player.awakenedSkills.contains('clanbaozu')); + else event._result={bool:false}; + } + else event.goto(2); + 'step 1' + if(result.bool){ + player.removeSkill('clanbaozu'); + player.popup('保族'); + game.log(player,'失去了技能','#g【保族】'); + } + else player.loseHp(); + 'step 2' + if(!player.countCards('h')) event.finish(); + 'step 3' + player.chooseCard('迂志:请展示一张手牌','摸此牌牌名字数的牌。下一轮开始时,若本轮你使用的牌数或上一轮你以此法摸的牌数小于此牌牌名字数,则你失去1点体力。',true,function(card,player){ + var num=lib.skill.dcweidang.getLength(card); + return typeof num=='number'&&num>0; + }).set('ai',function(card){ + if(_status.event.dying&&_status.event.num>0&&lib.skill.dcweidang.getLength(card)>_status.event.num) return 1/lib.skill.dcweidang.getLength(card);//怂 + return lib.skill.dcweidang.getLength(card);//勇 + }).set('dying',player.hp+player.countCards('hs',{name:['tao','jiu']})<1).set('num',event.num1); + 'step 4' + if(result.bool){ + player.logSkill('clanyuzhi'); + player.showCards(result.cards,get.translation(player)+'发动了【迂志】'); + player.draw(lib.skill.dcweidang.getLength(result.cards[0])); + player.storage.clanyuzhi=lib.skill.dcweidang.getLength(result.cards[0]); + player.markSkill('clanyuzhi'); + } + else player.unmarkSkill('clanyuzhi'); + }, + ai:{ + threaten:3, + nokeep:true, + }, + onremove:true, + intro:{content:'本轮野心:#张'}, + }, + clanxieshu:{ + audio:2, + trigger:{player:'damageEnd',source:'damageSource'}, + filter:function(event,player){ + if(!event.card) return false; + var num=lib.skill.dcweidang.getLength(event.card); + return typeof num=='number'&&num>0&&player.countCards('he'); + }, + direct:true, + content:function(){ + 'step 0' + var num=lib.skill.dcweidang.getLength(trigger.card),str=''; + if(player.getDamagedHp()>0) str+=('并摸'+get.cnNumber(player.getDamagedHp())+'张牌'); + player.chooseToDiscard(get.prompt('clanxieshu'),'弃置'+get.cnNumber(num)+'张牌'+str,'he',num).set('ai',function(card){ + var player=_status.event.player; + var num=_status.event.num; + var num2=player.getDamagedHp(); + if(num>num2) return 7-get.value(card); + if(num==num2) return lib.skill.zhiheng.check(card); + return 0; + }).set('num',num).logSkill='clanxieshu'; + 'step 1' + if(result.bool&&player.getDamagedHp()>0) player.draw(player.getDamagedHp()); + }, + ai:{threaten:3}, + }, + //族王浑 + clanfuxun:{ + audio:2, + enable:'phaseUse', + usable:1, + filterCard:true, + position:'h', + discard:false, + lose:false, + delay:false, + selectCard:function(){ + var player=_status.event.player; + if(ui.selected.targets.length&&!ui.selected.targets[0].countGainableCards(player,'h')) return 1; + return [0,1]; + }, + filterTarget:function(card,player,target){ + if(player==target) return false; + if(!ui.selected.cards.length) return target.countGainableCards(player,'h')>0; + return true; + }, + content:function(){ + 'step 0' + if(cards.length){ + player.give(cards,target); + } + else{ + player.gainPlayerCard(target,'h',true); + } + 'step 1' + var evtx=event.getParent('phaseUse'); + if(player.countCards('h')==target.countCards('h')&&evtx&&!target.hasHistory('lose',evt=>{ + return evt.getParent(3).name!='clanfuxun'&&evt.getParent('phaseUse')==evtx&&evt.cards2.length; + })&&!target.hasHistory('gain',evt=>{ + return evt.getParent().name!='clanfuxun'&&evt.getParent('phaseUse')==evtx&&evt.cards.length; + })&&player.countCards('he')){ + var list=[]; + for(var name of lib.inpile){ + if(get.type(name)!='basic') continue; + if(player.hasUseTarget({name:name})) list.push(['基本','',name]); + if(name=='sha'){ + for(var nature of lib.inpile_nature){ + if(player.hasUseTarget({name:name,nature:nature})) list.push(['基本','',name,nature]); + } + } + } + if(list.length){ + player.chooseButton(['是否将一张牌当做一种基本牌使用?',[list,'vcard']]).set('ai',button=>{ + return _status.event.player.getUseValue({name:button.link[2],nature:button.link[3]}); + }); + } + else event.finish(); + } + else event.finish(); + 'step 2' + if(result.bool){ + var card={ + name:result.links[0][2], + nature:result.links[0][3] + }; + game.broadcastAll(function(card){ + lib.skill.clanfuxun_backup.viewAs=card; + },card); + var next=player.chooseToUse(); + next.set('openskilldialog','将一张牌当做'+get.translation(card)+'使用'); + next.set('norestore',true); + next.set('addCount',false); + next.set('_backupevent','clanfuxun_backup'); + next.set('custom',{ + add:{}, + replace:{window:function(){}} + }); + next.backup('clanfuxun_backup'); + } + }, + ai:{ + order:2, + result:{ + target:-1, + }, + }, + subSkill:{ + backup:{ + filterCard:function(card){ + return get.itemtype(card)=='card'; + }, + position:'hes', + filterTarget:lib.filter.targetEnabled, + selectCard:1, + check:(card)=>6-get.value(card), + log:false, + precontent:function(){ + delete event.result.skill; + }, + }, + } + }, + clanchenya:{ + audio:2, + trigger:{ + global:['useSkillAfter','logSkill'], + }, + filter:function(event,player){ + if(event.type!='player') return false; + var skill=event.sourceSkill||event.skill; + var info=get.info(skill); + if(info.charlotte) return false; + var translation=lib.translate[skill+'_info']; + if(translation&&!(/(?0; + }, + check:function(event,player){ + return get.attitude(player,event.player)>0; + }, + logTarget:'player', + content:function(){ + 'step 0' + var num=trigger.player.countCards('h'); + trigger.player.chooseCard('是否重铸任意张牌名字数为'+num+'的牌?',[1,Infinity],'he',(card,player,target)=>{ + if(!_status.event.cards.contains(card)) return false; + var mod=game.checkMod(card,player,'unchanged','cardChongzhuable',player); + return mod=='unchanged'; + }).set('ai',card=>{ + var val=get.value(card); + return 6-val; + }).set('cards',trigger.player.getCards('he',card=>{ + return lib.skill.dcweidang.getLength(card)==num; + })); + 'step 1' + if(result.bool){ + var cards=result.cards; + trigger.player.loseToDiscardpile(cards); + trigger.player.draw(cards.length); + } + } + }, //族王允 clanjiexuan:{ audio:2, @@ -435,7 +669,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, prompt:function(result){ - if(result.index) return '点击“确定”以观看牌堆顶牌'; + if(result.index>0) return '点击“确定”以观看牌堆顶牌'; return '观骨:选择观看牌的目标'; }, }, @@ -508,16 +742,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, clanbaozu:{ audio:2, - audioname:['clan_zhongyan'], - trigger:{ - gloabl:'dying', - }, + audioname:['clan_zhongyan','clan_zhonghui'], + trigger:{global:'dying'}, clanSkill:true, limited:true, skillAnimation:true, animationColor:'water', filter:function(event,player){ - return event.player.hasClan('颍川钟氏')&&event.player.hp<=0&&!event.player.isLinked(); + return (event.player==player||event.player.hasClan('颍川钟氏'))&&event.player.hp<=0&&!event.player.isLinked(); }, logTarget:'player', check:function(event,player){ @@ -536,9 +768,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ 'step 0' + player.awakenSkill('clanbaozu'); + 'step 1' trigger.player.link(true); trigger.player.recover(); - } + }, }, //族王凌 clanbolong:{ @@ -600,7 +834,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, clanzhongliu:{ audio:2, - audioname:['clan_wangling','clan_wangyun'], + audioname:['clan_wangling','clan_wangyun','clan_wanghun'], trigger:{player:'useCard'}, forced:true, clanSkill:true, @@ -1564,7 +1798,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, enable:'phaseUse', filter:function(event,player){ - return !player.storage._disableJudge||player.countCards('h',card=>['sha','shan'].contains(get.name(card)))>0; + return !player.isDisabledJudge()||player.countCards('h',card=>['sha','shan'].contains(get.name(card)))>0; }, chooseButton:{ dialog:function(event,player){ @@ -1574,7 +1808,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filter:function(button,player){ var link=button.link; - if(link=='damage') return !player.storage._disableJudge; + if(link=='damage') return !player.isDisabledJudge(); var num=player.countCards('h',link); return num>0&&num==player.getDiscardableCards(player,'h').filter(i=>get.name(i)==link).length; }, @@ -1611,7 +1845,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ order:function(item,player){ if(!player) return; - var eff=get.damageEffect(player,player,player,'fire'),disabled=!player.storage._disableJudge; + var eff=get.damageEffect(player,player,player,'fire'),disabled=!player.isDisabledJudge(); if((player.countCards('h','sha')==1||player.countCards('h','shan')==1)&&eff<0&&!disabled) return 8; else if(eff>=0&&!disabled) return 5.8; if(!disabled&&!player.countCards('h',card=>['sha','shan'].contains(get.name(card)))){ @@ -1639,7 +1873,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.choice=choice; if(choice=='damage'){ player.damage('fire'); - if(!player.storage._disableJudge) player.disableJudge(); + if(!player.isDisabledJudge()) player.disableJudge(); }else{ var cards=player.getCards('h',choice); if(cards.length) player.discard(cards); @@ -1669,7 +1903,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ok=false; } if(ind==0){ - if(target.storage._disableJudge) ok=false; + if(target.isDisabledJudge()) ok=false; } else if(ind>0){ var name=ind==1?'shan':'sha'; @@ -1695,7 +1929,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else event.finish(); 'step 3' if(result.control=='选项一'){ - if(!target.storage._disableJudge) target.disableJudge(); + if(!target.isDisabledJudge()) target.disableJudge(); target.damage('fire'); } else{ @@ -2058,6 +2292,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ hanshao:'韩韶(生卒年不详),字仲黄,颍川舞阳(今河南省漯河市)人,东汉桓帝时出仕。任郡吏,有政绩,继而被征入司徒府。他公正廉明,尽心民事,视民苦如在己身,政绩卓著。汉永寿二年(公元156年),泰山贼公孙举率流寇数千骚扰嬴县,守令因不能拒敌安民,多受制裁,朝廷命尚书府从三府(司徒、司马、司空)属员中,选择能治理民事,又能拒寇入侵的官员,前往镇守。韩韶被封为“嬴长”到嬴县上任,他是莱芜历史上唯一的一位“嬴长”。', hanrong:'韩融(127年~196年),字元长,颍川舞阳(今属河南省漯河市)人。赢长韩韶子,献帝时大臣。中平五年(188年),融与荀爽、陈纪等十四人并博士征,不至。董卓废立,融等复俱公车征。初平元年(190年)六月,融为大鸿胪,奉命与执金吾胡母班等出使关东。献帝东迁,为李傕、郭汜等所败,融为太仆,奉命至弘农与傕、汜连和,使其放遣公卿百官及宫女妇人。', wukuang:'吴匡(生卒年不详),兖州陈留(今河南开封市)人。东汉末年大臣,大将军何进部将。光熹元年(公元189年),汉灵帝死后,十常侍干预朝政,大将军何进谋诛宦官,但失败被杀,吴匡联合曹操、袁绍等杀尽宦官,攻杀车骑将军何苗。兴平二年(公元195年)十月,李傕、郭汜后悔放汉献帝东归洛阳,于是联合起来追击,曹操遂起兵平乱,但在回朝后,曹操挟天子以令诸侯,实行专权,但遭到吴匡反对。', + wanghun:'王浑(223年~297年),字玄冲,太原郡晋阳县(今山西省太原市)人。魏晋时期名臣,曹魏司空王昶的儿子。王浑早年为大将军曹爽的掾吏,高平陵政变后,循例免官,出任怀县县令、散骑侍郎等职,袭封京陵县侯。西晋王朝建立后,加号扬烈将军,历任征虏将军、东中郎将、豫州刺史等职,积极筹划伐吴方略。咸宁五年(279年),配合镇南将军杜预灭亡吴国,迁征东大将军、左仆射、司徒公,晋爵京陵县公。晋惠帝司马衷即位,加任侍中衔。楚王司马玮发动政变,有意寻求支持,遭到严词拒绝。楚王司马玮死后,复任司徒、录尚书事。元康七年(297年),王浑去世,享年七十五岁,谥号为元。《唐会要》尊为“魏晋八君子”之一。', }, dynamicTranslate:{ clanlianzhu:function(player){ @@ -2139,6 +2374,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ clanjiexuan_info:'限定技,转换技。阴:你可以将一张红色牌当【顺手牵羊】使用;阳:你可以将一张黑色牌当【过河拆桥】使用。', clanmingjie:'铭戒', clanmingjie_info:'限定技。出牌阶段,你可以选择一名角色,然后直到其下回合结束时,当你使用牌时你可以指定其为额外目标。然后其下回合结束时,你可以使用本回合使用过的黑桃牌和被抵消过的牌。', + clan_wanghun:'族王浑', + clanfuxun:'抚循', + clanfuxun_info:'出牌阶段限一次。你可以获得或交给一名其他角色一张手牌,然后若其手牌数与你相等且于此阶段仅以此法获得或失去过牌,你可以将一张牌当任意基本牌使用。', + clanchenya:'沉雅', + clanchenya_info:'当一名角色发动“出牌阶段限一次”的技能后,你可以令其重铸任意张牌名字数为X的牌(X为其手牌数)。', + clan_zhonghui:'族钟会', + clanyuzhi:'迂志', + clanyuzhi_info:'锁定技。新的一轮开始时,你依次执行以下项:①若你上一轮使用的牌数或你上上轮因〖迂志〗摸的牌数小于你上轮因〖迂志〗摸的牌数,你失去1点体力或失去〖保族〗。②你展示一张手牌,然后摸X张牌(X为此牌牌名字数)。', + clanxieshu:'挟术', + clanxieshu_info:'当你使用牌造成伤害后,或受到来自牌造成的伤害后,你可以弃置Y张牌并摸你已损失体力值张牌(Y为此牌牌名字数)。', clan_wu:'陈留·吴氏', clan_xun:'颍川·荀氏', diff --git a/character/collab.js b/character/collab.js index d54f2aa17..22921c374 100644 --- a/character/collab.js +++ b/character/collab.js @@ -718,53 +718,54 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, forced:true, filter:function(event,player){ - return (event.name!='phase'||game.phaseNumber==0)&&!player.isDisabled(1); + return (event.name!='phase'||game.phaseNumber==0)&&player.hasEquipableSlot(1)&&!player.getEquips('ruyijingubang').length; }, content:function(){ var card=game.createCard2('ruyijingubang','heart',9); player.$gain2(card,false); + game.delayx(); player.equip(card); }, mod:{ canBeGained:function(card,source,player){ - if(card==player.getEquip(1)&&card.name=='ruyijingubang') return false; + if(player.getEquips('ruyijingubang').contains(card)) return false; }, canBeDiscarded:function(card,source,player){ - if(card==player.getEquip(1)&&card.name=='ruyijingubang') return false; + if(player.getEquips('ruyijingubang').contains(card)) return false; + }, + canBeReplaced:function(card,player){ + if(player.getEquips('ruyijingubang').contains(card)) return false; }, cardname:function(card){ if(get.subtype(card,false)=='equip1') return 'sha'; }, cardnature:function(card){ - if(get.subtype(card,false)=='equip1') return false; - }, - targetEnabled:function(card){ - if(get.subtype(card)=='equip1') return false; + if(get.subtypes(card,false).contains('equip1')) return false; }, cardDiscardable:function(card,player){ - if(card==player.getEquip(1)&&card.name=='ruyijingubang') return false; + if(player.getEquips('ruyijingubang').contains(card)) return false; }, cardEnabled2:function(card,player){ - if(card==player.getEquip(1)&&card.name=='ruyijingubang') return false; + if(player.getEquips('ruyijingubang').contains(card)) return false; }, }, group:'dcruyi_blocker', subSkill:{ blocker:{ - trigger:{player:['loseBefore','equipBefore','disableEquipBefore']}, + trigger:{player:['loseBefore','disableEquipBefore']}, forced:true, filter:function(event,player){ - if(event.name=='disableEquip') return (event.pos=='equip1'); - var card=player.getEquip(1); - if(!card||card.name!='ruyijingubang') return false; - if(event.name=='equip'){ - return get.subtype(event.card)=='equip1'; - } - return event.cards.contains(card); + if(event.name=='disableEquip') return (event.slots.contains('equip1')); + var cards=player.getEquips('ruyijingubang'); + return event.cards.some(card=>cards.contains(card)); }, content:function(){ - if(trigger.name=='lose') trigger.cards.remove(player.getEquip(1)); - else trigger.cancel(); + if(trigger.name=='lose'){ + trigger.cards.remove(player.getEquips('ruyijingubang')); + } + else{ + while(trigger.slots.contains('equip1')) trigger.slots.remove('equip1'); + } }, }, }, @@ -803,10 +804,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ var num=lib.skill.ruyijingubang_skill_backup.num; player.storage.ruyijingubang_skill=num; - var card=player.getEquip(1); - if(card&&card.name=='ruyijingubang'){ - card.storage.ruyijingubang_skill=num; - game.log(player,'将',card,'的攻击范围改为'+num) + var card=player.getEquips(1); + for(var card of cards){ + if(card&&card.name=='ruyijingubang'){ + card.storage.ruyijingubang_skill=num; + game.log(player,'将',card,'的攻击范围改为'+num) + } } player.markSkill('ruyijingubang_skill'); }, diff --git a/character/ddd.js b/character/ddd.js index 695d62523..fccf1d110 100644 --- a/character/ddd.js +++ b/character/ddd.js @@ -3405,7 +3405,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, direct:true, filter:function(event,player){ - return event.source&&event.source.isIn()&&event.source.getEquip(1); + return event.source&&event.source.isIn()&&event.source.getEquips(1).length>0; }, content:function(){ 'step 0' diff --git a/character/diy.js b/character/diy.js index d75785510..cc7234575 100755 --- a/character/diy.js +++ b/character/diy.js @@ -3447,10 +3447,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, charlotte:true, filter:function(event,player){ - return !player.isDisabled(1); + return player.hasEnabledSlot(1); }, content:function(){ - if(player.isEmpty(1)){ + if(player.hasEmptySlot(1)){ var card=get.cardPile2(function(card){ return get.subtype(card)=='equip1'&&!get.cardtag(card,'gifts')&&player.canUse(card,player); }); @@ -4176,12 +4176,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filterCard:function(card,player){ if(!player) player=_status.event.player; return game.hasPlayer(function(current){ - return current!=player&¤t.isEmpty(get.subtype(card,false)); + return current!=player&¤t.canEquip(card); }); }, position:'e', filterTarget:function(card,player,target){ - return target!=player&&target.isEmpty(get.subtype(ui.selected.cards[0],false)); + return target!=player&&target.canEquip(ui.selected.cards[0]); }, check:function(card){ if(get.value(card)<=0) return 10; @@ -4197,6 +4197,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } return 0; }, + promptfunc:function(){ + var players=game.filterPlayer(function(current){ + return current.hasSkill('kotomi_chuanxiang'); + }); + return '将一张装备牌传给其他角色,然后令'+get.translation(players)+'摸一张牌。若传给该角色,则其改为摸两张牌。' + }, prepare:'give', discard:false, lose:false, @@ -4899,7 +4905,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'disableEquipAfter'}, forced:true, filter:function(event,player){ - return player.countDisabled()>=5&&!player._chihaya_liewu; + return !player.hasEnabledSlot()&&!player._chihaya_liewu; }, skillAnimation:true, animationColor:'orange', @@ -4920,7 +4926,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return get.type(card)=='equip'; }, check:function(card){ - if(_status.event.player.isDisabled(get.subtype(card))) return 5; + if(!_status.event.player.hasEquipableSlot(get.subtype(card))) return 5; return 3-get.value(card); }, content:function(){ @@ -4956,14 +4962,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.storage.chihaya_youfeng=false; }, hiddenCard:function(player,name){ - if(player.storage.chihaya_youfeng&&player.countDisabled()>=5) return false; + if(player.storage.chihaya_youfeng&&!player.hasEnabledSlot()) return false; if(player.hasSkill('chihaya_youfeng_'+(player.storage.chihaya_youfeng||false))) return false; var type=get.type(name); if(player.storage.chihaya_youfeng) return type=='basic'; return type=='trick'; }, filter:function(event,player){ - if(player.storage.chihaya_youfeng&&player.countDisabled()>=5) return false; + if(player.storage.chihaya_youfeng&&!player.hasEnabledSlot()) return false; if(player.hasSkill('chihaya_youfeng_'+(player.storage.chihaya_youfeng||false))) return false; var type=player.storage.chihaya_youfeng?'basic':'trick'; for(var name of lib.inpile){ @@ -4982,7 +4988,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ table.style.width='100%'; table.style.position='relative'; for(var i=1;i<6;i++){ - if(player.isDisabled(i)) continue; + if(!player.hasEnabledSlot(i)) continue; var td=ui.create.div('.shadowed.reduce_radius.pointerdiv.tdnode'); td.innerHTML=''+get.translation('equip'+i)+''; td.link=i; @@ -5020,11 +5026,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ check:function(button){ var player=_status.event.player; if(typeof button.link=='number'){ - var card=player.getEquip(button.link); - if(card){ - var val=get.value(card); - if(val>0) return 0; - return 5-val; + if(!player.hasEmptySlot(button.link)){ + var card=player.getEquip(button.link); + if(card){ + var val=get.value(card); + if(val>0) return 0; + return 5-val; + } } switch(button.link){ case 3:return 4.5;break; @@ -5215,20 +5223,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sakuya_junbu:{ mod:{ targetInRange:function(card,player){ - if(player.countDisabled()>=1) return true; + if(player.countDisabledSlot()>=1) return true; }, cardUsable:function(card,player){ - if(player.countDisabled()>=2) return Infinity; + if(player.countDisabledSlot()>=2) return Infinity; }, }, trigger:{player:'useCard2'}, direct:true, filter:function(event,player){ - if(player.countDisabled()>=4) return true; + if(player.countDisabledSlot()>=4) return true; return lib.skill.sakuya_junbu.filter2.apply(this,arguments); }, filter2:function(event,player){ - if(player.countDisabled()<3) return false; + if(player.countDisabledSlot()<3) return false; var card=event.card; var info=get.info(card); if(info.allowMultiple==false) return false; @@ -5243,7 +5251,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ 'step 0' - if(player.countDisabled()>=4){ + if(player.countDisabledSlot()>=4){ trigger.directHit.addArray(game.players); if(!lib.skill.sakuya_junbu.filter2(trigger,player)){ event.finish(); @@ -5280,7 +5288,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, sub:true, filter:function(event,player){ - return player.countDisabled()>=5&&event.getParent().type=='card'; + return !player.hasEnabledSlot()&&event.getParent().type=='card'; }, logTarget:'player', content:function(){ @@ -6536,7 +6544,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(player==target) return false; var card=ui.selected.cards[0]; if(get.type(card,false)=='delay') return target.canAddJudge({name:card.name}); - return target.isEmpty(get.subtype(card,false)); + return target.canEquip(card); }, discard:false, lose:false, @@ -10178,13 +10186,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ locked:false, mod:{ cardUsable:function(card,player,num){ - if(card.name=='sha'&&player.isDisabled(1)) return num+1; + if(card.name=='sha'&&player.hasDisabledSlot(1)) return num+1; }, globalFrom:function(from,to,distance){ - if(from.isDisabled(4)) return distance-1; + if(from.hasDisabledSlot(4)) return distance-1; }, globalTo:function(from,to,distance){ - if(to.isDisabled(3)) return distance+1; + if(to.hasDisabledSlot(3)) return distance+1; }, }, enable:'phaseUse', @@ -10192,7 +10200,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ var list=['equip1','equip2','equip3','equip4','equip5']; for(var i=0;i0 })) return 'equip1'; - if(list.contains('equip3')&&player.isEmpty('equip3')) return 'equip3'; - if(list.contains('equip4')&&player.isEmpty('equip4')) return 'equip4'; - if(list.contains('equip5')&&player.isEmpty('equip5')) return 'equip5'; - if(list.contains('equip2')&&player.isEmpty('equip2')) return 'equip2'; + if(list.contains('equip3')&&player.hasEmptySlot('equip3')) return 'equip3'; + if(list.contains('equip4')&&player.hasEmptySlot('equip4')) return 'equip4'; + if(list.contains('equip5')&&player.hasEmptySlot('equip5')) return 'equip5'; + if(list.contains('equip2')&&player.hasEmptySlot('equip2')) return 'equip2'; return list.randomGet(); }; 'step 1' @@ -10226,7 +10234,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'useCardToPlayered'}, forced:true, filter:function(event,player){ - return event.card.name=='sha'&&player.isDisabled(1)&&event.target.countCards('he')>0; + return event.card.name=='sha'&&player.hasDisabledSlot(1)&&event.target.countCards('he')>0; }, logTarget:'target', content:function(){ @@ -10240,7 +10248,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ position:'hes', prompt:'将一张牌当做闪使用或打出', viewAsFilter:function(player){ - return player.isDisabled(2)&&player.countCards('hes')>0; + return player.hasDisabledSlot(2)&&player.countCards('hes')>0; }, check:function(card){ return 1/Math.max(0.1,get.value(card)); @@ -10248,7 +10256,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ respondShan:true, skillTagFilter:function(player){ - return player.isDisabled(2)&&player.countCards('he')>0; + return player.hasDisabledSlot(2)&&player.countCards('he')>0; }, }, }, @@ -10256,17 +10264,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseZhunbeiBegin'}, forced:true, filter:function(event,player){ - return player.countDisabled()>0; + return player.countDisabledSlot()>0; }, content:function(){ - var list=['equip1','equip2','equip3','equip4','equip5']; - for(var i=0;i0; + }, + content:function(){ + 'step 0' + if(!_status.characterlist){ + lib.skill.pingjian.initList(); + } + var list=_status.characterlist.randomGets(5); + if(!list.length) event.finish(); + else{ + var num=player.countEquipableSlot(1); + player.chooseButton([ + '挈挟:选择至多'+get.cnNumber(num)+'张武将置入武器栏', + [list,'character'], + ],[1,num],true).set('ai',function(button){ + var name=button.link; + var info=lib.character[name]; + var skills=info[3].filter(function(skill){ + var info=get.skillInfoTranslation(skill); + if(!info.includes('【杀】')) return false; + var list=get.skillCategoriesOf(skill); + list.remove('锁定技'); + return list.length==0; + }); + var eff=0.2; + for(var i of skills){ + eff+=get.skillRank(i,'in'); + } + return eff; + }) + } + 'step 1' + if(result.bool){ + var list=result.links; + game.addVideo('skill',player,['qiexie',[list]]) + game.broadcastAll(function(list){ + for(var name of list) lib.skill.qiexie.createCard(name); + },list); + var cards=list.map(function(name){ + var card=game.createCard('qiexie_'+name,'none',get.infoMaxHp(lib.character[name][2])); + return card; + }); + player.addTempSkill('qiexie_blocker','qiexieAfter'); + player.markAuto('qiexie_blocker',cards); + player.$gain2(cards); + game.delayx(); + for(var card of cards) player.equip(card); + } + }, + video:function(player,info){ + for(var name of info[0]){ + lib.skill.qiexie.createCard(name); + } + }, + createCard:function(name){ + if(!_status.postReconnect.qiexie) _status.postReconnect.qiexie=[ + function(list){ + for(var name of list) lib.skill.qiexie.createCard(name); + },[] + ]; + _status.postReconnect.qiexie[1].add(name) + if(!lib.card['qiexie_'+name]){ + if(lib.translate[name+'_ab']) lib.translate['qiexie_'+name]=lib.translate[name+'_ab']; + else lib.translate['qiexie_'+name]=lib.translate[name]; + var info=lib.character[name]; + var card={ + fullimage:true, + image:'character:'+name, + type:'equip', + subtype:'equip1', + enable:true, + selectTarget:-1, + filterCard:function(card,player,target){ + if(player!=target) return false; + return target.canEquip(card,true); + }, + modTarget:true, + allowMultiple:false, + content:lib.element.content.equipCard, + toself:true, + ai:{}, + skills:['qiexie_destroy'], + } + var maxHp=get.infoMaxHp(info[2]); + if(maxHp!=1) card.distance={attackFrom:(1-maxHp)}; + var skills=info[3].filter(function(skill){ + var info=get.skillInfoTranslation(skill); + if(!info.includes('【杀】')) return false; + var list=get.skillCategoriesOf(skill); + list.remove('锁定技'); + return list.length==0; + }); + var str='锁定技。'; + if(skills.length){ + card.skills.addArray(skills); + str+='你视为拥有技能'; + for(var skill of skills){ + str+='〖'+get.translation(skill)+'〗'; + str+='、'; + } + str=str.slice(0,str.length-1); + str+=';' + } + str+='此牌离开你的装备区后,改为置入剩余武将牌牌堆。'; + lib.translate['qiexie_'+name+'_info']=str; + lib.card['qiexie_'+name]=card; + } + }, + subSkill:{ + blocker:{ + mod:{ + canBeReplaced:function(card,player){ + if(player.getStorage('qiexie_blocker').contains(card)) return false; + }, + }, + charlotte:true, + onremove:true, + trigger:{player:'equipEnd'}, + forced:true, + firstDo:true, + priority:Infinity, + filter:function(event){ + var evt=event.getParent(); + if(evt.name!='qiexie') return false; + return !evt.next.some(event=>{ + return event.name=='equip'; + }) + }, + content:function(){ + player.removeSkill('qiexie_blocker'); + }, + }, + destroy:{ + trigger:{player:'loseBegin'}, + equipSkill:true, + forceDie:true, + charlotte:true, + forced:true, + popup:false, + filter:function(event,player){ + return event.cards.some(card=>card.name.indexOf('qiexie_')==0) + }, + content:function(){ + for(var card of trigger.cards){ + if(card.name.indexOf('qiexie_')==0){ + card._destroy=true; + game.log(card,'被放回武将牌堆'); + var name=card.name.slice(7); + if(lib.character[name]) _status.characterlist.add(name); + } + } + }, + }, + }, + }, + cuijue:{ + enable:'phaseUse', + filter:function(event,player){ + return player.countCards('he')>0&&game.hasPlayer(target=>lib.skill.cuijue.filterTarget('SB',player,target)); + }, + filterCard:true, + filterTarget:function(card,player,target){ + if(player.getStorage('cuijue_used').contains(target)||!player.inRange(target)) return false; + var distance=get.distance(player,target); + return !game.hasPlayer(current=>(current!=target&&player.inRange(current)&&get.distance(player,current)>distance)); + }, + position:'he', + check:card=>6-get.value(card), + content:function(){ + player.addTempSkill('cuijue_used','phaseUseAfter'); + player.markAuto('cuijue_used',[target]); + target.damage('nocard'); + }, + ai:{ + order:2, + result:{ + target:-1.5 + }, + tag:{ + damage:1 + } + }, + subSkill:{ + used:{ + onremove:true, + charlotte:true, + }, + }, + }, //神邓艾 dctuoyu:{ audio:2, @@ -1151,13 +1360,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(event.responded||event.shouli||event.type=='wuxie') return false; if(game.hasPlayer(function(current){ - return current.getEquip(4); + return current.getCards('e',card=>get.subtype(card)=='equip4').length>0; })&&event.filterCard({ name:'sha', storage:{shouli:true}, },player,event)) return true; if(game.hasPlayer(function(current){ - return current.getEquip(3); + return current.getCards('e',card=>get.subtype(card)=='equip3').length>0; })&&event.filterCard({ name:'shan', storage:{shouli:true}, @@ -1169,23 +1378,24 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filterTarget:function(card,player,target){ var event=_status.event,evt=event; if(event._backup) evt=event._backup; - var equip3=target.getEquip(3); - var equip4=target.getEquip(4); - if(equip3&&evt.filterCard(get.autoViewAs({ + var equip3=target.getCards('e',card=>get.subtype(card,false)=='equip3'); + var equip4=target.getCards('e',card=>get.subtype(card,false)=='equip4'); + if(equip3.length&&equip3.some(card=>evt.filterCard(get.autoViewAs({ name:'shan', storage:{shouli:true}, - },[equip3]),player,event)) return true; - var sha=get.autoViewAs({ - name:'sha', - storage:{shouli:true}, - },[equip4]); - if(equip4&&evt.filterCard(sha,player,event)){ - if(!evt.filterTarget) return true; - return game.hasPlayer(function(current){ - return evt.filterTarget(sha,player,current); - }) - }; - return false; + },[card]),player,event))) return true; + return equip4.some(card=>{ + var sha=get.autoViewAs({ + name:'sha', + storage:{shouli:true}, + },[card]); + if(evt.filterCard(sha,player,event)){ + if(!evt.filterTarget) return true; + return game.hasPlayer(function(current){ + return evt.filterTarget(sha,player,current); + }) + }; + }) }, prompt:'将场上的一张坐骑牌当做【杀】或【闪】使用或打出', content:function(){ @@ -1193,32 +1403,45 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var evt=event.getParent(2); evt.set('shouli',true); var list=[]; - var equip3=target.getEquip(3); - var equip4=target.getEquip(4); + var equip3=target.getCards('e',card=>get.subtype(card,false)=='equip3'); + var equip4=target.getCards('e',card=>get.subtype(card,false)=='equip4'); var backupx=_status.event; _status.event=evt; try{ - if(equip3){ + if(equip3.length&&equip3.some(card=>{ var shan=get.autoViewAs({ name:'shan', storage:{shouli:true}, - },[equip3]); - if(evt.filterCard(shan,player,event)) list.push('shan'); + },[card]); + if(evt.filterCard(shan,player,event)) return true; + return false; + })){ + list.push('shan'); } - if(equip4){ + if(equip4.length&&equip4.some(card=>{ var sha=get.autoViewAs({ name:'sha', storage:{shouli:true}, - },[equip4]); + },[card]); if(evt.filterCard(sha,player,evt)&&(!evt.filterTarget||game.hasPlayer(function(current){ return evt.filterTarget(sha,player,current); - }))) list.push('sha'); + }))) return true; + return false; + })){ + list.push('sha'); }; }catch(e){game.print(e)}; _status.event=backupx; - if(list.length==1) event._result={ - bool:true, - links:[list[0]=='shan'?equip3:equip4], + if(list.length==1){ + event.cardName=list[0]; + var cards=list[0]=='shan'?equip3:equip4; + if(cards.length==1) event._result={ + bool:true, + links:[cards[0]], + } + else player.choosePlayerCard(true,target,'e').set('filterButton',function(button){ + return _status.event.cards.contains(button.link); + }).set('cards',cards) } else player.choosePlayerCard(true,target,'e').set('filterButton',function(button){ var type=get.subtype(button.link); @@ -1227,7 +1450,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 1' var evt=event.getParent(2); if(result.bool&&result.links&&result.links.length){ - var name=get.subtype(result.links[0])=='equip3'?'shan':'sha'; + var name=(event.cardName||(get.subtype(result.links[0])=='equip4'?'sha':'shan')); if(evt.name=='chooseToUse'){ game.broadcastAll(function(result,name){ lib.skill.shouli_backup.viewAs={ @@ -1271,7 +1494,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ skillTagFilter:function(player,tag){ var subtype=(tag=='respondSha'?'equip4':'equip3'); return game.hasPlayer(function(current){ - return current.getEquip(subtype); + return current.hasCard(card=>get.subtype(card,false)==subtype,'e'); }); }, order:2, @@ -1743,7 +1966,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!player.storage.yuheng.contains(i)) return false; } var type=get.subtype(event.card); - if(lib.card['changandajian_'+type]&&!player.isDisabled(type)) return true; + if(lib.card['changandajian_'+type]&&player.hasEquipableSlot(type)) return true; return false; }, content:function(){ @@ -3220,7 +3443,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ var players=game.filterPlayer(); for(var i=0;i0){ return true; } } @@ -3229,10 +3452,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var players=game.filterPlayer(); for(var i=0;i0){ player.line(players[i],'green'); - players[i].give(e,player); + player.gain(e,players[i],'give','bySelf'); } } } @@ -3562,8 +3785,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else{ event.target2=result.targets[0]; var list=['手牌区']; - if(lib.card[card.name].type=='equip'&&event.target2.isEmpty(lib.card[card.name].subtype)) list.push('装备区'); - if(lib.card[card.name].type=='delay'&&!event.target2.storage._disableJudge&&!event.target2.hasJudge(card.name)) list.push('判定区'); + if(lib.card[card.name].type=='equip'&&event.target2.canEquip(card)) list.push('装备区'); + if(lib.card[card.name].type=='delay'&&!event.target2.isDisabledJudge()&&!event.target2.hasJudge(card.name)) list.push('判定区'); if(list.length==1) event._result={control:list[0]}; else{ player.chooseControl(list).set('prompt','把'+get.translation(card)+'移动到'+get.translation(event.target2)+'的...').ai=function(){return 0}; @@ -3839,7 +4062,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ var num=event.name=='phase'?5:3; if(num==3?event.numFixed:!game.hasPlayer(function(current){ - return current.countDisabled()<5; + return current.hasEnabledSlot(); })) return false; return game.countPlayer(function(current){ return current.isDamaged(); @@ -3855,7 +4078,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else{ player.chooseTarget(get.prompt('olzhiti'),'废除一名角色的一个随机装备栏',function(card,player,target){ - return target.countDisabled()<5; + return target.hasEnabledSlot(); }).set('ai',function(target){ return -get.attitude(_status.event.player,target)*(target.countCards('e')+1) }); @@ -3866,13 +4089,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.logSkill('olzhiti',target); var list=[]; for(var i=1;i<6;i++){ - if(!target.isDisabled(i)) list.add((i==3||i==4)?6:i); + if(target.hasEnabledSlot(i)) list.add((i==3||i==4)?6:i); } var num=list.randomGet(); if(num!=6) target.disableEquip(num); else{ - target.disableEquip(3); - target.disableEquip(4); + target.disableEquip(3,4); } } }, @@ -6229,7 +6451,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return player!=event.player&&event.player.isIn()&&_status.currentPhase==player; }, check:function(event,player){ - if(player.countDisabled()<5&&player.isDisabled(5)) return false; + if(player.hasEnabledSlot()&&!player.hasEnabledSlot(5)) return false; return true; }, bannedList:[ @@ -6253,7 +6475,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(func(listm[i])) list.add(listm[i]); } event.skills=list; - if(player.countDisabled()<5){ + if(player.hasEnabledSlot()){ player.chooseToDisable().ai=function(event,player,list){ if(list.contains('equip5')) return 'equip5'; return list.randomGet(); @@ -7080,7 +7302,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ stianyi_info:'觉醒技,准备阶段,若场上的所有存活角色均于本局游戏内受到过伤害,则你加2点体力上限并回复1点体力,然后令一名角色获得技能〖佐幸〗。', zuoxing:'佐幸', zuoxing2:'佐幸', - zuoxing_info:'出牌阶段限一次,若令你获得〖佐幸〗的角色存活且体力上限大于1,则你可以令其减1点体力上限,并视为一张普通锦囊牌。', + zuoxing_info:'出牌阶段限一次,若令你获得〖佐幸〗的角色存活且体力上限大于1,则你可以令其减1点体力上限,并视为使用一张普通锦囊牌。', sghuishi:'辉逝', sghuishi_info:'限定技,出牌阶段,你可以选择一名其他角色:若其有未发动过的觉醒技,则你令其发动这些觉醒技时无视原有条件;否则其摸四张牌。然后你减2点体力上限。', shen_taishici:'神太史慈', @@ -7179,7 +7401,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ twwuhun_info:'锁定技。①当你受到其他角色造成的1点伤害后,你令伤害来源获得1枚“梦魇”标记。②当你对有“梦魇”标记的其他角色造成伤害后,你令其获得一枚“梦魇”标记。③当你死亡时,你可进行判定。若结果不为【桃】或【桃园结义】,则你选择至少一名拥有“梦魇”标记的角色。令这些角色各自失去X点体力(X为其“梦魇”标记数)。', shen_zhangfei:'神张飞', shencai:'神裁', - shencai_info:'出牌阶段限一次,你可以令一名其他角色进行判定。你获得此判定牌,然后若此判定牌:包含以下要素中的任意一个,则其失去已有的下列效果,并获得对应的效果:{⒈体力:当其受到伤害后,其失去等量的体力、⒉武器:其不能使用牌响应杀、⒊打出:当其失去手牌后,其再随机弃置一张手牌(不嵌套触发)、⒋距离:其的结束阶段开始时,其翻面};若均不包含,你获得其区域里的一张牌,其获得一枚“死”并获得如下效果:其的角色手牌上限-X、其的回合结束时,若X大于场上存活人数,则其死亡(X为其“死”标记数)。', + shencai_info:'出牌阶段限一次,你可以令一名其他角色进行判定。你获得此判定牌,然后若此判定牌:包含以下要素中的任意一个,则其失去已有的下列效果,并获得对应的效果:{⒈体力:当其受到伤害后,其失去等量的体力、⒉武器:其不能使用牌响应【杀】、⒊打出:当其失去手牌后,其再随机弃置一张手牌(不嵌套触发)、⒋距离:其的结束阶段开始时,其翻面};若均不包含,你获得其区域里的一张牌,其获得一枚“死”并获得如下效果:其的角色手牌上限-X、其的回合结束时,若X大于场上存活人数,则其死亡(X为其“死”标记数)。', xunshi:'巡使', xunshi_info:'锁定技。①你手牌区内所有的多目标锦囊牌均视为花色为none的普【杀】。②你使用颜色为none的牌无距离和次数限制。③当你使用无颜色的牌选择目标后,你令你的〖神裁〗的发动次数上限+1(至多为5),然后可以为此牌增加任意个目标。', shen_zhangjiao:'神张角', @@ -7212,6 +7434,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dcqijing_info:'觉醒技。一名角色的回合结束后,若你的三个副区域标签均被激活,则你减1点体力上限,将座位移动至一名其他角色的上家之后,获得〖摧心〗和一个额外回合。', dccuixin:'摧心', dccuixin_info:'当你不因此技能使用的基本牌或普通锦囊牌结算结束后,若此牌的目标包含你的上家或下家,则你可以视为对下家或上家再使用一张牌名和元素相同的牌。', + shen_dianwei:'神典韦', + juanjia:'捐甲', + juanjia_info:'锁定技。游戏开始时,你废除一个防具栏,然后获得一个额外的武器栏。', + qiexie:'挈挟', + qiexie_info:'锁定技。准备阶段,你在剩余武将牌堆中随机观看五张牌,选择其中的任意张,将其按照如下规则转化为武器牌置入你的武器栏:{⒈此牌不具有花色,且其攻击范围和点数等于此武将牌的体力上限。⒉此武器牌的技能为该武将牌上所有描述中包含“【杀】”且不具有锁定技以外的标签的技能。⒊此武器牌离开你的装备区时,改为放回武将牌堆。}', + cuijue:'摧决', + cuijue_info:'每回合每名角色限一次。出牌阶段,你可以弃置一张牌,然后对攻击范围内距离最远的一名其他角色造成1点伤害。', extra_feng:'神话再临·风', extra_huo:'神话再临·火', diff --git a/character/huicui.js b/character/huicui.js index 784f861c7..349e1911d 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -11,7 +11,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ zhangkai:['male','qun',4,['dcxiangshu']], gaoxiang:['male','shu',4,['dcchiying'],['unseen']], yuanyin:['male','qun',3,['dcmoshou','dcyunjiu'],['unseen']], - dongwan:['female','qun',3,['dcshengdu','dcxianjiao'],['unseen']], + dongwan:['female','qun',3,['dcshengdu','dcjieling'],['unseen']], zhangchu:['female','qun',3,['dcjizhong','dcrihui','dcguangshi']], peiyuanshao:['male','qun',4,['dcmoyu'],['unseen']], mengjie:['male','qun',3,['dcyinlu','dcyouqi']], @@ -1051,7 +1051,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var att=get.attitude(player,target); var eff=get.effect(target,{ name:'sha', - storage:{dcxianjiao:true}, + storage:{dcjieling:true}, },player,player); var value=att/5; if(value<0) value=-value/1.3; @@ -1102,14 +1102,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } } }, - dcxianjiao:{ + dcjieling:{ audio:2, enable:'phaseUse', usable:1, position:'hs', viewAs:{ name:'sha', - storage:{dcxianjiao:true} + storage:{dcjieling:true} }, filterCard:function(card,player){ if(ui.selected.cards.length){ @@ -1123,7 +1123,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 6-get.value(card); }, precontent:function(){ - player.addTempSkill('dcxianjiao_after'); + player.addTempSkill('dcjieling_after'); event.getParent().addCount=false; }, ai:{ @@ -1134,7 +1134,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ locked:false, mod:{ targetInRange:function(card){ - if(card.storage&&card.storage.dcxianjiao) return true; + if(card.storage&&card.storage.dcjieling) return true; }, }, subSkill:{ @@ -1144,7 +1144,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, charlotte:true, filter:function(event,player){ - return event.card.name=='sha'&&event.card.storage&&event.card.storage.dcxianjiao; + return event.card.name=='sha'&&event.card.storage&&event.card.storage.dcjieling; }, content:function(){ 'step 0' @@ -1152,7 +1152,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return current.hasHistory('damage',evt=>evt.card==trigger.card); }); var targets=trigger.targets.filter(i=>i.isIn()); - player.logSkill('dcxianjiao_after',targets); + player.logSkill('dcjieling_after',targets); if(damaged){ for(var target of targets){ target.loseHp(); @@ -4704,9 +4704,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, enable:'phaseUse', usable:1, - isDisabled:function(player,pos){ - return pos>0?player.isDisabled(pos):player.storage._disableJudge; - }, chooseButton:{ dialog:function(event,player){ var dialog=ui.create.dialog('弥笃:选择要废除或恢复的装备栏或判定区','hidden'); @@ -4714,10 +4711,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dialog.noforcebutton=true; var list1=[],list2=[]; for(var i=1;i<6;i++){ - (player.isDisabled(i)?list2:list1).push(i); + for(var j=0;j0?get.translation('equip'+i)+'栏':'判定区')+''; - td.link=i; + td.link=[i,bool]; td.addEventListener(lib.config.touchscreen?'touchend':'click',ui.click.button); for(var j in lib.element.button){ td[j]=lib.element.button[j]; @@ -4738,43 +4738,43 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } if(list1.length){ dialog.addText('未废除'); - addTable(list1); + addTable(list1,true); } if(list2.length){ dialog.addText('已废除'); - addTable(list2); + addTable(list2,false); } return dialog; }, filter:function(button,player){ if(!ui.selected.buttons.length) return true; - if(lib.skill.midu.isDisabled(player,ui.selected.buttons[0].link)) return false; - return !player.isDisabled(button.link); + if(!ui.selected.buttons[0].link[1]) return false; + return button.link[1] }, check:function(button){ var player=_status.event.player; - if(lib.skill.midu.isDisabled(player,button.link)){ - if(button.link<=0) return -10; + if(!button.link[1]){ + if(button.link[0]<=0) return -10; if(player.hasCard(function(card){ - return get.subtype(card)==('equip'+button.link); + return get.subtype(card)==('equip'+button.link[0]); },'hs')) return 15; return 10; } - if(button.link<=0||player.isEmpty(button.link)&&!player.hasCard(function(card){ - return get.subtype(card)==('equip'+button.link)&&player.canUse(card,player)&&get.effect(player,card,player,player)>0; + if(button.link[0]<=0||player.hasEmptySlot(button.link[0])&&!player.hasCard(function(card){ + return get.subtype(card)==('equip'+button.link[0])&&player.canUse(card,player)&&get.effect(player,card,player,player)>0; },'hs')) return 5; return 0; }, - select:[1,6], + select:[1,Infinity], backup:function(links,player){ - if(lib.skill.midu.isDisabled(player,links[0])){ + if(!links[0][1]){ return { audio:'midu', selectCard:-1, selectTarget:-1, filterCard:()=>false, filterTarget:()=>false, - equip:links[0], + equip:links[0][0], content:function(){ var pos=lib.skill.midu_backup.equip; if(pos<=0) player.enableJudge(); @@ -4789,15 +4789,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ selectCard:-1, filterCard:()=>false, filterTarget:true, - equip:links.sort(), + equip:links.map(i=>i[0]).sort(), content:function(){ - var list=lib.skill.midu_backup.equip,bool=false; - for(var i of list){ - if(i<=0) bool=true; - else player.disableEquip(i); + var list=lib.skill.midu_backup.equip,num=list.length,bool=false; + if(list.contains(-1)){ + list.remove(-1); + bool=true; } + if(list.length>0) player.disableEquip(list); if(bool) player.disableJudge(); - target.draw(list.length) + target.draw(num) }, ai:{ tag:{ @@ -4811,7 +4812,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, prompt:function(links,player){ - if(lib.skill.midu.isDisabled(player,links[0])){ + if(!links[0][1]){ return '恢复一个装备栏或判定区并获得〖活墨〗'; } var numc=get.cnNumber(links.length); @@ -4828,11 +4829,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xianwang:{ mod:{ globalTo:function(source,player,distance){ - var num=player.countDisabled(); + var num=player.countDisabledSlot(); if(num>0) return distance+(num>2?2:1); }, globalFrom:function(source,player,distance){ - var num=source.countDisabled(); + var num=source.countDisabledSlot(); if(num>0) return distance-(num>2?2:1); }, }, @@ -5513,7 +5514,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var info=get.info(i); return info&&!get.is.locked(i)&&!info.limited&&!info.juexingji&&!info.zhuSkill&&!info.charlotte; }); - if(!skills.length&&target.isEmpty(2)) return 1; + if(!skills.length&&target.hasEmptySlot(2)) return 1; return -0.5*skills.length; }, }, @@ -6458,7 +6459,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, mod:{ targetInRange:function(card,player,target){ - if(player.countDisabled()>=5) return true; + for(var i=1;i<=5;i++){ + if(!player.hasDisabledSlot(i)) return false; + } + return true; }, }, marktext:'萍', @@ -6469,7 +6473,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'useCardAfter'}, filter:function(event,player){ return player!=event.player&&event.targets.contains(player)&& - player.countDisabled()<5&&!player.getStorage('fuping').contains(event.card.name); + player.hasEnabledSlot()&&!player.getStorage('fuping').contains(event.card.name); }, logTarget:'player', prompt2:(event)=>('废除一个装备栏并记录【'+get.translation(event.card.name)+'】'), @@ -6479,9 +6483,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(['nanman','wanjian'].contains(event.card.name)&&!player.hasValueTarget({name:event.card.name})) return false; var list=[3,5,4,1,2]; for(var i of list){ - if(!player.isDisabled(i)){ + if(player.hasEnabledSlot(i)){ var card=player.getEquip(i); - if(!card) return true; + if(!card||player.hasEmptySlot(i)) return true; if(get.value(card,player)<=0) return true; } } @@ -6493,9 +6497,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.chooseToDisable().set('ai',function(event,player,list){ var list=[3,5,4,1,2]; for(var i of list){ - if(!player.isDisabled(i)){ + if(player.hasEnabledSlot(i)){ var card=player.getEquip(i); - if(!card) return 'equip'+i; + if(!card||player.hasEmptySlot(i)) return 'equip'+i; if(get.value(card,player)<=0) return 'equip'+i; } } @@ -7273,14 +7277,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(num>=5) return false; var num2=0; for(var i=1;i<=5;i++){ - if(event.player.isEmpty(i)) num2++; + num2+=event.player.countEmptySlot(i); } return num{ if(button.link=='scs_gaowang') return 10; @@ -1492,6 +1491,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ wuxie:function(){ 'step 0' var trigger=event.getParent().getTrigger(); + if(!trigger.respondTo){event.finish();return;} var target=trigger.respondTo[0]; event.target=target; if(!target||!target.countGainableCards(player,player==target?'e':'he')) event._result={bool:false}; @@ -1704,7 +1704,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event._result={bool:false}; } else{ - trigger.player.chooseToDiscard(num,'弃置'+get.cnNumber(num)+'张手牌,或令杀的伤害+1').set('ai',function(card){ + trigger.player.chooseToDiscard(num,'弃置'+get.cnNumber(num)+'张手牌,或令'+get.translation(player)+'对你造成的此伤害+1').set('ai',function(card){ var player=_status.event.player; if(player.hp==1){ if(get.type(card)=='basic'){ @@ -3786,7 +3786,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var suit2=get.suit(i.card); if(!lib.suit.contains(suit2)) continue; if(i!=event&&suit2==suit) return false; - list.add(suit2); + if(i.finished) list.add(suit2); } return list.length>1&&list.length<5; }, @@ -3799,7 +3799,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(i.getParent('phaseUse')!=evt) continue; var suit2=get.suit(i.card); if(!lib.suit.contains(suit2)) continue; - list.add(suit2); + if(i.finished) list.add(suit2); } var prompt,filterTarget,ai; switch(list.length){ @@ -4110,7 +4110,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ { name:'ignotus', filename:'ignotus', - timeleap:[0,1412,2824,4235,5647,5824,7059,8294,8471,9882,10941,11294,12000,12706,13412,14118,14824,15529,15882,16059,16235,16412,16588], + //Number of tracks + //轨道数量 + number_of_tracks:4, + //Customize the track to generate for every note (0 is the first track) + //自定义每个音符生成的轨道(0是第一个轨道) + mapping:[0,2,3,1,1,0,3,0,0,3,0,0,2,1,2], + //Convert from beats (0 is the first beat) to timeleap + //将节拍(0是第一拍)转换为开始时间点 + timeleap:game.generateBeatmapTimeleap(170,[0,4,8,12,14,16,16.5,23.5,24,31,32,40,45,46,47]), current:-110, judgebar_height:0.16, range1:[84,110], @@ -4123,6 +4131,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ { name:'Super Mario 3D World Theme', filename:'sm3dw_overworld', + //Random (Randomly choose tracks to generate notes each play) + //随机(每次演奏时音符会随机选择轨道生成) + mapping:'random', timeleap:[0,1071,1518,2054,4018,4286,5357,6429,7500,8571,9643,10714,11786,12321,12589,12857,13929,15000,16071,17143,18214,18482,18750,19018,19286,20357], current:-110, judgebar_height:0.16, @@ -4133,6 +4144,67 @@ game.import('character',function(lib,game,ui,get,ai,_status){ node_color:'linear-gradient(rgba(120, 130, 240, 1), rgba(100, 100, 230, 1))', judgebar_color:'linear-gradient(rgba(230, 40, 30, 1), rgba(220, 30, 10, 1))', }, + { + name:'只因你太美', + filename:'chicken_you_are_so_beautiful', + number_of_tracks:7, + mapping:[3,6,4,5,6,2,3,2,1,2,0,4,3,6,5,4,3,6,3,2,3,1,0,1,2,3,4,5,6], + timeleap:game.generateBeatmapTimeleap(107,[2,3.5,4.5,5.5,6.5,8.5,10,11.5,12.5,13.5,14.5,15.5,18,19.5,20.5,21.5,22.5,24.5,26,27.5,28.5,29.5,30.5,31,31.5,32,32.5,33,33.5]), + //Hitsound file name (By default in the audio/effect folder. To redirect to the extension, please write in the format of 'ext:extension_name') + //打击音文件名(默认在audio/effect文件夹下 若要重定向到扩展 请写为'ext:扩展名称'的格式) + hitsound:'chickun.wav', + current:-110, + judgebar_height:0.16, + range1:[84,110], + range2:[90,104], + range3:[94,100], + speed:25, + node_color:'linear-gradient(#99f, #66c)', + judgebar_color:'linear-gradient(#ccf, #99c)', + }, + { + name:'Croatian Rhapsody', + filename:'croatian_rhapsody', + mapping:[4,1,2,1,0,0,4,5,1,3,2,1,0,0], + timeleap:game.generateBeatmapTimeleap(96,[4,6,8,9,10,11,12,13.5,14,15.5,16,17,18,19]), + current:-110, + judgebar_height:0.16, + range1:[84,110], + range2:[90,104], + range3:[94,100], + speed:25, + node_color:'linear-gradient(#fff, #ccc)', + judgebar_color:'linear-gradient(#fff, #ccc)', + }, + { + name:'罗刹海市', + filename:'rakshasa_sea_city', + number_of_tracks:7, + mapping:'random', + timeleap:game.generateBeatmapTimeleap(150,[0,2,4,6,7,9,11,13,14,16,18,20,21,23,25,27]), + current:-110, + judgebar_height:0.16, + range1:[84,110], + range2:[90,104], + range3:[94,100], + speed:25, + node_color:'linear-gradient(#333, #000)', + judgebar_color:'linear-gradient(#c66, #933)', + }, + { + name:'Pigstep (Stereo Mix)', + filename:'pigstep', + number_of_tracks:16, + timeleap:game.generateBeatmapTimeleap(170,[3,4,6,6.5,7.5,11,12,14,14.5,15.5,19,20,22,22.5,23.5,27,28,30,30.5,31.5,35,36,38,38.5,39.5,43,44,46,46.5,47.5,51,52,54,54.5,55.5,59,60,62,62.5]), + current:-110, + judgebar_height:0.16, + range1:[84,110], + range2:[90,104], + range3:[94,100], + speed:25, + node_color:'linear-gradient(#066, #033)', + judgebar_color:'linear-gradient(#633, #300)', + }, ], derivation:'chongxu_faq', }, @@ -4418,7 +4490,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ table.style.position='relative'; var list=['sha','shan']; for(var i of list){ - if(player.isDisabled(i)) continue; var td=ui.create.div('.shadowed.reduce_radius.pointerdiv.tdnode'); td.innerHTML=''+get.translation(i)+''; td.link=i; @@ -6165,12 +6236,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ speed=-4; } }; - document.addEventListener(lib.config.touchscreen?'touchend':'click',fly); + document.addEventListener(lib.config.touchscreen?'touchstart':'mousedown',fly); event.settle=function(){ clearInterval(event.fly); clearInterval(event.addPipe); - document.removeEventListener(lib.config.touchscreen?'touchend':'click',fly); + document.removeEventListener(lib.config.touchscreen?'touchstart':'mousedown',fly); setTimeout(function(){ event.switchToAuto() },1000); @@ -6433,17 +6504,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ var source=event.source; if(!source) return false; - var card=source.getEquip(1); - return card&&get.itemtype(card)=='card'&&lib.filter.canBeGained(card,player,source); + var cards=source.getEquips(1); + return cards.length&&cards.some(card=>lib.filter.canBeGained(card,player,source)); }, prompt2:function(event){ - return '获得其装备区中的'+get.translation(event.source.getEquip(1)); + var source=event.source; + var cards=source.getEquips(1).filter(card=>lib.filter.canBeGained(card,player,source)); + return '获得其装备区中的'+get.translation(cards); }, check:function(event,player){ return (get.attitude(player,event.source)+0.1)*get.value(event.source.getEquip(1),event.source); }, content:function(){ - player.gain(trigger.source.getEquip(1),trigger.source,'give','bySelf'); + var source=trigger.source; + var cards=source.getEquips(1).filter(card=>lib.filter.canBeGained(card,player,source)); + player.gain(cards,source,'give','bySelf'); }, }, xinanjian:{ @@ -8269,7 +8344,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(event.zhengjing.length){ var card=ui.create.card(ui.special,'noclick',true); card.init(['','',event.zhengjing.shift()]); - card.addEventListener(lib.config.touchscreen?'touchend':'click',click); + card.addEventListener(lib.config.touchscreen?'touchstart':'mousedown',click); event.zhengjing_nodes.push(card); card.style.position='absolute'; var rand1=Math.round(Math.random()*100); @@ -9395,14 +9470,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, mod:{ cardUsable:function(card,player,num){ - var cardx=player.getEquip('rewrite_zhuge'); - if(card.name=='sha'&&(!cardx||player.hasSkill('rw_zhuge_skill',null,false)||(!_status.rw_zhuge_temp&&!ui.selected.cards.contains(cardx)))){ - return Infinity; + var cards=player.getEquips('rewrite_zhuge') + if(card.name=='sha'){ + if(!cards.length||player.hasSkill('rw_zhuge_skill',null,false)||cards.some(card=>(card!=_status.rw_zhuge_temp&&!ui.selected.cards.contains(card)))){ + if(get.is.versus()||get.is.changban()){ + return num+3; + } + return Infinity; + } } }, cardEnabled2:function(card,player){ if(!_status.event.addCount_extra||player.hasSkill('rw_zhuge_skill',null,false)) return; - if(card&&card==player.getEquip('rewrite_zhuge')){ + var cards=player.getEquips('rewrite_zhuge'); + if(card&&cards.contains(card)){ try{ var cardz=get.card(); } @@ -9410,7 +9491,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return; } if(!cardz||cardz.name!='sha') return; - _status.rw_zhuge_temp=true; + _status.rw_zhuge_temp=card; var bool=lib.filter.cardUsable(get.autoViewAs({name:'sha'},ui.selected.cards.concat([card])),player); delete _status.rw_zhuge_temp; if(!bool) return false; @@ -10324,11 +10405,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' game.delay(0.5); - if(targets[0].isDisabled(1)) event.goto(2); + if(!targets[0].hasEquipableSlot(1)) event.goto(2); 'step 1' var target=targets[0]; var equip1=get.cardPile2(function(card){ - return get.subtype(card)=='equip1'; + return get.subtype(card)=='equip1'&&target.canUse(card,target); }); if(!equip1){ player.popup('连计失败'); @@ -11151,99 +11232,101 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var next=player.chooseTarget(2,function(card,player,target){ if(ui.selected.targets.length){ if(!_status.event.ingame){ - return target.isEmpty(2)?true:false; + var cards=ui.selected.targets[0].getEquips(2); + return cards.some(card=>target.canEquip(card)) } var from=ui.selected.targets[0]; if(target.isMin()) return false; var es=from.getCards('e'); - for(var i=0;i1) continue; - if(target.isEmpty(get.subtype(es[i]))) return true; - } + for(var i=0;i0; - } - }); - next.set('ingame',event.ingame) - next.set('ai',function(target){ - var player=_status.event.player; - var att=get.attitude(player,target); - if(ui.selected.targets.length==0){ - if(att<0){ - if(game.hasPlayer(function(current){ - if(get.attitude(player,current)>0){ - var es=target.getCards('e'); - for(var i=0;i1) continue; - else if(current.isEmpty(get.subtype(es[i]))) return true; - } - return false; - } - })) return -att; - } - return 0; - } - if(att>0){ - var es=ui.selected.targets[0].getCards('e'); - var i; - for(i=0;i1) continue; - if(target.isEmpty(get.subtype(es[i]))) break; - } - if(i==es.length) return 0; - } - return -att*get.attitude(player,ui.selected.targets[0]); - }); - next.set('multitarget',true); - next.set('targetprompt',['被移走','移动目标']); - next.set('prompt',prompt); - 'step 1' - if(result.bool){ - player.line2(result.targets,'green'); - event.targets=result.targets; + return target.countCards('e')>0; } - else event.finish(); - 'step 2' - game.delay(); - 'step 3' - if(targets.length==2){ - if(!event.ingame){ - event._result={ - bool:true, - links:[targets[0].getEquip(2)], - }; + }); + next.set('ingame',event.ingame) + next.set('ai',function(target){ + var player=_status.event.player; + var att=get.attitude(player,target); + if(ui.selected.targets.length==0){ + if(att<0){ + if(game.hasPlayer(function(current){ + if(get.attitude(player,current)>0){ + var es=target.getCards('e'); + for(var i=0;i0){ + var es=ui.selected.targets[0].getCards('e'); + var i; + for(i=0;i1) return false; - return !targets1.countCards('e',{subtype:get.subtype(button.link)}); - + return targets1.canEquip(button.link); }); - } - } - else event.finish(); - 'step 4' - if(result.bool&&result.links.length){ - var link=result.links[0]; - if(get.position(link)=='e') event.targets[1].equip(link); - else if(link.viewAs) event.targets[1].addJudge({name:link.viewAs},[link]); - else event.targets[1].addJudge(link); - event.targets[0].$give(link,event.targets[1],false) - game.delay(); } + } + else event.finish(); + 'step 4' + if(result.bool&&result.links.length){ + var link=result.links[0]; + if(get.position(link)=='e') event.targets[1].equip(link); + else if(link.viewAs) event.targets[1].addJudge({name:link.viewAs},[link]); + else event.targets[1].addJudge(link); + event.targets[0].$give(link,event.targets[1],false) + game.delay(); + } }, audio:true, enable:"phaseUse", @@ -12333,7 +12416,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'damageEnd'}, forced:true, filter:function(event,player){ - return !player.getEquip('ly_piliche'); + return !player.getEquips('ly_piliche').length; }, content:function(){ 'step 0' @@ -12347,7 +12430,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); if(card) player.chooseUseTarget(card,true,'nopopup'); 'step 3' - if(event.count>0&&!player.getEquip('ly_piliche')) event.goto(1); + if(event.count>0&&!player.getEquips('ly_piliche').length) event.goto(1); }, }, }, @@ -12440,7 +12523,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(target.isMin()) return false; var es=from.getCards('e'); for(var i=0;i0) return 9; } @@ -12473,7 +12556,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(current!=target&&get.attitude(player,current)>0){ var es=target.getCards('e'); for(var i=0;i0&¤t.isEmpty(get.subtype(es[i]))&&get.value(es[i],current)>0) return true; + if(get.value(es[i],target)>0&¤t.canEquip(es[i])&&get.value(es[i],current)>0) return true; } } })){ @@ -12489,7 +12572,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(sgnatt!=0&&att2!=0&& get.sgn(get.value(es[i],ui.selected.targets[0]))==-att2&& get.sgn(get.value(es[i],target))==sgnatt&& - target.isEmpty(get.subtype(es[i]))){ + target.canEquip(es[i])){ return Math.abs(att); } } @@ -12538,7 +12621,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return targets1.canAddJudge(button.link); } else{ - return targets1.isEmpty(get.subtype(button.link)); + return targets1.canEquip(button.link); } }); } @@ -13427,7 +13510,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ chongxu:'冲虚', chongxu_info:'出牌阶段限一次,你可以随机演奏一首音乐,并根据完成度来获得相应的分数(至多五分)。然后你可修改〖妙剑〗或〖莲华〗(消耗3分),并使用剩余的分数进行摸牌(每张2分)。', chongxu_faq:'目前的曲库', - chongxu_faq_info:' 
《鸟之诗》- 折户伸治
《竹取飛翔 ~ Lunatic Princess》- ZUN
《ignotus》- ak+q
《Super Mario 3D World Theme》- 横田真人', + chongxu_faq_info:' 
《鸟之诗》- 折户伸治
《竹取飛翔 ~ Lunatic Princess》- ZUN
《ignotus》- ak+q
《Super Mario 3D World Theme》- 横田真人
《只因你太美》- SWIN-S
《Croatian Rhapsody》- Maksim
《罗刹海市》- 刀郎
《Pigstep (Stereo Mix)》- Lena Raine', miaojian:'妙剑', miaojian_info:'出牌阶段限一次。你可将一张【杀】当做刺【杀】使用,或将一张锦囊牌当做【无中生有】使用。', miaojian1:'妙剑·改', @@ -13453,7 +13536,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ spqishe_info:'你可以将一张装备牌当做【酒】使用。你的手牌上限+X(X为你装备区内的牌数)。', sp_maojie:'毛玠', bingqing:'秉清', - bingqing_info:'当你于出牌阶段内使用的牌结算结束后,若你于本阶段内使用的所有其他牌与此牌花色均不相同,则你可根据X的值执行对应效果:为2,你令一名角色摸两张牌;为3,你弃置一名角色区域内的一张牌;为4,你对一名其他角色造成1点伤害。(X为你本阶段内使用过的牌中包含的花色数)', + bingqing_info:'当你于出牌阶段内使用的牌结算结束后,若你于本阶段内使用的所有已结算结束的其他牌与此牌花色均不相同,则你可根据X的值执行对应效果:为2,你令一名角色摸两张牌;为3,你弃置一名角色区域内的一张牌;为4,你对一名其他角色造成1点伤害。(X为你本阶段内使用过的已结算结束的牌中包含的花色数)', yingfeng:'迎奉', yingfeng_info:'准备阶段,你可以令一名角色获得“奉”标记并移除场上所有其他的“奉”标记。有“奉”标记的角色使用牌没有距离限制。', xin_sunxiu:'手杀孙休', diff --git a/character/offline.js b/character/offline.js index 81b804dc6..e97962f43 100644 --- a/character/offline.js +++ b/character/offline.js @@ -1577,10 +1577,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, locked:false, getNum:function(target,player){ - return target.countCards('e',card=>{ - var subtype=get.subtype(card); - return player.isDisabled(subtype); - }) + return target.countCards(card=>{ + var subtype=get.subtypes(card); + for(var i of subtype){ + if(player.hasDisabledSlot(i)) return true; + } + return false; + }); }, group:'jsrgjuezhi_disable', content:function(){ @@ -1603,19 +1606,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' event.cards=trigger.getl(player).es; 'step 1' - var card=cards.shift(),subtype=get.subtype(card); - event.subtype=subtype; - if(!player.isDisabled(subtype)){ - player.chooseBool(get.prompt('jsrgjuezhi_disable'),'废除你的'+get.translation(subtype)+'栏').set('ai',()=>1); + var card=cards.shift(),subtypes=get.subtypes(card).filter(slot=>player.hasEnabledSlot(slot)); + event.subtypes=subtypes; + if(subtypes.length>0){ + player.chooseBool(get.prompt('jsrgjuezhi_disable'),'废除你的'+get.translation(subtypes)+'栏').set('ai',()=>1); } else event._result={bool:false}; 'step 2' if(result.bool){ player.logSkill('jsrgjuezhi_disable'); - var list=[]; - if(event.subtype=='equip6') list.addArray(['3','4']); - else list.add(event.subtype); - for(var i of list) player.disableEquip(i); + player.disableEquip(event.subtypes); } if(cards.length>0) event.goto(1); }, @@ -1666,7 +1666,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(current.isMin()) return false; var es=target.getCards('e'); for(var i=0;i=target.countCards('h')&&target.isEmpty(2)) return false; + if((card.name=='juedou'||card.name=='sha'||card.name=='huogong')&&player!=target&&player.countCards('h')>=target.countCards('h')&&target.hasEmptySlot(2)) return false; }, }, }, diff --git a/character/rank.js b/character/rank.js index 419ff5718..d74424ff4 100644 --- a/character/rank.js +++ b/character/rank.js @@ -301,6 +301,8 @@ window.noname_character_rank={ 'duanqiaoxiao', 'old_wanglang', 'shichangshi', + 'ol_wenqin', + 'clan_zhonghui', 'key_misuzu', 'key_sunohara', 'key_umi', @@ -584,6 +586,7 @@ window.noname_character_rank={ 'yuantanyuanxiyuanshang', 'yanghong', 'dc_sunhanhua', + 'shen_dianwei', ], bp:[ 'chess_diaochan', @@ -1223,6 +1226,9 @@ window.noname_character_rank={ 'clan_zhongyan', 'sb_zhurong', 'haopu', + 'xizheng', + 'dc_duyu', + 'clan_wanghun', ], bm:[ 'diy_xizhenxihong', @@ -1663,6 +1669,7 @@ window.noname_character_rank={ 'wu_zhugeliang', 'yue_caiwenji', 'clan_zhongyan', + 'shen_dianwei', 'key_tomoya', 'key_masato', 'key_shiorimiyuki', @@ -1902,6 +1909,7 @@ window.noname_character_rank={ 'dc_wangjun', 'zhanghua', 'lushi', + 'clan_zhonghui', 'key_kano', 'key_haruko', 'key_akiko', @@ -2386,6 +2394,8 @@ window.noname_character_rank={ 'clan_wangling', 'clan_wangyun', 'quhuang', + 'ol_wenqin', + 'clan_wanghun', ], junk:[ 'sunshao', diff --git a/character/refresh.js b/character/refresh.js index 4d1e8b8b7..3a6e80df1 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -381,30 +381,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){ relinglong:{ audio:2, trigger:{ - player:'loseAfter', + player:['loseAfter','disableEquipAfter','enableEquipAfter'], global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter','phaseBefore'], }, forced:true, onremove:true, derivation:'reqicai', filter:function(event,player){ - if(event.name!='phase'&&(event.name!='equip'||event.player!=player)){ + if(event.name=='disableEquip'||event.name=='enableEquip'){ + if(!event.slots.contains('equip5')) return false; + } + else if(event.name!='phase'&&(event.name!='equip'||event.player!=player)){ var evt=event.getl(player); - if(!evt||!evt.es||!evt.es.some(i=>get.subtype(i)=='equip5')) return false; + if(!evt||!evt.es||!evt.es.some(i=>get.subtypes(i).contains('equip5'))) return false; } var skills=player.additionalSkills['relinglong']; - return skills&&skills.length&&player.getEquip(5)||!(skills&&skills.length)&&!player.getEquip(5); + return (skills&&skills.length>0)!=player.hasEmptySlot(5); }, content:function(){ player.removeAdditionalSkill('relinglong'); - if(!player.getEquip(5)){ + if(player.hasEmptySlot(5)){ player.addAdditionalSkill('relinglong',['reqicai']); } }, group:['linglong_bagua','relinglong_directhit'], mod:{ maxHandcard:function(player,num){ - if(player.getEquip(3)||player.getEquip(4)||player.getEquip(6)) return; + if(!player.hasEmptySlot(3)||!player.hasEmptySlot(4)) return; return num+2; }, }, @@ -415,8 +418,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, filter:function(event,player){ if(event.card.name!='sha'&&get.type(event.card,false)!='trick') return false; - for(var i=2;i<=6;i++){ - if(player.getEquip(i)) return false; + for(var i=2;i<6;i++){ + if(!player.hasEmptySlot(i)) return false; } return true; }, @@ -428,8 +431,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ directHit_ai:true, skillTagFilter:function(player,tag,arg){ if(!arg||!arg.card||!arg.target||(arg.card.name!='sha'&&get.type(arg.card,false)!='trick')) return false; - for(var i=2;i<=6;i++){ - if(player.getEquip(i)) return false; + for(var i=2;i<6;i++){ + if(!player.hasEmptySlot(i)) return false; } return true; }, @@ -969,7 +972,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{source:'damageSource'}, forced:true, filter:function(event,player){ - return event.player.isIn()&&event.card&&event.card.name=='sha'&&event.cards.filterInD('od').length&&event.notLink()&&[2,3,4,6].some(i=>event.player.getEquip(i)); + return event.player.isIn()&&event.card&&event.card.name=='sha'&&event.cards.filterInD('od').length&& + event.notLink()&&[2,3,4].some(i=>event.player.getEquips(i).length>0); }, group:'remoshi_retrieve', content:function(){ @@ -983,23 +987,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){ global:['loseAfter','equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'], }, filter:function(event,player){ + var keys=['equip2','equip3','equip4']; return game.hasPlayer(current=>{ if(event.name=='gain'&¤t==player) return false; var cards=current.getExpansions('remoshi_stuck'); if(!cards.length) return false; var evt=event.getl(current); - if(evt&&evt.cards2&&evt.cards2.some(i=>['equip2','equip3','equip4','equip6'].contains(get.subtype(i)))) return true; + if(evt&&evt.cards2&&evt.cards2.some(i=>get.subtypes(i).some(slot=>keys.contains(slot)))) return true; }); }, direct:true, forced:true, content:function(){ 'step 0' + var keys=['equip2','equip3','equip4']; var targets=game.filterPlayer(current=>{ var cards=current.getExpansions('remoshi_stuck'); if(!cards.length) return false; var evt=trigger.getl(current); - if(evt&&evt.cards2&&evt.cards2.some(i=>['equip2','equip3','equip4','equip6'].contains(get.subtype(i)))) return true; + if(evt&&evt.cards2&&evt.cards2.some(i=>get.subtypes(i).some(slot=>keys.contains(slot)))) return true; }); event.targets=targets; 'step 1' @@ -3057,7 +3063,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(get.sgn(get.value(es[i],current))!=-att||get.value(es[i],current)<5) return false; var att2=get.sgn(get.attitude(player,current2)); if(att==att2||att2!=get.sgn(get.effect(current2,es[i],player,current2))) return false; - return current!=current2&&!current2.isMin()&¤t2.isEmpty(get.subtype(es[i])); + return current!=current2&&!current2.isMin()&¤t2.canEquip(es[i]); })){ return true; } @@ -5083,7 +5089,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!target.getHistory('sourceDamage').length){ var cards=target.getCards('e'); for(var i of cards){ - if(player.isEmpty(get.subtype(i))) return true; + if(player.canEquip(i)) return true; } } return target.getHistory('useCard',function(evt){ @@ -5102,7 +5108,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!target.getHistory('sourceDamage').length){ var cards=target.getCards('e'); for(var i of cards){ - if(player.isEmpty(get.subtype(i))) list.push(i); + if(player.canEquip(i)) list.push(i); } } if(list.length){ @@ -6735,7 +6741,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); for(var i=0;i0) return 18; return 7; @@ -6787,7 +6793,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else if(att>0){ if(target.countCards('e',function(card){ return get.value(card,target)<0&&!_status.event.cards.contains(card)&&game.hasPlayer(function(current){ - return current!=target&¤t.isEmpty(get.subtype(card))&&get.effect(current,card,player,player)<0; + return current!=target&¤t.canEquip(card)&&get.effect(current,card,player,player)<0; }); })>0) return 9; } @@ -6798,7 +6804,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return !_status.event.cards.contains(card); }); for(var i=0;i0&¤t.isEmpty(get.subtype(es[i]))&&get.effect(current,es[i],player,current)>0) return true; + if(get.value(es[i],target)>0&¤t.canEquip(card)&&get.effect(current,es[i],player,current)>0) return true; } } })){ @@ -6818,7 +6824,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return get.attitude(player,current)<0&¤t.countDiscardableCards(player,'he')>0&&get.damageEffect(current,player,player)>0; }); if(bool&&player.countCards('e',function(card){ - return !_status.event.cards.contains(card)&&target.isEmpty(get.subtype(card))&&get.effect(target,card,player,player)>0; + return !_status.event.cards.contains(card)&&target.canEquip(card)&&get.effect(target,card,player,player)>0; })) return 2.5*Math.abs(att); else if(bool) return 1/Math.max(1,Math.abs(att)); else return get.damageEffect(target,player,player); @@ -6826,7 +6832,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(sgnatt!=0&&att2!=0&&sgnatt!=att2&& get.sgn(get.value(es[i],ui.selected.targets[0]))==-att2&& get.sgn(get.effect(target,es[i],player,target))==sgnatt&& - target.isEmpty(get.subtype(es[i]))){ + target.canEquip(es[i])){ return Math.abs(att); } } @@ -6865,7 +6871,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ },targets[0]).set('nojudge',event.nojudge||false).set('targets0',targets[0]).set('targets1',targets[1]).set('filterButton',function(button){ if(_status.event.cards.contains(button.link)) return false; var targets1=_status.event.targets1; - return targets1.isEmpty(get.subtype(button.link)); + return targets1.canEquip(button.link); }).set('cards',cards); } else{ @@ -6900,7 +6906,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }; for(var i=0;i0&&!target.hasSkillTag('noe')) return 0; var num=0; target.countCards('e',function(card){ - if(player.isEmpty(get.subtype(card))){ + if(player.canEquip(card)){ var eff=get.effect(player,card,player,player); if(eff>num) num=eff; } @@ -7594,7 +7600,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.target=target; player.logSkill('rezishou',target); player.choosePlayerCard(target,'e','将一张装备牌移至你的装备区').set('filterButton',function(button){ - return _status.event.player.isEmpty(get.subtype(button.link)); + return _status.event.player.canEquip(button.link); }); } else event.finish(); @@ -7915,7 +7921,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ regongji:{ mod:{ attackRangeBase:function(player){ - if(player.getEquip(3)||player.getEquip(4)||player.getEquip(6)) return Infinity; + if(player.getEquips(3).length>0||player.getEquips(4).length>0) return Infinity; }, }, enable:'phaseUse', @@ -8325,7 +8331,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(target.isMin()) return false; var es=from.getCards('e'); for(var i=0;i0){ if(target.countCards('e',function(card){ return get.value(card,target)<0&&game.hasPlayer(function(current){ - return current!=player&¤t!=target&&get.attitude(player,current)<0&¤t.isEmpty(get.subtype(card))&&get.effect(current,card,player,player)>0; + return current!=player&¤t!=target&&get.attitude(player,current)<0&¤t.canEquip(card)&&get.effect(current,card,player,player)>0; }); })>0) return 9; } @@ -8350,7 +8356,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(current!=target&¤t!=player&&get.attitude(player,current)>0){ var es=target.getCards('e'); for(var i=0;i0&¤t.isEmpty(get.subtype(es[i]))&&get.effect(current,es[i],player,player)>0) return true; + if(get.value(es[i],target)>0&¤t.canEquip(es[i])&&get.effect(current,es[i],player,player)>0) return true; } } })){ @@ -8366,7 +8372,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(sgnatt!=0&&att2!=0&&sgnatt!=att2&& get.sgn(get.value(es[i],ui.selected.targets[0]))==-att2&& get.sgn(get.value(es[i],target))==sgnatt&& - target.isEmpty(get.subtype(es[i]))){ + target.canEquip(es[i])){ return Math.abs(att); } } @@ -8404,7 +8410,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } },targets[0]).set('targets0',targets[0]).set('targets1',targets[1]).set('filterButton',function(button){ var targets1=_status.event.targets1; - return targets1.isEmpty(get.subtype(button.link)); + return targets1.canEquip(button.link); }); } else{ @@ -8433,7 +8439,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var att2=get.sgn(get.attitude(player,current2)); if(att==att2||att2!=get.sgn(get.value(es[i],current2))) return false; } - return current!=current2&&!current2.isMin()&¤t2.isEmpty(get.subtype(es[i])); + return current!=current2&&!current2.isMin()&¤t2.canEquip(es[i]); })){ return true; } @@ -9858,7 +9864,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else if(event.isMine()){ func(event.videoId); } - event._result={control:'弃置化身'}; + event._result={control:'更换技能'}; event.goto(1); return; } @@ -11709,7 +11715,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!target.hasSex('male')) return false; var card=ui.selected.cards[0]; if(!card) return false; - if(get.position(card)=='e'&&!target.isEmpty(get.subtype(card))) return false; + if(get.position(card)=='e'&&!target.canEquip(card)) return false; return true; }, discard:false, @@ -11718,7 +11724,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' if(get.position(cards[0])=='e') event._result={index:0}; - else if(get.type(cards[0])!='equip'||!target.isEmpty(get.subtype(cards[0]))) event._result={index:1}; + else if(get.type(cards[0])!='equip'||!target.canEquip(cards[0])) event._result={index:1}; else player.chooseControl().set('choiceList',[ '将'+get.translation(cards[0])+'置入'+get.translation(target)+'的装备区', '弃置'+get.translation(cards[0]), @@ -14660,7 +14666,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ rejiqiao:'机巧', rejiqiao_info:'出牌阶段开始时,你可以弃置任意张牌,然后亮出牌堆顶X张牌(X为你以此法弃置的牌数与其中装备牌数之和),你获得其中所有非装备牌。', relinglong:'玲珑', - relinglong_info:'锁定技。若你的装备区:没有防具牌,视为你装备【八卦阵】;没有坐骑牌,你的手牌上限+2;没有宝物牌,你视为拥有〖奇才〗;以上均满足:你使用的【杀】或普通锦囊牌不可被响应。', + relinglong_info:'锁定技。若你的装备区:有空置的防具栏,你视为拥有〖八卦阵〗;有空置的两种坐骑栏,你的手牌上限+2;有空置的宝物栏,你视为拥有〖奇才〗;以上均满足:你使用的【杀】或普通锦囊牌不可被响应。', ol_zhangzhang:'界张昭张纮', olzhijian:'直谏', olzhijian_info:'出牌阶段,你可以将一张装备牌置于其他角色的装备区(可替换原装备),然后摸一张牌。', diff --git a/character/sb.js b/character/sb.js index 580b1e303..c6b4800d6 100644 --- a/character/sb.js +++ b/character/sb.js @@ -2016,7 +2016,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(card.name=='sha') return Infinity; }, targetInRange:function(card,player,target){ - if(card.name=='sha'&&player.getEquip(1)) return true; + if(card.name=='sha'&&player.getEquips(1).length>0) return true; }, }, trigger:{player:'useCard'}, @@ -4088,9 +4088,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sbliegong:{ audio:2, mod:{ - cardnature:function(card,player){ - if(!player.getEquip(1)&&get.name(card,player)=='sha') return false; - }, + cardnature:function(card,player){ + if(player.hasEmptySlot(1)&&get.name(card,player)=='sha') return false; + }, }, trigger:{player:'useCardToPlayered'}, filter:function(event,player){ diff --git a/character/shenhua.js b/character/shenhua.js index 6553eed05..ba401a4f4 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -1000,7 +1000,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.storage.disableEquip!=undefined&&player.storage.disableEquip.length<5; + return player.hasEnabledSlot(1)||player.hasEnabledSlot(2)||player.hasEnabledSlot(5)||player.hasEnabledSlot('horse'); }, content:function(){ 'step 0' @@ -1032,11 +1032,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ order:13, result:{ player:function(player){ - if(!player.isDisabled('equip2')) return 1; - if(!player.isDisabled('equip1')&&(player.countCards('h',function(card){ + if(player.hasEnabledSlot('equip2')) return 1; + if(player.hasEnabledSlot('equip1')&&(player.countCards('h',function(card){ return get.name(card,player)=='sha'&&player.hasValueTarget(card); })-player.getCardUsable('sha'))>1) return 1; - if(!player.isDisabled('equip5')&&player.countCards('h',function(card){ + if(player.hasEnabledSlot('equip5')&&player.countCards('h',function(card){ return get.type2(card,player)=='trick'&&player.hasUseTarget(card); })>1) return 1; return -1; @@ -1114,7 +1114,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return get.type(card)=='equip'; }, check:function(card){ - if(_status.event.player.isDisabled(get.subtype(card))) return 5; + if(!_status.event.player.canEquip(card)) return 5; return 3-get.value(card); }, content:function(){ @@ -1268,24 +1268,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){ skillAnimation:true, animationColor:'gray', limited:true, - init:function(player){ - player.storage.drlt_xiongluan=false; - }, filter:function(event,player){ - if(player.storage.drlt_xiongluan) return false; - return true; + return !player.isDisabledJudge()||player.hasEnabledSlot(); }, filterTarget:function(card,player,target){ return target!=player; }, content:function(){ player.awakenSkill('drlt_xiongluan'); - player.storage.drlt_xiongluan=true; - player.disableEquip('equip1'); - player.disableEquip('equip2'); - player.disableEquip('equip3'); - player.disableEquip('equip4'); - player.disableEquip('equip5'); + var disables=[]; + for(var i=1;i<=5;i++){ + for(var j=0;j0) player.disableEquip(disables); player.disableJudge(); player.addTempSkill('drlt_xiongluan1'); player.storage.drlt_xiongluan1=target; @@ -2584,11 +2581,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).set('filterCard',lib.filter.cardDiscardable); 'step 2' if(result.bool&&result.cards.length){ - if(get.type(result.cards[0])=='equip'&&!player.isDisabled(get.subtype(result.cards[0]))){ - player.chooseUseTarget(result.cards[0],true,'nopopup'); + var card=result.cards[0]; + if(get.type(card)=='equip'&&player.hasUseTarget(card)){ + player.chooseUseTarget(card,true,'nopopup'); } else{ - player.discard(result.cards[0]); + player.discard(card); } } }, @@ -3979,8 +3977,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filterTarget:function(card,player,target){ if(target.isMin()) return false; - var type=get.subtype(card); - return player!=target&&target.isEmpty(type); + return player!=target&&target.canEquip(card); }, content:function(){ target.equip(cards[0]); @@ -5421,7 +5418,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ inherit:'bagua_skill', filter:function(event,player){ if(!lib.skill.bagua_skill.filter(event,player)) return false; - if(!player.isEmpty(2)) return false; + if(!player.hasEmptySlot(2)) return false; return true; }, ai:{ @@ -5431,7 +5428,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(player==target&&get.subtype(card)=='equip2'){ if(get.equipValue(card)<=7.5) return 0; } - if(!target.isEmpty(2)) return; + if(!target.hasEmptySlot(2)) return; return lib.skill.bagua_skill.ai.effect.target.apply(this,arguments); } } diff --git a/character/shiji.js b/character/shiji.js index 7b5e48219..1f933e32f 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -242,87 +242,158 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, houfeng:{ audio:3, - trigger:{global:'phaseUseBegin'}, - logTarget:'player', - round:1, - filter:(event,player)=>player.inRange(event.player), - check:function(event,player){ - var att=get.attitude(player,event.player); - return att>0; - }, - content:function(){ - 'step 0' - player.chooseButton(['选择'+get.translation(trigger.player)+'要进行的整肃类型',[['zhengsu_leijin','zhengsu_bianzhen','zhengsu_mingzhi'],'vcard']],true).set('ai',()=>Math.random()); - 'step 1' - if(result.bool){ - var name=result.links[0][2],target=trigger.player; - target.addTempSkill('zhengsu',{player:['phaseDiscardAfter','phaseAfter']}); - target.addTempSkill(name,{player:['phaseDiscardAfter','phaseAfter']}); - target.popup(name,'thunder'); - player.addTempSkill('houfeng_share'); - game.delayx(); - } - }, + group:'houfeng_zhengsu', subSkill:{ + zhengsu:{ + audio:'houfeng1', + trigger:{global:'phaseUseBegin'}, + filter:function(event,player){ + if(!['zhengsu_leijin','zhengsu_bianzhen','zhengsu_mingzhi'].some(i=>!event.player.hasSkill(i))) return false; + return player.inRange(event.player); + }, + check:function(event,player){ + return get.attitude(player,event.player)>0; + }, + prompt2:()=>lib.translate.houfeng_info, + round:1, + logTarget:'player', + content:function(){ + 'step 0' + player.chooseButton(['选择'+get.translation(trigger.player)+'要进行的整肃类型',[['zhengsu_leijin','zhengsu_bianzhen','zhengsu_mingzhi'].filter(i=>!trigger.player.hasSkill(i)),'vcard']],true).set('ai',()=>Math.random()); + 'step 1' + if(result.bool){ + var name=result.links[0][2],target=trigger.player; + target.addTempSkill('houfeng_share',{player:['phaseDiscardAfter','phaseAfter']}); + target.markAuto('houfeng_share',[player]); + target.addTempSkill(name,{player:['phaseDiscardAfter','phaseAfter']}); + target.popup(name,'thunder'); + game.delayx(); + } + }, + }, share:{ - trigger:{global:['drawAfter','recoverAfter']}, + charlotte:true, + onremove:true, + trigger:{player:'phaseDiscardEnd'}, forced:true, popup:false, - charlotte:true, - filter:function(event,player){ - return event.getParent(2).name=='zhengsu'; - }, content:function(){ - player.chooseDrawRecover(2,true); + 'step 0' + if(!lib.skill.zhengsu.filter(trigger,player)){ + game.broadcastAll(function(){ + if(lib.config.background_speak) game.playAudio('skill','houfeng3'); + }); + player.popup('整肃失败','fire'); + game.log(player,'整肃失败'); + event.finish(); + return; + } + game.broadcastAll(function(){ + if(lib.config.background_speak) game.playAudio('skill','houfeng2'); + }); + player.popup('整肃成功','wood'); + game.log(player,'整肃成功'); + var list=player.getStorage('houfeng_share').filter(i=>i.isIn()); + list.unshift(player); + event.list=list; + var num1=0,num2=0,num3=0; + for(var target of list){ + num1+=get.effect(target,{name:'wuzhong'},player,player); + num2+=get.recoverEffect(target,player,player); + } + trigger.player.chooseControl('摸两张牌','回复体力','cancel2').set('prompt','整肃奖励:请选择'+get.translation(list)+'的整肃奖励').set('ai',function(){ + return ['摸两张牌','回复体力','cancel2'][_status.event.goon.indexOf(Math.max.apply(Math,_status.event.goon))]; + }).set('goon',[num1,num2,num3]); + 'step 1' + if(result.control!='cancel2'){ + if(result.control=='摸两张牌') game.asyncDraw(event.list,2); + else{ + for(var i of event.list) i.recover(); + } + } + else event.finish(); + 'step 2' + game.delayx(); }, }, }, }, + houfeng1:{audio:true}, //手杀皇甫嵩 spzhengjun:{ audio:3, - trigger:{player:'phaseUseBegin'}, - direct:true, - filter:function(event,player){ - return !player.hasSkill('zhengsu'); - }, - content:function(){ - 'step 0' - player.chooseButton([get.prompt('spzhengjun'),[['zhengsu_leijin','zhengsu_bianzhen','zhengsu_mingzhi'],'vcard']]).set('ai',()=>Math.random()); - 'step 1' - if(result.bool){ - player.logSkill('spzhengjun',player); - var name=result.links[0][2]; - player.addTempSkill('zhengsu',{player:['phaseDiscardAfter','phaseAfter']}); - player.addTempSkill(name,{player:['phaseDiscardAfter','phaseAfter']}); - player.popup(name,'thunder'); - game.delayx(); - } - }, - group:'spzhengjun_share', + group:'spzhengjun_zhengsu', subSkill:{ - share:{ - trigger:{player:['drawAfter','recoverAfter']}, - direct:true, + zhengsu:{ + audio:'spzhengjun1', + trigger:{player:'phaseUseBegin'}, filter:function(event,player){ - return event.getParent(2).name=='zhengsu'; + return ['zhengsu_leijin','zhengsu_bianzhen','zhengsu_mingzhi'].some(i=>!player.hasSkill(i)); }, + direct:true, content:function(){ 'step 0' + player.chooseButton([get.prompt('spzhengjun'),[['zhengsu_leijin','zhengsu_bianzhen','zhengsu_mingzhi'].filter(i=>!player.hasSkill(i)),'vcard']]).set('ai',()=>Math.random()); + 'step 1' + if(result.bool){ + player.logSkill('spzhengjun_zhengsu',player); + var name=result.links[0][2]; + player.addTempSkill('spzhengjun_share',{player:['phaseDiscardAfter','phaseAfter']}); + player.addTempSkill(name,{player:['phaseDiscardAfter','phaseAfter']}); + player.popup(name,'thunder'); + game.delayx(); + } + }, + }, + share:{ + charlotte:true, + trigger:{player:'phaseDiscardEnd'}, + forced:true, + popup:false, + content:function(){ + 'step 0' + if(!lib.skill.zhengsu.filter(trigger,player)){ + game.broadcastAll(function(){ + if(lib.config.background_speak) game.playAudio('skill','spzhengjun3'); + }); + player.popup('整肃失败','fire'); + game.log(player,'整肃失败'); + event.finish(); + return; + } + game.broadcastAll(function(){ + if(lib.config.background_speak) game.playAudio('skill','spzhengjun2'); + }); + player.popup('整肃成功','wood'); + game.log(player,'整肃成功'); + player.chooseDrawRecover(2,'整肃奖励:摸两张牌或回复1点体力'); + 'step 1' + if(result.control=='cancel2'){event.finish();return;} player.chooseTarget('整军:是否令一名其他角色也回复1点体力或摸两张牌?',lib.filter.notMe).set('ai',function(target){ var player=_status.event.player; return Math.max(get.effect(target,{name:'wuzhong'},target,player),get.recoverEffect(target,target,player)); }); - 'step 1' + 'step 2' if(result.bool){ var target=result.targets[0]; - player.logSkill('spzhengjun',target); - target.chooseDrawRecover(2,true); + event.target=target; + var num1=get.effect(target,{name:'wuzhong'},target,player); + var num2=get.recoverEffect(target,target,player); + player.line(target); + if(target.isHealthy()) result.index=0; + else player.chooseControl('摸牌','回血').set('prompt','整肃奖励:令'+get.translation(target)+'摸两张牌或回复1点体力').set('ai',function(){ + return _status.event.goon?0:1; + }).set('goon',num1>=num2); } + else event.finish(); + 'step 3' + if(result.index==0) target.draw(2); + else target.recover(); }, }, }, }, + spzhengjun1:{audio:true}, spshiji:{ audio:2, trigger:{source:'damageBegin2'}, @@ -402,21 +473,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(att>0){ if(target.hasCard(function(card){ if(get.value(card,target)<=0&&game.hasPlayer(function(current){ - return current!=target&¤t.isEmpty(get.subtype(card,false))&&get.effect(current,card,player,player)>0; + return current!=target&¤t.canEquip(card,false)&&get.effect(current,card,player,player)>0; })) return true; return false; },'e')) return 2*att; if(!target.hasCard(function(card){ - var sub=get.subtype(card,false); return game.hasPlayer(function(current){ - return current!=target&¤t.isEmpty(sub); + return current!=target&¤t.canEquip(card); }) },'e')) return 1; } else if(att<0){ if(target.hasCard(function(card){ if(get.value(card,target)>=4.5&&game.hasPlayer(function(current){ - return current!=target&¤t.isEmpty(get.subtype(card,false))&&get.effect(current,card,player,player)>0; + return current!=target&¤t.canEquip(card)&&get.effect(current,card,player,player)>0; })) return true; return false; },'e')) return -att; @@ -433,9 +503,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else event.finish(); 'step 2' var es=target.getCards('e',function(card){ - var sub=get.subtype(card,false); return game.hasPlayer(function(current){ - return current!=target&¤t.isEmpty(sub); + return current!=target&¤t.canEquip(card); }) }); if(es.length){ @@ -443,7 +512,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else player.chooseButton(['移动'+get.translation(target)+'的一张装备牌',es],true).set('ai',function(button){ var player=_status.event.player,target=_status.event.getParent().target,card=button.link; if(game.hasPlayer(function(current){ - return current!=target&¤t.isEmpty(get.subtype(card,false))&&get.effect(current,card,player,player)>0; + return current!=target&¤t.canEquip(card)&&get.effect(current,card,player,player)>0; })) return -get.value(card,target)*get.attitude(player,target); return 0; }); @@ -453,8 +522,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.bool){ event.card=result.links[0]; player.chooseTarget(true,'选择'+get.translation(event.card)+'的移动目标',function(card,player,target){ - return target.isEmpty(_status.event.subtype); - }).set('subtype',get.subtype(event.card)).set('ai',function(target){ + return target.canEquip(_status.event.card); + }).set('card',event.card).set('ai',function(target){ var evt=_status.event; return get.effect(target,evt.getParent().card,evt.player,evt.player); }); @@ -505,26 +574,56 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, spyanji:{ - audio:2, - trigger:{player:'phaseUseBegin'}, - direct:true, - filter:function(event,player){ - return !player.hasSkill('zhengsu'); - }, - content:function(){ - 'step 0' - player.chooseButton([get.prompt('spyanji'),[['zhengsu_leijin','zhengsu_bianzhen','zhengsu_mingzhi'],'vcard']]); - 'step 1' - if(result.bool){ - player.logSkill('spyanji',player); - var name=result.links[0][2]; - player.addTempSkill('zhengsu',{player:'phaseDiscardAfter'}); - player.addTempSkill(name,{player:'phaseDiscardAfter'}); - player.popup(name,'thunder'); - game.delayx(); - } + audio:3, + group:'spyanji_zhengsu', + subSkill:{ + zhengsu:{ + audio:'spyanji', + trigger:{player:'phaseUseBegin'}, + filter:function(event,player){ + return ['zhengsu_leijin','zhengsu_bianzhen','zhengsu_mingzhi'].some(i=>!player.hasSkill(i)); + }, + direct:true, + content:function(){ + 'step 0' + player.chooseButton([get.prompt('spyanji'),[['zhengsu_leijin','zhengsu_bianzhen','zhengsu_mingzhi'].filter(i=>!player.hasSkill(i)),'vcard']]).set('ai',()=>Math.random()); + 'step 1' + if(result.bool){ + player.logSkill('spyanji_zhengsu',player); + var name=result.links[0][2]; + player.addTempSkill('spyanji_share',{player:['phaseDiscardAfter','phaseAfter']}); + player.addTempSkill(name,{player:['phaseDiscardAfter','phaseAfter']}); + player.popup(name,'thunder'); + game.delayx(); + } + }, + }, + share:{ + charlotte:true, + trigger:{player:'phaseDiscardEnd'}, + forced:true, + popup:false, + content:function(){ + if(!lib.skill.zhengsu.filter(trigger,player)){ + game.broadcastAll(function(){ + if(lib.config.background_speak) game.playAudio('skill','spyanji3'); + }); + player.popup('整肃失败','fire'); + game.log(player,'整肃失败'); + event.finish(); + return; + } + game.broadcastAll(function(){ + if(lib.config.background_speak) game.playAudio('skill','spyanji2'); + }); + player.popup('整肃成功','wood'); + game.log(player,'整肃成功'); + player.chooseDrawRecover(2,'整肃奖励:摸两张牌或回复1点体力'); + }, + }, }, }, + spyanji1:{audio:true}, //蒋钦 spjianyi:{ audio:2, @@ -1204,7 +1303,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ return event.card&&event.card.name=='sha'&& event.source&&event.source.isIn()&&player!=event.source - &&event.cards.filterInD().length>0&&player.getEquip(1); + &&event.cards.filterInD().length>0&&player.getEquips(1).length>0; }, check:function(event,player){ var card={ @@ -1223,7 +1322,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return hs.contains(i); }).length==cards.length&&player.canUse({name:'sha',cards:cards},target,false)){ var next=player.useCard({name:'sha'},cards,target,false); - if(!target.getEquip(1)) next.baseDamage=2; + if(!target.getEquips(1).length) next.baseDamage=2; } }, }, @@ -1242,11 +1341,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(card) player.gain(card,'gain2'); else{ var targets=game.filterPlayer(function(current){ - return current.getEquip(1); + return current.getEquips(1).length>0; }); if(targets.length){ var target=targets.randomGet(); - player.gain(target.getEquip(1),target,'give','bySelf'); + player.gain(target.getEquips(1),target,'give','bySelf'); } } }, @@ -1999,15 +2098,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(event.player!=player.storage.chuhai2) return false; for(var i=1;i<6;i++){ - if(player.isEmpty(i)) return true; + if(player.hasEmptySlot(i)) return true; } return false; }, content:function(){ for(var i=1;i<7;i++){ - if(player.isEmpty(i)){ + if(player.hasEmptySlot(i)){ var sub='equip'+i,card=get.cardPile(function(card){ - return get.subtype(card,false)==sub&&!get.cardtag(card,'gifts'); + return get.subtype(card,false)==sub&&!get.cardtag(card,'gifts')&&player.canEquip(card); }); if(card){ player.$gain2(card); @@ -2994,16 +3093,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filterTarget:function(card,player,target){ for(var i=1;i<6;i++){ - if(target.isEmpty(i)) return true; + if(target.hasEmptySlot(i)) return true; } return false; }, content:function(){ 'step 0' - event.num=0; + event.num=1; player.awakenSkill('rongbei'); 'step 1' - while(!target.isEmpty(event.num)){ + while(!target.hasEmptySlot(event.num)){ event.num++; if(event.num>5){ event.finish(); @@ -4602,7 +4701,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:'muzhen', filterTarget:[ function(card,player,target){ - return target.countCards('h')>0&&target.isEmpty(ui.selected.cards[0]); + return target.countCards('h')>0&&target.canEquip(ui.selected.cards[0]); }, function(card,player,target){ return target.countCards('e')>0; @@ -4610,9 +4709,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ][links[0]], filterCard:[ function(card,player){ - if(ui.selected.targets.length) return ui.selected.targets[0].isEmpty(card); + if(ui.selected.targets.length) return ui.selected.targets[0].canEquip(card); return game.hasPlayer(function(current){ - return current.countCards('h')>0&¤t.isEmpty(card); + return current.countCards('h')>0&¤t.canEquip(card); }) }, true, @@ -5171,7 +5270,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ chooseControl:function(event,player){ var list=[]; for(var i=1;i<6;i++){ - if(player.getEquip(i)) list.push('equip'+i); + if(player.getEquips(i).length>0) list.push('equip'+i); } list.push('cancel2'); return list; @@ -6436,7 +6535,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ spyanji_info:'出牌阶段开始时,你可以进行“整肃”。', sp_huangfusong:'手杀皇甫嵩', spzhengjun:'整军', - spzhengjun_info:'①出牌阶段开始时,你可进行“整肃”。②当你因整肃而摸牌或回复体力后,你可令一名其他角色选择摸两张牌或回复1点体力。', + spzhengjun_info:'①出牌阶段开始时,你可进行“整肃”。②当你因整肃而摸牌或回复体力后,你可令一名其他角色摸两张牌或回复1点体力。', spshiji:'势击', spshiji_info:'当你对其他角色造成属性伤害时,若你的手牌数不为全场唯一最多,则你可以观看其手牌。你令其弃置其中的所有红色牌,然后摸等量的牌。', sptaoluan:'讨乱', @@ -6447,7 +6546,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ zjjuxiang:'拒降', zjjuxiang_info:'限定技。一名其他角色脱离濒死状态时,你可以对其造成1点伤害,然后摸X张牌(X为其体力上限且至多为5)。', houfeng:'厚俸', - houfeng_info:'每轮限一次。一名其他角色的出牌阶段开始时,若其在你的攻击范围内,则你可以令其进行“整肃”。然后当其于本回合内因整肃而摸牌或回复体力后,你可选择摸两张牌或回复1点体力。', + houfeng_info:'每轮限一次。一名其他角色的出牌阶段开始时,若其在你的攻击范围内,则你可以令其进行“整肃”。然后当其于本回合内因整肃而摸牌或回复体力后,你获得相同的整肃奖励。', liuba:'刘巴', duanbi:'锻币', duanbi_info:'出牌阶段限一次。若场上所有角色的手牌数之和大于角色数之和的二倍,则你可以令所有其他角色各弃置X张手牌(X为该角色手牌数的一半且向下取整且至多为3)。然后你可选择一名角色,令其随机获得三张以此法被弃置的牌。', diff --git a/character/sp.js b/character/sp.js index 293f4630c..0ea91615f 100755 --- a/character/sp.js +++ b/character/sp.js @@ -10,7 +10,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_tianzhu:["wutugu","yanbaihu","shamoke","panfeng","zhugedan",'huangzu','gaogan',"tadun","fanjiangzhangda","ahuinan","dongtuna"], sp_nvshi:["lingju","guanyinping","zhangxingcai","mayunlu","dongbai","zhaoxiang",'ol_zhangchangpu','ol_xinxianying',"daxiaoqiao","jin_guohuai"], sp_shaowei:["simahui","zhangbao","zhanglu","zhugeguo","xujing","zhangling",'huangchengyan','ol_puyuan','zhangzhi','lushi'], - sp_huben:["caohong","xiahouba","zhugeke","zumao","wenpin","litong","mazhong","heqi","quyi","luzhi","zangba","yuejin","dingfeng","wuyan","ol_zhuling","tianyu","huojun",'zhaoyǎn','dengzhong','ol_furong','macheng','ol_zhangyì','ol_zhujun','maxiumatie','luoxian'], + sp_huben:["caohong","xiahouba","zhugeke","zumao","wenpin","litong","mazhong","heqi","quyi","luzhi","zangba","yuejin","dingfeng","wuyan","ol_zhuling","tianyu","huojun",'zhaoyǎn','dengzhong','ol_furong','macheng','ol_zhangyì','ol_zhujun','maxiumatie','luoxian','ol_wenqin'], sp_liesi:['mizhu','weizi','ol_liuba','zhangshiping'], sp_default:["sp_diaochan","sp_zhaoyun","sp_sunshangxiang","sp_caoren","sp_jiangwei","sp_machao","sp_caiwenji","jsp_guanyu","jsp_huangyueying","sp_pangde","sp_jiaxu","yuanshu",'sp_zhangliao','sp_ol_zhanghe','sp_menghuo'], sp_waitforsort:['ol_huban','ol_mengda','haopu'], @@ -28,6 +28,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, character:{ + ol_wenqin:['male','wei',4,['olguangao','olhuiqi']], haopu:['male','shu',4,['olzhenying']], ol_mengda:['male','shu',4,['olgoude']], ol_wanglang:['male','wei',3,['gushe','oljici']], @@ -686,6 +687,149 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, skill:{ + //OL文钦 + olguangao:{ + audio:2, + trigger:{ + global:'useCard2', + }, + filter:function(event,player){ + var card=event.card; + if(card.name!='sha') return false; + if(event.player==player){ + if(game.hasPlayer(current=>{ + return current.isIn()&&!event.targets.contains(current)&&player.canUse(event.card,current,false); + })){ + return true; + } + return false; + } + return event.player.isIn()&&!event.targets.contains(player)&&event.player.canUse(card,player); + }, + direct:true, + content:function(){ + 'step 0' + if(trigger.player==player){ + player.chooseTarget(get.prompt('olguangao'),'为'+get.translation(trigger.card)+'额外指定一个目标。然后若你手牌数为偶数,你摸一张牌并令此牌对任意目标无效。',(card,player,target)=>{ + return !_status.event.sourcex.contains(target)&&player.canUse(_status.event.card,target,false); + }).set('sourcex',trigger.targets).set('ai',function(target){ + var player=_status.event.player; + var eff=get.effect(target,_status.event.card,player,player); + if(player.countCards('h')%2==0&&player.hasSkill('olxieju')&&player.isPhaseUsing()&&!player.getStat().skill.olxieju) return 1-eff; + return eff; + }).set('card',trigger.card); + } + else{ + trigger.player.chooseBool('是否发动'+get.translation(player)+'的【犷骜】?','令其成为'+get.translation(trigger.card)+'的额外目标。然后若其手牌数为偶数,其摸一张牌并令此牌对任意目标无效。').set('ai',()=>{ + return _status.event.bool; + }).set('bool',function(){ + var att=get.attitude(trigger.player,player); + var eff=get.effect(player,trigger.card,trigger.player,trigger.player); + if(player.countCards('h')%2==0&&att>0) return true; + if(eff>0) return true; + return false; + }()); + } + 'step 1' + if(result.bool){ + var target=result.targets&&result.targets[0]; + if(!target){ + target=player; + trigger.player.logSkill('olguangao',player); + } + else{ + player.logSkill('olguangao',target); + } + trigger.targets.add(target); + game.delayex(); + } + else event.finish(); + 'step 2' + if(player.countCards('h')%2==0){ + player.draw(); + player.chooseTarget('犷骜:令此杀对其任意个目标无效',[1,Infinity],true,(card,player,target)=>{ + return _status.event.targetsx.contains(target); + }).set('ai',target=>{ + return 1-get.effect(target,_status.event.getTrigger().card,_status.event.player,_status.event.player); + }).set('targetsx',trigger.targets); + } + else event.finish(); + 'step 3' + if(result.bool){ + player.line(result.targets); + trigger.excluded.addArray(result.targets); + } + } + }, + olhuiqi:{ + audio:2, + trigger:{ + global:'phaseEnd', + }, + juexingji:true, + forced:true, + skillAnimation:true, + animationColor:'thunder', + derivation:'olxieju', + filter:function(event,player){ + var targets=[]; + game.getGlobalHistory('useCard',evt=>{ + if(evt.targets&&evt.targets.length){ + targets.addArray(evt.targets); + } + }); + return targets.length==3; + }, + content:function(){ + 'step 0' + player.awakenSkill('olhuiqi'); + player.addSkillLog('olxieju'); + player.insertPhase(); + } + }, + olxieju:{ + audio:2, + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return event.olxieju&&event.olxieju.length; + }, + onChooseToUse:function(event){ + if(!event.olxieju&&!game.online){ + var targets=[]; + game.getGlobalHistory('useCard',evt=>{ + if(evt.targets&&evt.targets.length){ + targets.addArray(evt.targets); + } + }) + event.set('olxieju',targets); + } + }, + filterTarget:function(card,player,target){ + var event=_status.event; + if(event.olxieju.contains(target)) return true; + return false; + }, + selectTarget:[1,Infinity], + content:function(){ + var card={ + name:'sha', + isCard:true, + }; + if(target.hasUseTarget(card,true)){ + target.chooseUseTarget(card,true); + } + }, + ai:{ + order:1, + result:{ + target:function(player,target){ + var val=target.getUseValue({name:'sha'},true); + return Math.sign(val); + } + } + } + }, //郝普 olzhenying:{ audio:2, @@ -4623,12 +4767,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, filter:function(event,player){ if(event.name=='phase'&&game.phaseNumber!=0) return false; - return player.countDisabled()<5; + return player.hasEnabledSlot(); }, content:function(){ + var list=[]; for(var i=1;i<6;i++){ - if(!player.isDisabled(i)) player.disableEquip(i); + for(var j=0;j0&&player.countCards('he')>0)||(!player.storage.fenrui&&game.hasPlayer(function(current){ + return (player.hasDisabledSlot()&&player.countCards('he')>0)||(!player.storage.fenrui&&game.hasPlayer(function(current){ return current!=player&¤t.countCards('e')0&&player.countCards('he')>0){ + if(player.hasDisabledSlot()&&player.countCards('he')>0){ var str='弃置一张牌,恢复一个装备栏并使用一张对应装备牌'; player.chooseToDiscard('he',get.prompt('fenrui'),str).set('ai',function(card){ return 7-get.value(card); @@ -4668,7 +4816,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var player=_status.event.player; var list=[2,5,1,3,4]; for(var i of list){ - if(player.isDisabled(i)) return 'equip'+i; + if(player.hasDisabledSlot(i)) return 'equip'+i; } }); } @@ -5816,16 +5964,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.card=card; player.addSkill('olshengong_destroy'); player.markAuto('olshengong_destroy',[card]); - var subtype=get.subtype(card); if(!game.hasPlayer(function(current){ - return !current.isDisabled(subtype); + return current.canEquip(card); })){ event.finish(); return; } player.chooseTarget(true,'将'+get.translation(card)+'置于一名角色的装备区内',function(card,player,target){ - return !target.isDisabled(_status.event.subtype); - }).set('subtype',subtype).set('ai',function(target){ + return target.canEquip(_status.event.card); + }).set('card',card).set('ai',function(target){ var card=_status.event.getParent().card,player=_status.event.player; return get.effect(target,card,player,player); }); @@ -5901,16 +6048,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return !event.numFixed&&event.num>0; }, check:function(event,player){ - if(player.isEmpty(2)||player.isEmpty(5)||player.isEmpty(1)) return true; + if(player.hasEmptySlot(2)||player.hasEmptySlot(5)||player.hasEmptySlot(1)) return true; return false; }, prompt2:'摸牌阶段开始时,你可以少摸一张牌并声明一种装备牌的副类别,然后从牌堆或弃牌堆中获得一张该副类别的牌。', content:function(){ 'step 0' player.chooseControl('equip1','equip2','equip6','equip5').set('prompt','选择获得一种副类别的装备牌').set('ai',function(card){ - if(player.isEmpty(2)) return 'equip2'; - if(player.isEmpty(5)) return 'equip5'; - if(player.isEmpty(1)) return 'equip1'; + if(player.hasEmptySlot(2)) return 'equip2'; + if(player.hasEmptySlot(5)) return 'equip5'; + if(player.hasEmptySlot(1)) return 'equip1'; return 'equip6'; }); 'step 1' @@ -7447,7 +7594,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ getNum:function(player,target){ var num=0; if(target.isHealthy()) num++; - if(target.getEquip(2)) num++; + if(target.getEquips(2).length) num++; var countSkill=function(player){ return player.getSkills(null,false,false).filter(function(skill){ var info=get.info(skill); @@ -7818,7 +7965,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'phaseBegin'}, direct:true, filter:function(event,player){ - return event.player.isIn()&&event.player.isEmpty(5)&&player.hasCard(lib.skill.zhuangshu.filterCard,'he'); + return event.player.isIn()&&event.player.hasEmptySlot(5)&&player.hasCard(lib.skill.zhuangshu.filterCard,'he'); }, filterCard:function(card){ if(_status.connectMode) return true; @@ -7842,13 +7989,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 1' if(result.bool){ var name='zhuangshu_'+get.type2(result.cards[0],result.cards[0].original=='h'?player:false); - if(lib.card[name]&&trigger.player.isIn&&trigger.player.isEmpty(5)){ + if(lib.card[name]&&trigger.player.isIn&&trigger.player.hasEmptySlot(5)){ var target=game.findPlayer(function(current){ - var equip=current.getEquip(5); + var equip=current.getEquip(name); return equip&&equip.name==name; }); if(target){ - var card=target.getEquip(5); + var card=target.getEquip(name); target.$give(card,trigger.player,false); } else{ @@ -7898,8 +8045,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(event.type!='discard'||event.getlx===false) return false; return game.hasPlayer(function(current){ if(player!=current){ - var card=current.getEquip(5); - if(!card||card.name.indexOf('zhuangshu_')!=0) return false; + var cards=current.getEquips(5); + if(!cards.some(card=>card.name.indexOf('zhuangshu_')==0)) return false; } var evt=event.getl(current); if(!evt||!evt.cards2) return false; @@ -7914,8 +8061,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var cards=[]; game.countPlayer(function(current){ if(player!=current){ - var card=current.getEquip(5); - if(!card||card.name.indexOf('zhuangshu_')!=0) return false; + var cards=current.getEquips(5); + if(!cards.some(card=>card.name.indexOf('zhuangshu_')==0)) return false; } var evt=trigger.getl(current); for(var i of evt.cards2){ @@ -9856,14 +10003,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!player.storage.youlong2) player.storage.youlong2=[]; }, hiddenCard:function(player,name){ - if(player.storage.youlong2.contains(name)||player.countDisabled()>=5) return false; + if(player.storage.youlong2.contains(name)||!player.hasEnabledSlot()) return false; if(player.hasSkill('youlong_'+(player.storage.youlong||false))) return false; var type=get.type(name); if(player.storage.youlong) return type=='basic'; return type=='trick'; }, filter:function(event,player){ - if(player.storage.youlong2.contains(name)||player.countDisabled()>=5) return false; + if(player.storage.youlong2.contains(name)||!player.hasEnabledSlot()) return false; if(player.hasSkill('youlong_'+(player.storage.youlong||false))) return false; var type=player.storage.youlong?'basic':'trick'; for(var name of lib.inpile){ @@ -9882,7 +10029,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ table.style.width='100%'; table.style.position='relative'; for(var i=1;i<6;i++){ - if(player.isDisabled(i)) continue; + if(!player.hasEnabledSlot(i)) continue; var td=ui.create.div('.shadowed.reduce_radius.pointerdiv.tdnode'); td.innerHTML=''+get.translation('equip'+i)+''; td.link=i; @@ -10038,13 +10185,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.awakenSkill('luanfeng'); trigger.player.recover(3-trigger.player.hp); 'step 1' - var num=trigger.player.countDisabled(); - if(num){ - for(var i=1;i<6;i++){ - if(trigger.player.isDisabled(i)) trigger.player.enableEquip(i); + var list=[]; + for(var i=1;i<6;i++){ + for(var j=0;j0) player.enableEquip(list); + if(list.length<6) trigger.player.drawTo(6-list.length); if(trigger.player.storage.kotarou_rewrite) trigger.player.storage.kotarou_rewrite=[]; if(player==trigger.player) player.storage.youlong2=[]; }, @@ -10298,7 +10446,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, direct:true, filter:function(event,player){ - return player!=event.player&&!event.player.storage._disableJudge&&event.player.countCards('he')&&!event.player.countCards('j'); + return player!=event.player&&!event.player.isDisabledJudge()&&event.player.countCards('he')&&!event.player.countCards('j'); }, content:function(){ 'step 0' @@ -10557,17 +10705,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return lib.filter.filterTarget.apply(this,arguments); }).set('sourcex',targets[1]).set('addCount',false); 'step 2' - var card=targets[0].getEquip(1); - if(!result.bool&&card){ - event.card=card; - player.chooseTarget(true,'将'+get.translation(card)+'交给一名其他角色').set('ai',function(target){ - var card=_status.event.getParent().card; - return (target.hasSkillTag('nogain')?0:get.attitude(_status.event.player,target))*Math.max(0.1,target.getUseValue(card)); + var cards=targets[0].getEquips(1); + if(!result.bool&&cards.length){ + event.cards=cards; + player.chooseTarget(true,'将'+get.translation(cards)+'交给一名其他角色').set('ai',function(target){ + var card=_status.event.getParent().cards; + return (target.hasSkillTag('nogain')?0:get.attitude(_status.event.player,target))*Math.max(0.1,target.getUseValue(cards[0])); }); } else event.finish(); 'step 3' - result.targets[0].gain(card,result.targets[0],'give').giver=player; + result.targets[0].gain(cards,result.targets[0],'give').giver=player; }, ai:{ order:4, @@ -11875,12 +12023,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function (){ 'step 0' player.chooseTarget(get.prompt('new_mumu'),'弃置一名角色装备区内的一张牌,或者获得一名角色装备区内的防具牌',function(card,player,target){ - if(target==player) return target.getEquip(2)!=undefined; + if(target==player) return target.getEquips(2).length>0; return target.countCards('e')>0; }).set('ai',function(target){ var player=_status.event.player; var att=get.attitude(player,target) - if(target.getEquip(2)&&player.isEmpty(2)){ + if(target.getEquip(2)&&player.hasEmptySlot(2)){ return -2*att; } return -att; @@ -11890,12 +12038,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.target=result.targets[0]; player.logSkill('new_mumu',event.target); player.line(event.target,'green'); - var e=event.target.getEquip(2); + var e=event.target.getEquips(2); event.e=e; if(target==player) event.choice='获得一张防具牌'; - else if(e){ + else if(e.length>0){ player.chooseControl('弃置一张装备牌','获得一张防具牌').set('ai',function(){ - if(_status.event.player.getEquip(2)){ + if(_status.event.player.getEquips(2).length>0){ return '弃置一张装备牌'; } return '获得一张防具牌'; @@ -11904,7 +12052,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else{ event.choice='弃置一张装备牌'; } - }else event.finish(); + } + else event.finish(); 'step 2' var choice=event.choice||result.control; if(choice=='弃置一张装备牌'){ @@ -12678,8 +12827,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ target.gain(card,'gain2'); } 'step 2' - var equip1=target.getEquip(1); - if(equip1){ + var equip1=target.getEquips(1); + if(equip1.length){ game.delay(); target.give(equip1,player); target.line(player); @@ -12716,8 +12865,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.list=result.targets.slice(0); } 'step 2' - var equip1=player.getEquip(1); - if(equip1){ + var equip1=player.getEquips(1); + if(equip1.length){ for(var i=0;islot=='equip2'||slot=='equip5')) return false; }, /*cardDiscardable:function (card,player){ if(player.getEquip(5)) return; @@ -16154,7 +16303,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ inherit:'bagua_skill', filter:function(event,player){ if(!lib.skill.bagua_skill.filter(event,player)) return false; - if(!player.isEmpty(2)) return false; + if(!player.hasEmptySlot(2)) return false; return true; }, ai:{ @@ -16715,15 +16864,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filterTarget:function(card,player,target){ if(target==player) return false; - return target.getEquip(1)||target.getEquip(2); + return target.getEquips(1).length>0||target.getEquips(2).length>0; }, content:function(){ 'step 0' - var e1=target.getEquip(1); - var e2=target.getEquip(2); + var e1=target.getEquips(1); + var e2=target.getEquips(2); event.e1=e1; event.e2=e2; - if(e1&&e2){ + if(e1.length&&e2.length){ player.chooseControl('武器牌','防具牌').set('ai',function(){ if(_status.event.player.getEquip(2)){ return '武器牌'; @@ -16731,7 +16880,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return '防具牌'; }); } - else if(e1){ + else if(e1.length){ event.choice='武器牌'; } else{ @@ -18720,7 +18869,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.turnOver(); "step 1" var num=game.countPlayer(function(current){ - return current.getEquip(1); + return current.getEquips(1).length; }); player.draw(2+num); player.addSkill('kuiwei2'); @@ -18739,7 +18888,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:false, content:function(){ var num=game.countPlayer(function(current){ - return current.getEquip(1); + return current.getEquips(1).length; }); if(num>=player.countCards('he')){ player.discard(player.getCards('he')); @@ -20901,7 +21050,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, position:'he', filterTarget:function(card,player,target){ - return target.isEmpty(get.subtype(card)); + return target.canEquip(card); }, ai1:function(card){ return 6-get.value(card); @@ -21160,7 +21309,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "step 1" if(result.bool){ event.card=result.links[0]; - if(player.isEmpty(get.subtype(event.card))){ + if(player.canEquip(event.card)){ player.chooseBool('是否将'+get.translation(event.card)+'置入自己的装备区?').ai=function(){ return true; }; @@ -21870,7 +22019,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ //priority:15, filter:function (event,player){ if(player.hasSkill('smh_huoji')||player.hasSkill('smh_lianhuan')) return false; - if(!player.isEmpty(2)) return false; + if(!player.hasEmptySlot(2)) return false; if(event.nature) return true; return get.type(event.card,'trick')=='trick'; }, @@ -21887,7 +22036,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(player==target&&get.subtype(card)=='equip2'){ if(get.equipValue(card)<=8) return 0; } - if(!target.isEmpty(2)) return; + if(!target.hasEmptySlot(2)) return; if(get.tag(card,'natureDamage')) return 'zerotarget'; if(get.type(card)=='trick'&&get.tag(card,'damage')){ return 'zeroplayertarget'; @@ -22499,6 +22648,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ruiji:['dc_ruiji','ruiji'], jsp_huangyueying:['jsp_huangyueying','re_jsp_huangyueying'], ganfuren:['dc_ganfuren','ganfuren'], + wenqin:['wenqin','pe_wenqin'], }, translate:{ "xinfu_lingren":"凌人", @@ -23583,6 +23733,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ haopu:'郝普', olzhenying:'镇荧', olzhenying_info:'出牌阶段限两次。你可以选择一名手牌数不大于你的其他角色,你与其同时将手牌摸或弃置至至多两张。然后你与其中手牌数较少的角色视为对另一名角色使用一张【决斗】。', + ol_wenqin:'文钦', + olguangao:'犷骜', + olguangao_info:'当你/其他角色使用【杀】时,你/该角色可以额外指定一个目标/你为目标(使用者不为你则有距离限制)。然后若你的手牌数为偶数,你摸一张牌并令此牌对任意目标无效。', + olhuiqi:'彗企', + olhuiqi_info:'觉醒技。一名角色回合结束后,若仅有三名角色于此回合成为过牌的目标,你获得〖偕举〗并获得一个额外的回合。', + olxieju:'偕举', + olxieju_info:'出牌阶段限一次。你可以令任意名本回合成为过牌的目标的角色依次视为使用一张【杀】。', sp_tianji:'天极·皇室宗亲', sp_sibi:'四弼·辅国文曲', diff --git a/character/sp2.js b/character/sp2.js index c75cfe33e..04de4f2c7 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -1139,7 +1139,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.num=target.countCards('e'); var subtypes=[]; for(var i=1;i<7;i++){ - if(target.isEmpty(i)) subtypes.push('equip'+i); + if(target.hasEmptySlot(i)) subtypes.push('equip'+i); } if(subtypes.length){ subtypes.randomSort(); @@ -4075,7 +4075,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseZhunbeiBegin'}, forced:true, filter:function(event,player){ - return player.countDisabled()<5; + return player.hasEnabledSlot(); }, content:function(){ 'step 0' @@ -4108,7 +4108,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 1' var cardType=result.control; event.cardType=cardType; - var num=player.countDisabled(); + var num=player.countDisabledSlot(); if(num<5) player.draw(5-num); player.chooseTarget(lib.filter.notMe,'是否令一名其他角色从牌堆中使用一张'+get.translation(cardType)+'牌?').set('ai',function(target){ var player=_status.event.player,type=_status.event.cardType; @@ -4134,7 +4134,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'disableEquipAfter'}, forced:true, filter:function(event,player){ - return player.countDisabled()>=5; + return !player.hasEnabledSlot(); }, content:function(){ player.gainMaxHp(2); @@ -4630,7 +4630,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseUseBegin'}, direct:true, filter:function(event,player){ - return !player.storage._disableJudge&&game.hasPlayer(function(current){ + return !player.isDisabledJudge()&&game.hasPlayer(function(current){ return current!=player&¤t.countCards('j',function(card){ return player.canAddJudge(card); })>0; @@ -5874,7 +5874,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.countDisabled()<5; + return player.hasEnabledSlot(); }, chooseButton:{ dialog:function(event,player){ @@ -5883,14 +5883,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ chooseControl:function(event,player){ var list=[]; for(var i=1;i<6;i++){ - if(!player.isDisabled(i)) list.push('equip'+i); + if(player.hasEnabledSlot(i)) list.push('equip'+i); } list.push('cancel2'); return list; }, check:function(event,player){ for(var i=5;i>0;i--){ - if(player.isEmpty(i)) return ('equip'+i); + if(player.hasEmptySlot(i)) return ('equip'+i); } return 'cancel2'; }, @@ -5988,7 +5988,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.gainMaxHp(); player.recover(); 'step 1' - if(player.countDisabled()>=5){ + if(!player.hasEnabledSlot()){ player.loseMaxHp(4); player.addSkill('tuxing2'); } @@ -8005,10 +8005,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.markAuto('pingjian',[result.control]); player.addTempSkill(result.control); player.storage.pingjian_check[result.control]=(trigger.name=='damage'?trigger:'phaseJieshu'); - if(trigger.name=='damage'){ - var info=lib.translate[result.control+'_info']; - if(info&&info.indexOf('1点伤害')+info.indexOf('一点伤害')!=-2) trigger.num=1;//暂时想到的让多点伤害只执行一次的拙见 - } }, group:'pingjian_use', phaseUse_special:[], @@ -8986,7 +8982,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var i=0;i0){ if(val<=Math.min(0,equip)&&game.hasPlayer(function(current){ - return current!=target&¤t.isEmpty(get.subtype(i))&&get.effect(current,i,player,player)>0; + return current!=target&¤t.canEquip(i)&&get.effect(current,i,player,player)>0; })) equip=val; } else{ if(val>Math.max(0,equip)&&game.hasPlayer(function(current){ - return current!=target&¤t.isEmpty(get.subtype(i))&&get.effect(current,i,player,player)>0; + return current!=target&¤t.canEquip(i)&&get.effect(current,i,player,player)>0; })) equip=val; } } @@ -9121,7 +9121,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return targets1.canAddJudge(button.link); } else{ - return targets1.isEmpty(get.subtype(button.link)); + return targets1.canEquip(button.link); } }).set('ai',function(button){ var player=_status.event.player,target=_status.event.targets1,source=_status.event.targets0; @@ -11538,7 +11538,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filterCard:{type:'equip'}, filterTarget:function(card,player,target){ var card=ui.selected.cards[0]; - return target.isEmpty(get.subtype(card)); + return target.canEquip(card); }, discard:false, lose:false, @@ -11657,7 +11657,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseZhunbeiBegin'}, direct:true, filter:function(event,player){ - return !player.isDisabled('equip3')||!player.isDisabled('equip4'); + return player.hasEnabledSlot(3)||player.hasEnabledSlot(4); }, skillAnimation:true, animationColor:'water', @@ -11673,8 +11673,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.bool){ event.target=result.targets[0]; var list=[]; - if(!player.isDisabled(3)) list.push('equip3'); - if(!player.isDisabled(4)) list.push('equip4'); + if(player.hasEnabledSlot(3)) list.push('equip3'); + if(!player.hasEnabledSlot(4)) list.push('equip4'); if(list.length==1) event._result={control:list[0]}; else player.chooseControl(list).set('prompt','选择废除一个坐骑栏'); } @@ -11695,16 +11695,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ charlotte:true, filter:function(event,player){ for(var i of player.getStorage('twjuezhu_restore')){ - if(i[0]==event.player&&player.isDisabled(i[1])) return true; + if(i[0]==event.player&&player.hasEnabledSlot(i[1])) return true; } return false; }, content:function(){ var list=[]; for(var i of player.getStorage('twjuezhu_restore')){ - if(i[0]==trigger.player&&player.isDisabled(i[1])) list.add(i[1]); + if(i[0]==trigger.player&&player.hasEnabledSlot(i[1])) list.push(i[1]); } - for(var i of list) player.enableEquip(i); + player.enableEquip(list); }, }, }, @@ -12151,7 +12151,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, locked:false, filter:function(event,player){ - return (event.name!='phase'||game.phaseNumber==0)&&!player.isDisabled(1); + return (event.name!='phase'||game.phaseNumber==0)&&player.hasEquipableSlot(1); }, content:function(){ if(!lib.inpile.contains('meiyingqiang')){ @@ -12160,7 +12160,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else{ var card=get.cardPile(function(card){ - return card.name=='meiyingqiang'&&card!=player.getEquip(1); + return card.name=='meiyingqiang'&&!player.getEquips(1).contains(card); },'field'); if(card) player.equip(card); } diff --git a/character/xianding.js b/character/xianding.js index 9d9a2bfcf..7e890995a 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -4,7 +4,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ name:'xianding', connect:true, character:{ - dc_duyu:['male','wei',3,['dcjianguo','dcdyqingshi'],['unseen']], + dc_duyu:['male','wei',4,['dcjianguo','dcdyqingshi']], ganfurenmifuren:['female','shu',3,['dcchanjuan','dcxunbie']], dc_ganfuren:['female','shu',3,['dcshushen','dcshenzhi']], dc_mifuren:['female','shu',3,['dcguixiu','dccunsi']], @@ -16,7 +16,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ huanfan:['male','wei',3,['dcjianzheng','dcfumou']], chentai:['male','wei',4,['dcctjiuxian','dcchenyong']], sunyu:['male','wu',3,['dcquanshou','dcshexue'],['unseen']], - xizheng:['male','shu',3,['dcdanyi','dcwencan'],['unseen']], + xizheng:['male','shu',3,['dcdanyi','dcwencan']], dc_ruiji:['female','wu',4,['dcwangyuan','dclingyin','dcliying']], zerong:['male','qun',4,['dccansi','dcfozong']], xielingyu:['female','wu',3,['dcyuandi','dcxinyou']], @@ -1556,6 +1556,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ storage:{dcctjiuxian:true} },true); }, + ai:{ + order:5.5, + result:{player:1}, + }, subSkill:{ help:{ trigger:{global:'damageSource'}, @@ -1827,12 +1831,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!event.targets||!event.targets.length) return false; var evt=lib.skill.dcjianying.getLastUsed(player,event.getParent()); if(!evt||!evt.targets||!evt.targets.length||evt.targets.length!=event.targets.length) return false; - var targetsx=event.targets.slice().sort((a,b)=>a.seatNum-b.seatNum); - var targetsy=evt.targets.slice().sort((a,b)=>a.seatNum-b.seatNum); - for(var i=0;itarget.isIn()).length>0){ + if(card.length&&result.targets.filter(target=>target.isIn()).length>0){ event.card=card; targets[0].chooseTarget(true,'将'+get.translation(card)+'交给一名目标角色',(card,player,target)=>{ return _status.event.targets.contains(target); }).set('ai',function(target){ - var card=_status.event.getParent().card; + var card=_status.event.getParent().card[0]; return (target.hasSkillTag('nogain')?0:get.attitude(_status.event.player,target))*Math.max(0.1,target.getUseValue(card)); }).set('targets',result.targets); } else event.finish(); @@ -2974,8 +2975,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 4' player.useCard({name:'sha',isCard:true},targets[0],false); 'step 5' - var card=targets[0].getEquip(1); - if(card) targets[0].give(card,player,'give'); + var card=targets[0].getEquips(1); + if(card.length) targets[0].give(card,player,'give'); }, ai:{ order:4, @@ -4246,7 +4247,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); } else{ - return !player.isDisabled(5); + return player.hasEquipableSlot(5); } }, direct:true, @@ -5241,7 +5242,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseZhunbeiBegin'}, forced:true, content:function(){ - if(player.isDisabled(5)||player.getEquip('dagongche')){ + if(!player.hasEquipableSlot(5)||player.getEquip('dagongche')){ var next=player.phaseUse(); event.next.remove(next); trigger.getParent().next.push(next); @@ -8645,7 +8646,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.num=1; 'step 1' var type='equip'+num; - if(!player.isEmpty(type)) return; + if(!player.hasEmptySlot(type)) return; var card=get.cardPile2(function(card){ return get.subtype(card,false)==type&&player.canUse(card,player); }); @@ -10745,7 +10746,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xinyingbing_info:'锁定技。每回合每名角色限一次,当你使用牌指定有“咒”的角色为目标后,你摸两张牌。', wufan:'吴范', tianyun:'天运', - tianyun_info:'①游戏的第一个回合开始前,你从牌堆中获得手牌区内没有的花色的各一张牌。②一名角色的回合开始时,若其座位号等于游戏轮数,则你可观看牌堆顶的X张牌并以任意顺序置于牌堆顶或牌堆顶。若你将所有的牌均置于了牌堆底,则你可以令一名角色摸X张牌,然后失去1点体力。(X为你手牌中包含的花色数)', + tianyun_info:'①游戏的第一个回合开始前,你从牌堆中获得手牌区内没有的花色的各一张牌。②一名角色的回合开始时,若其座位号等于游戏轮数,则你可观看牌堆顶的X张牌并以任意顺序置于牌堆顶或牌堆底。若你将所有的牌均置于了牌堆底,则你可以令一名角色摸X张牌,然后失去1点体力。(X为你手牌中包含的花色数)', wfyuyan:'预言', wfyuyan_info:'一轮游戏开始时,你选择一名角色(对其他角色不可见):当第一次有角色于本轮内进入濒死状态时,若其是你选择的角色,则你获得〖奋音〗直到你的回合结束;当第一次有角色于本轮内造成伤害后,若其是你选择的角色,则你摸两张牌。', re_fengfangnv:'冯妤', diff --git a/character/xinghuoliaoyuan.js b/character/xinghuoliaoyuan.js index 8e6a6516b..26834ce5a 100755 --- a/character/xinghuoliaoyuan.js +++ b/character/xinghuoliaoyuan.js @@ -1586,7 +1586,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "xinfu_andong":"安东", "xinfu_andong_info":"当你受到伤害时,你可以令伤害来源选择一项:1.令你观看其的手牌并获得其中的所有红桃牌;2.防止此伤害,然后其本回合内的红桃手牌不计入手牌上限。", "xinfu_yingshi":"应势", - "xinfu_yingshi_info":"出牌阶段开始时,若场上的所有角色均没有「酬」,则你可以将所有的红桃牌置于一名其他角色的武将牌旁,称之为「酬」。有「酬」的角色受到「杀」的伤害/死亡时,伤害来源/你获得其中的一张/所有的「酬」。", + "xinfu_yingshi_info":"出牌阶段开始时,若场上的所有角色均没有「酬」,则你可以将所有的红桃牌置于一名其他角色的武将牌旁,称之为「酬」。有「酬」的角色受到【杀】的伤害后/死亡时,伤害来源/你获得其中的一张/所有的「酬」。", "yingshi_heart":"应势", "yingshi_heart_info":"", "yingshi_die":"应势", diff --git a/character/yijiang.js b/character/yijiang.js index c9d857f12..20b7a55b4 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -6231,7 +6231,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' var num=Math.min(game.countPlayer(function(current){ return player.inRange(current); - }),player.getEquip(1)?4:2); + }),player.getEquips(1).length?4:2); if(trigger.target.countCards('h')0; }, content:function(){ 'step 0' - var num=1; - var info=get.info(player.getEquip(1)); - if(info&&info.distance&&info.distance.attackFrom){ - num-=info.distance.attackFrom; + var num=0,cards=player.getEquips(1); + for(var card of cards){ + var numz=1; + var info=get.info(card,false); + if(info&&info.distance&&info.distance.attackFrom){ + numz-=info.distance.attackFrom; + } + num+=numz; } if(trigger.player.countCards('h')0); + return event.card.name=='sha'&&(get.color(event.card)=='red'?event.player.getEquips(1).length>0:player.countCards('he')>0); }, direct:true, audio:2, content:function(){ 'step 0' var prompt='弃置一张牌' - if(trigger.player.getEquip(1)) prompt+=(',然后获得'+get.translation(trigger.player)+'装备区中的'+get.translation(trigger.player.getEquip(1))); + if(trigger.player.getEquips(1).length) prompt+=(',然后获得'+get.translation(trigger.player)+'装备区中的'+get.translation(trigger.player.getEquips(1))); var next=player.chooseToDiscard('he',get.prompt('reduodao',trigger.player),prompt); next.logSkill=['reduodao',trigger.player]; next.set('ai',function(card){ - if(!_status.event.getTrigger().player.getEquip(1)) return 0; - if(get.attitude(_status.event.player,_status.event.getTrigger().player)*get.value(_status.event.getTrigger().player.getEquip(1))<=0){ + if(!_status.event.getTrigger().player.getEquips(1).length) return 0; + if(get.attitude(_status.event.player,_status.event.getTrigger().player)*get.value(_status.event.getTrigger().player.getEquips(1))<=0){ return 6-get.value(card); } return 0; }); 'step 1' - if(result.bool&&trigger.player.getEquip(1)){ + if(result.bool&&trigger.player.getEquips(1).length){ if(!result.cards||!result.cards.length) player.logSkill('reduodao',trigger.player); - player.gain(trigger.player.getEquip(1),trigger.player,'give','bySelf'); + player.gain(trigger.player.getEquips(1),trigger.player,'give','bySelf'); } }, }, @@ -10835,7 +10839,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "step 0" var next; if(trigger.player.hasCard(function(card){ - return player.isEmpty(get.subtype(card)); + return player.canEquip(card); },'e')){ next=player.chooseControl('移动装备','draw_card','cancel2',function(event,player){ var source=_status.event.sourcex; @@ -10865,7 +10869,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.control=='移动装备'){ player.logSkill('qieting',trigger.player); player.choosePlayerCard(trigger.player,'e','将一张装备牌移至你的装备区',true).set('filterButton',function(button){ - return _status.event.player.isEmpty(get.subtype(button.link)); + return _status.event.player.canEquip(button.link); }).set('ai',function(button){ return get.effect(player,button.link,player,player); }); @@ -11827,7 +11831,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, audio:2, filter:function(event,player){ - if(player.getEquip(2)) return false; + if(!player.hasEmptySlot(2)) return false; return (event.card.name=='sha'&&get.color(event.card)=='black') }, content:function(){ @@ -11836,10 +11840,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ effect:{ target:function(card,player,target){ - if(player==target&&get.subtype(card)=='equip2'){ + if(player==target&&get.subtypes(card).contains('equip2')){ if(get.equipValue(card)<=8) return 0; } - if(target.getEquip(2)) return; + if(!player.hasEmptySlot(2)) return; if(card.name=='sha'&&get.color(card)=='black') return 'zerotarget'; } } @@ -14131,7 +14135,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ danshou_info:'出牌阶段,你可以选择你攻击范围内的一名其他角色,然后弃置X张牌(X为此前你于此阶段你发动“胆守”的次数+1)。若X:为1,你弃置该角色的一张牌;为2,令该角色交给你一张牌;为3,你对该角色造成1点伤害;不小于4,你与该角色各摸两张牌。', olddanshou_info:'当你造成伤害后,你可以摸一张牌。若如此做,终止一切结算,当前回合结束。', xindanshou_info:'①每回合限一次,当你成为基本牌或锦囊牌的目标后,你可以摸X张牌(X为你本回合内成为过基本牌或锦囊牌的目标的次数)。②一名其他角色的结束阶段,若你本回合内没有发动过〖胆守①〗,则你可以弃置X张牌并对其造成1点伤害(X为其手牌数,无牌则不弃)。', - yizhong_info:'锁定技,当你的防具栏为空时,黑色的杀对你无效', + yizhong_info:'锁定技,当你的防具栏为空时,黑色的【杀】对你无效', xinzhan_info:'出牌阶段限一次,你可以观看牌堆顶的3张牌,然后展示其中任意数量♥的牌并获得之。', huilei_info:'锁定技,当你死亡时,杀死你的角色弃置所有的牌。', enyuan_info:'锁定技。①当其他角色令你回复1点体力后,该角色摸一张牌。②当其他角色对你造成伤害后,其须交给你一张♥手牌,否则失去1点体力。', diff --git a/character/yingbian.js b/character/yingbian.js index 5dae2f95e..62ad0489b 100644 --- a/character/yingbian.js +++ b/character/yingbian.js @@ -1945,7 +1945,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ enable:'phaseUse', derivation:['cheliji_sichengliangyu','cheliji_tiejixuanyu','cheliji_feilunzhanyu'], filter:function(event,player){ - return !player.getEquip(5)&&player.countCards('he',{color:'black'})>0; + return !player.getEquips(5).length&&player.countCards('he',{color:'black'})>0; }, filterCard:{color:'black'}, position:'he', @@ -2011,7 +2011,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ qiangshou:{ mod:{ globalFrom:function(player,target,distance){ - if(player.getEquip(5)) return distance-1; + if(player.getEquips(5).length) return distance-1; } }, }, diff --git a/game/asset.js b/game/asset.js index 130cf05b8..23fae2b19 100644 --- a/game/asset.js +++ b/game/asset.js @@ -1,5 +1,5 @@ window.noname_asset_list=[ - 'v1.9.124', + 'v1.9.125', 'audio/background/aozhan_chaoming.mp3', 'audio/background/aozhan_online.mp3', 'audio/background/aozhan_rewrite.mp3', @@ -176,7 +176,6 @@ window.noname_asset_list=[ 'audio/card/male/yuanjiao.mp3', 'audio/card/male/zhibi.mp3', - 'audio/die/ahuinan.mp3', 'audio/die/baosanniang.mp3', 'audio/die/beimihu.mp3', @@ -241,6 +240,7 @@ window.noname_asset_list=[ 'audio/die/clan_xuncan.mp3', 'audio/die/clan_xunchen.mp3', 'audio/die/clan_xunshu.mp3', + 'audio/die/clan_zhonghui.mp3', 'audio/die/cuimao.mp3', 'audio/die/cuiyan.mp3', 'audio/die/daqiao.mp3', @@ -1048,6 +1048,7 @@ window.noname_asset_list=[ 'audio/die/xinping.mp3', 'audio/die/xinxianying.mp3', 'audio/die/xinzhongyong.mp3', + 'audio/die/xizheng.mp3', 'audio/die/xizhicai.mp3', 'audio/die/xuangongzhu.mp3', 'audio/die/xuelingyun.mp3', @@ -1227,7 +1228,6 @@ window.noname_asset_list=[ 'audio/effect/tori_no_uta.mp3', 'audio/effect/win.mp3', - 'audio/skill/aichen1.mp3', 'audio/skill/aichen2.mp3', 'audio/skill/anguo1.mp3', @@ -1527,6 +1527,8 @@ window.noname_asset_list=[ 'audio/skill/cixiong_skill.mp3', 'audio/skill/clanbalong1.mp3', 'audio/skill/clanbalong2.mp3', + 'audio/skill/clanbaozu_clan_zhonghui1.mp3', + 'audio/skill/clanbaozu_clan_zhonghui2.mp3', 'audio/skill/clanbeishi1.mp3', 'audio/skill/clanbeishi2.mp3', 'audio/skill/clanbolong1.mp3', @@ -1567,6 +1569,8 @@ window.noname_asset_list=[ 'audio/skill/clanshangshen2.mp3', 'audio/skill/clanshenjun1.mp3', 'audio/skill/clanshenjun2.mp3', + 'audio/skill/clanxieshu1.mp3', + 'audio/skill/clanxieshu2.mp3', 'audio/skill/clanxumin_clan_hanrong1.mp3', 'audio/skill/clanxumin_clan_hanrong2.mp3', 'audio/skill/clanxumin_clan_hanshao1.mp3', @@ -1575,6 +1579,8 @@ window.noname_asset_list=[ 'audio/skill/clanyirong2.mp3', 'audio/skill/clanyunshen1.mp3', 'audio/skill/clanyunshen2.mp3', + 'audio/skill/clanyuzhi1.mp3', + 'audio/skill/clanyuzhi2.mp3', 'audio/skill/clanzhanding1.mp3', 'audio/skill/clanzhanding2.mp3', 'audio/skill/clanzhongliu_clan_wangling1.mp3', @@ -1682,6 +1688,8 @@ window.noname_asset_list=[ 'audio/skill/dccuijin2.mp3', 'audio/skill/dccuixin1.mp3', 'audio/skill/dccuixin2.mp3', + 'audio/skill/dcdanyi1.mp3', + 'audio/skill/dcdanyi2.mp3', 'audio/skill/dcdanying1.mp3', 'audio/skill/dcdanying2.mp3', 'audio/skill/dcdeshao1.mp3', @@ -1911,6 +1919,8 @@ window.noname_asset_list=[ 'audio/skill/dcwangyuan2.mp3', 'audio/skill/dcweidang1.mp3', 'audio/skill/dcweidang2.mp3', + 'audio/skill/dcwencan1.mp3', + 'audio/skill/dcwencan2.mp3', 'audio/skill/dcwudao1.mp3', 'audio/skill/dcwudao2.mp3', 'audio/skill/dcwudao3.mp3', @@ -5607,8 +5617,8 @@ window.noname_asset_list=[ 'audio/skill/zhuiyi_re_bulianshi2.mp3', 'audio/skill/zhuiyi1.mp3', 'audio/skill/zhuiyi2.mp3', - 'audio/skill/zhujian.mp3', 'audio/skill/zhujian1.mp3', + 'audio/skill/zhujian2.mp3', 'audio/skill/zhukou1.mp3', 'audio/skill/zhukou2.mp3', 'audio/skill/zhuning1.mp3', @@ -5808,6 +5818,7 @@ window.noname_asset_list=[ 'image/card/duanjian.png', 'image/card/dunpaigedang.png', 'image/card/dz_mantianguohai.png', + 'image/card/expandedSlots.png', 'image/card/fangtian.png', 'image/card/feibiao.png', 'image/card/feilongduofeng.png', @@ -6201,7 +6212,7 @@ window.noname_asset_list=[ 'image/card/zixin.png', 'image/card/ziyangdan.png', 'image/card/zong.png', - + 'image/character/ahuinan.jpg', 'image/character/baiwuchang.jpg', 'image/character/baosanniang.jpg', @@ -6257,6 +6268,7 @@ window.noname_asset_list=[ 'image/character/chunyuqiong.jpg', 'image/character/clan_hanrong.jpg', 'image/character/clan_hanshao.jpg', + 'image/character/clan_wanghun.jpg', 'image/character/clan_wangling.jpg', 'image/character/clan_wangyun.jpg', 'image/character/clan_wuban.jpg', @@ -6266,6 +6278,7 @@ window.noname_asset_list=[ 'image/character/clan_xuncan.jpg', 'image/character/clan_xunchen.jpg', 'image/character/clan_xunshu.jpg', + 'image/character/clan_zhonghui.jpg', 'image/character/clan_zhongyan.jpg', 'image/character/cuimao.jpg', 'image/character/cuiyan.jpg', @@ -6278,6 +6291,7 @@ window.noname_asset_list=[ 'image/character/dc_caiyang.jpg', 'image/character/dc_caozhi.jpg', 'image/character/dc_chenqun.jpg', + 'image/character/dc_duyu.jpg', 'image/character/dc_fuwan.jpg', 'image/character/dc_ganfuren.jpg', 'image/character/dc_gaolan.jpg', @@ -6954,14 +6968,6 @@ window.noname_asset_list=[ 'image/character/mifangfushiren.jpg', 'image/character/mifuren.jpg', 'image/character/miheng.jpg', - 'image/character/mini_diaochan.jpg', - 'image/character/mini_jiangwei.jpg', - 'image/character/mini_lvbu.jpg', - 'image/character/mini_lvmeng.jpg', - 'image/character/mini_sunquan.jpg', - 'image/character/mini_zhangchunhua.jpg', - 'image/character/mini_zhugeliang.jpg', - 'image/character/mini_zuoci.jpg', 'image/character/mizhu.jpg', 'image/character/mtg_ayeni.jpg', 'image/character/mtg_jiding.jpg', @@ -7070,6 +7076,7 @@ window.noname_asset_list=[ 'image/character/ol_wanglang.jpg', 'image/character/ol_wangrong.jpg', 'image/character/ol_weiyan.jpg', + 'image/character/ol_wenqin.jpg', 'image/character/ol_wuyi.jpg', 'image/character/ol_xiahouyuan.jpg', 'image/character/ol_xiaoqiao.jpg', @@ -7465,6 +7472,7 @@ window.noname_asset_list=[ 'image/character/shen_caocao.jpg', 'image/character/shen_caopi.jpg', 'image/character/shen_dengai.jpg', + 'image/character/shen_dianwei.jpg', 'image/character/shen_diaochan.jpg', 'image/character/shen_ganning.jpg', 'image/character/shen_guanyu.jpg', @@ -7889,6 +7897,7 @@ window.noname_asset_list=[ 'image/character/xinpi.jpg', 'image/character/xinping.jpg', 'image/character/xinxianying.jpg', + 'image/character/xizheng.jpg', 'image/character/xizhicai.jpg', 'image/character/xuangongzhu.jpg', 'image/character/xuelingyun.jpg', diff --git a/game/game.js b/game/game.js index 12a2362e0..a693edc93 100644 --- a/game/game.js +++ b/game/game.js @@ -61,6 +61,7 @@ }, renku:[], prehidden_skills:[], + postReconnect:{}, }; var lib={ configprefix:'noname_0.9_', @@ -853,7 +854,7 @@ name:'布局', init:'mobile', item:{ - default:'旧版', + //default:'旧版', newlayout:'对称', mobile:'默认', long:'宽屏', @@ -2795,7 +2796,7 @@ } } }, - textequip:{ + /*textequip:{ name:'装备显示', init:'image', unfrequent:true, @@ -2812,7 +2813,7 @@ ui.arena.classList.remove('textequip'); } } - }, + },*/ buttoncharacter_style:{ name:'选将样式', init:'default', @@ -2958,12 +2959,12 @@ // } } if(lib.config.layout=='long'||lib.config.layout=='mobile'){ - map.textequip.show(); + //map.textequip.show(); map.cardshape.show(); map.phonelayout.show(); } else{ - map.textequip.hide(); + //map.textequip.hide(); if(lib.config.layout=='long2'||lib.config.layout=='nova'){ map.phonelayout.show(); map.cardshape.show(); @@ -7465,6 +7466,25 @@ } }); } + if(!Object.values){ + Object.defineProperty(Object, 'values', { + configurable:true, + enumerable:false, + writable:true, + value:function(obj){ + if(obj!== Object(obj)) { + throw new TypeError('Object.values called on a non-object'); + } + var values=[]; + for(var key in obj) { + if(obj.hasOwnProperty(key)){ + values.push(obj[key]); + } + } + return values; + } + }); + } window.onkeydown=function(e){ if(!ui.menuContainer||!ui.menuContainer.classList.contains('hidden')){ if(e.keyCode==116||((e.ctrlKey||e.metaKey)&&e.keyCode==82)){ @@ -7924,7 +7944,7 @@ }; var layout=lib.config.layout; - if(lib.layoutfixed.indexOf(lib.config.mode)!==-1){ + if(layout=='default'||lib.layoutfixed.indexOf(lib.config.mode)!==-1){ layout='mobile'; } if(layout=='phone'){ @@ -7989,13 +8009,10 @@ } } }; - if(lib.config.layout!='default'){ - ui.css.layout=lib.init.css(lib.assetURL+'layout/'+layout,'layout',styleLoaded); - } - else{ - ui.css.layout=lib.init.css(); - styleToLoad--; + if(lib.config.layout=='default'){ + lib.config.layout='mobile'; } + ui.css.layout=lib.init.css(lib.assetURL+'layout/'+layout,'layout',styleLoaded); if(get.is.phoneLayout()){ ui.css.phone=lib.init.css(lib.assetURL+'layout/default','phone',styleLoaded); } @@ -8951,7 +8968,12 @@ lib[j][k].addArray(character[i][j][k]); } else{ - console.log('dublicate '+j+' in character '+i+':\n'+k+'\n'+': '+lib[j][k]+'\n'+character[i][j][k]); + console.log( + `dublicate ${j} in character ${i}:\n${k}:\nlib.${j}.${k}`, + lib[j][k], + `\ncharacter.${i}.${j}.${k}`, + character[i][j][k] + ); } } } @@ -9048,7 +9070,14 @@ lib[j][k]=card[i][j][k]; } } - else console.log('dublicate '+j+' in card '+i+':\n'+k+'\n'+lib[j][k]+'\n'+card[i][j][k]); + else{ + console.log( + `dublicate ${j} in card ${i}:\n${k}:\nlib.${j}.${k}`, + lib[j][k], + `\ncard.${i}.${j}.${k}`, + card[i][j][k] + ); + } if(j=='card'&&lib[j][k].derivation){ if(!lib.cardPack.mode_derivation){ lib.cardPack.mode_derivation=[k]; @@ -9118,7 +9147,12 @@ } else{ if(lib[j][k]!=undefined){ - console.log('dublicate '+j+' in play '+i+':\n'+k+'\n'+': '+lib[j][k]+'\n'+play[i][j][k]); + console.log( + `dublicate ${j} in play ${i}:\n${k}:\nlib.${j}.${k}`, + lib[j][k], + `\nplay.${i}.${j}.${k}`, + play[i][j][k] + ); } lib[j][k]=play[i][j][k]; } @@ -9562,6 +9596,7 @@ } }, layout:function(layout,nosave){ + if(layout=='default') layout='mobile'; if(!nosave) game.saveConfig('layout',layout); game.layout=layout; ui.arena.hide(); @@ -9599,7 +9634,8 @@ ui.arena.classList.remove('oblongcard'); ui.window.classList.remove('oblongcard'); } - if(lib.config.textequip=='text'&&(game.layout=='long'||game.layout=='mobile')){ + //if(lib.config.textequip=='text'&&(game.layout=='long'||game.layout=='mobile')){ + if(game.layout=='long'||game.layout=='mobile'){ ui.arena.classList.add('textequip'); } else{ @@ -10560,9 +10596,10 @@ equip1:'武器', equip2:'防具', equip3:'防御马', + 'equip3_4':'坐骑', equip4:'攻击马', equip5:'宝物', - equip6:'坐骑', + equip6:'特殊装备', zero:'零', one:'一', two:'二', @@ -10667,12 +10704,248 @@ cooperation_use:'戮力', cooperation_use_info:'双方累计使用至少4种花色的牌', charge:'蓄力值', + expandedSlots:'扩展装备栏', }, element:{ content:{ emptyEvent:function(){ event.trigger(event.name); }, + //装备栏相关 + disableEquip:function(){ + 'step 0' + event.cards=[]; + event.num=0; + event.slotsx=[...new Set(event.slots)].sort(); + if(!event.slots.length) event.finish(); + 'step 1' + var slot=event.slotsx[event.num]; + var left=player.countEnabledSlot(slot),lose=Math.min(left,get.numOf(event.slots,slot)); + if(lose<=0) event.goto(3); + else{ + game.log(player,'废除了'+get.cnNumber(lose)+'个','#g'+get.translation(slot)+'栏'); + if(!player.disabledSlots) player.disabledSlots={}; + if(!player.disabledSlots[slot]) player.disabledSlots[slot]=0; + player.disabledSlots[slot]+=lose; + var cards=player.getEquips(slot).filter(card=>!event.cards.contains(card)); + if(cards.length>0){ + if(lose>=left){ + event._result={bool:true,links:cards}; + } + else if(cards.length>(left-lose)){ + var source=event.source,num=(cards.length-(left-lose)); + if(!source||!source.isIn()) source=player; + source.chooseButton([ + '选择'+(player==source?'你':get.translation(player))+'的'+get.cnNumber(num)+'张'+get.translation(slot)+'牌置入弃牌堆', + cards, + ],true,[1,num]).set('filterOk',function(){ + var evt=_status.event; + return ui.selected.buttons.reduce(function(num,button){ + return num+get.numOf(get.subtypes(button.link,false),evt.slot) + },0)==evt.required; + }).set('required',num).set('slot',slot) + } + else event.goto(3); + } + else event.goto(3) + } + 'step 2' + if(result.bool) event.cards.addArray(result.links); + 'step 3' + event.num++; + if(event.num0) player.loseToDiscardpile(cards); + } + }, + enableEquip:function(){ + if(!event.slots.length) return; + var slotsx=[...new Set(event.slots)].sort(); + for(var slot of slotsx){ + var lost=player.countDisabledSlot(slot),gain=Math.min(lost,get.numOf(event.slots,slot)); + if(lost<=0) continue; + else{ + game.log(player,'恢复了'+get.cnNumber(gain)+'个','#g'+get.translation(slot)+'栏'); + if(!player.disabledSlots) player.disabledSlots={}; + if(!player.disabledSlots[slot]) player.disabledSlots[slot]=0; + player.disabledSlots[slot]-=gain; + } + } + player.$syncDisable(); + }, + expandEquip:function(){ + if(!event.slots.length) return; + var slotsx=[...new Set(event.slots)].sort(); + for(var slot of slotsx){ + var expand=get.numOf(event.slots,slot); + game.log(player,'获得了'+get.cnNumber(expand)+'个额外的','#g'+get.translation(slot)+'栏'); + if(!player.expandedSlots) player.expandedSlots={}; + if(!player.expandedSlots[slot]) player.expandedSlots[slot]=0; + player.expandedSlots[slot]+=expand; + } + player.$syncExpand(); + }, + //选择顶装备要顶的牌 + replaceEquip:function(){ + 'step 0' + event.cards=[]; + var types=get.subtypes(card,false); + if(types.length){ + var info=get.info(card,false); + if(info.customSwap){ + event.cards.addArray(player.getCards('e',function(card){ + return info.customSwap(card); + })); + event.goto(4); + } + else{ + event.num=0; + event.slots=types; + event.slotsx=[...new Set(event.slots)].sort(); + } + } + else event.goto(4); + 'step 1' + var slot=event.slotsx[event.num]; + var left=player.countEquipableSlot(slot),lose=Math.min(left,get.numOf(event.slots,slot)); + if(lose<=0) event.goto(3); + else{ + var cards=player.getEquips(slot).filter(card=>{ + return !event.cards.contains(card)&&lib.filter.canBeReplaced(card,player); + }); + if(cards.length>0){ + if(lose>=left){ + event._result={bool:true,links:cards}; + } + else if(cards.length>(left-lose)){ + var source=event.source,num=(cards.length-(left-lose)); + if(!source||!source.isIn()) source=player; + source.chooseButton([ + '选择替换掉'+get.cnNumber(num)+'张'+get.translation(slot)+'牌', + cards, + ],true,[1,num]).set('filterOk',function(){ + var evt=_status.event; + return ui.selected.buttons.reduce(function(num,button){ + return num+get.numOf(get.subtypes(button.link,false),evt.slot) + },0)==evt.required; + }).set('required',num).set('slot',slot) + } + else event.goto(3); + } + else event.goto(3) + } + 'step 2' + if(result.bool) event.cards.addArray(result.links); + 'step 3' + event.num++; + if(event.num'; + var str=get.translation(player)+'正在演奏《'+beatmap.name+'》...'; + if(!_status.connectMode) str+='
(点击屏幕可以跳过等待AI操作)'; ui.create.dialog(str).videoId=id; if(ui.backgroundMusic) ui.backgroundMusic.pause(); if(lib.config.background_audio){ @@ -10836,8 +11110,23 @@ //初始化一堆变量 var score=0; var added=timeleap.length; + var number_of_tracks=beatmap.number_of_tracks||6; + var custom_mapping=Array.isArray(beatmap.mapping); + var mapping=custom_mapping?beatmap.mapping.slice():beatmap.mapping; + var hitsound=beatmap.hitsound||'hitsound.wav'; + if(hitsound.indexOf('ext:')==0) hitsound=lib.assetURL+'extension/'+hitsound.slice(4); + else hitsound=lib.assetURL+'audio/effect/'+hitsound; + var hitsound_audio=new Audio(hitsound); + hitsound_audio.volume=0.25; var abs=1; var node_pos=0; + if(custom_mapping){ + node_pos=mapping.shift(); + } + else if(mapping=='random'){ + abs=get.rand(number_of_tracks); + node_pos=abs; + } var combo=0; var max_combo=0; var nodes=[]; @@ -10868,6 +11157,10 @@ event.settleed=true; //评分 var acc=Math.floor(score/(added*5)*100); + if(!Array.isArray(lib.config.choose_to_play_beatmap_accuracies)) lib.config.choose_to_play_beatmap_accuracies=[]; + lib.config.choose_to_play_beatmap_accuracies.push(acc); + if(lib.config.choose_to_play_beatmap_accuracies.length>5) lib.config.choose_to_play_beatmap_accuracies.shift(); + game.saveConfigValue("choose_to_play_beatmap_accuracies"); var rank; if(acc==100) rank=['SS','metal']; else if(acc>=94) rank=['S','orange']; @@ -10888,7 +11181,8 @@ game.resume(); _status.imchoosing=false; if(roundmenu) ui.roundmenu.style.display=''; - if(ui.backgroundMusic) ui.backgroundMusic.play(); + if(ui.backgroundMusic) ui.backgroundMusic.play().catch(()=>void 0); + hitsound_audio.remove(); },1000); }; event.dialog.open(); @@ -10919,11 +11213,11 @@ node.style["border-radius"]='3px'; node.style.position='absolute'; node.style.height=Math.ceil(height/10)+'px'; - node.style.width=Math.ceil(width/6)-10+'px'; + node.style.width=Math.ceil(width/number_of_tracks)-10+'px'; node._position=get.utc(); event.dialog.appendChild(node); - node.style.left=Math.ceil(width*node_pos/6+5)+'px'; + node.style.left=Math.ceil(width*node_pos/number_of_tracks+5)+'px'; node.style.top='-'+(Math.ceil(height/10))+'px'; ui.refresh(node); node.style.transition='all '+speed*110+'ms linear'; @@ -10937,14 +11231,25 @@ } },speed*110); - node_pos+=abs; - if(node_pos>5){ - abs=-1; - node_pos=4; + if(custom_mapping){ + node_pos=mapping.shift(); } - else if(node_pos<0){ - abs=1; - node_pos=1; + else if(mapping=='random'){ + while(node_pos==abs){ + node_pos=get.rand(number_of_tracks); + } + abs=node_pos; + } + else{ + node_pos+=abs; + if(node_pos>number_of_tracks-1){ + abs=-1; + node_pos=number_of_tracks-2; + } + else if(node_pos<0){ + abs=1; + node_pos=1; + } } if(timeleap.length){ setTimeout(function(){ @@ -10990,6 +11295,8 @@ if(player.damagepopups.length) player.$damagepop(); combo++; max_combo=Math.max(combo,max_combo); + hitsound_audio.currentTime=0; + if(hitsound_audio.paused) hitsound_audio.play(); break; } }; @@ -11013,9 +11320,16 @@ else{ game.pause(); game.countChoose(); - setTimeout(function(){ + var settle=function(){ _status.imchoosing=false; - var acc=get.rand.apply(get,beatmap.aiAcc||[70,100]); + //Algorithm: Generate the random number range using the mean and the half standard deviation of accuracies of the player's last 5 plays + //算法:用玩家的上5次游玩的准确率的平均数和半标准差生成随机数范围 + var choose_to_play_beatmap_accuracies=(lib.config.choose_to_play_beatmap_accuracies||[]).concat(Array.from({ + length:6-(lib.config.choose_to_play_beatmap_accuracies||[]).length + },()=>get.rand(70,100))); + var mean=Math.round(choose_to_play_beatmap_accuracies.reduce((previousValue,currentValue)=>previousValue+currentValue)/choose_to_play_beatmap_accuracies.length); + var half_standard_deviation=Math.round(Math.sqrt(choose_to_play_beatmap_accuracies.reduce((previousValue,currentValue)=>previousValue+Math.pow(currentValue-mean,2),0))/2); + var acc=Math.min(Math.max(get.rand.apply(get,beatmap.aiAcc||[mean-half_standard_deviation-get.rand(0,half_standard_deviation),mean+half_standard_deviation+get.rand(0,half_standard_deviation)]),0),100); var rank; if(acc==100) rank=['SS','metal']; else if(acc>=94) rank=['S','orange']; @@ -11031,7 +11345,23 @@ if(event.dialog) event.dialog.close(); if(event.control) event.control.close(); game.resume(); - },beatmap.timeleap[beatmap.timeleap.length-1]+beatmap.speed*100+1000+(beatmap.current||0)); + }; + var song_duration=beatmap.timeleap[beatmap.timeleap.length-1]+beatmap.speed*100+1000+(beatmap.current||0); + var settle_timeout=setTimeout(settle,song_duration); + if(!_status.connectMode) { + var skip_timeout; + var skip=()=>{ + settle(); + Array.from(ui.window.getElementsByTagName('audio')).forEach(value=>{ + if(value.currentSrc.indexOf(beatmap.filename.indexOf('ext:')==0?beatmap.name:beatmap.filename)>-1) value.remove(); + }); + document.removeEventListener(lib.config.touchscreen?'touchend':'click',skip); + clearTimeout(settle_timeout); + clearTimeout(skip_timeout); + }; + document.addEventListener(lib.config.touchscreen?'touchend':'click',skip); + skip_timeout=setTimeout(()=>document.removeEventListener(lib.config.touchscreen?'touchend':'click',skip),song_duration); + } } 'step 2' game.broadcastAll(function(id,time){ @@ -11040,7 +11370,7 @@ if(dialog){ dialog.close(); } - if(ui.backgroundMusic) ui.backgroundMusic.play(); + if(ui.backgroundMusic) ui.backgroundMusic.play().catch(()=>void 0); },event.videoId,event.time); var result=event.result||result; event.result=result; @@ -11555,9 +11885,8 @@ chooseToEnable:function(){ 'step 0' var list=[]; - for(var i=1;i<6;i++){ - if(!player.isDisabled(i)) continue; - list.push('equip'+i); + for(var i=1;i<=5;i++){ + if(player.hasDisabledSlot(i)) list.push('equip'+i); } if(!list.length) event.finish(); else if(list.length==1){ @@ -11582,11 +11911,13 @@ chooseToDisable:function(){ 'step 0' var list=[]; - for(var i=1;i<7;i++){ - if((i==3||i==4)&&event.horse) continue; - if(i==6&&!event.horse) continue; - if(player.isDisabled(i)) continue; - list.push('equip'+i); + for(var i=1;i<=5;i++){ + if(player.hasEnabledSlot(i)) list.push('equip'+i); + } + if(event.horse){ + if(list.contains('equip3')&&list.contains('equip4')) list.push('equip3_4'); + list.remove('equip3'); + list.remove('equip4'); } if(!list.length) event.finish(); else if(list.length==1){ @@ -11594,6 +11925,7 @@ event._result={control:list[0]}; } else{ + list.sort(); event.list=list; var next=player.chooseControl(list); next.set('prompt','请选择废除一个装备栏'); @@ -11607,34 +11939,22 @@ } 'step 1' event.result={control:result.control}; - if(result.control=='equip6'){ - player.disableEquip(3); - player.disableEquip(4); + if(result.control=='equip3_4'){ + player.disableEquip(3,4); } else player.disableEquip(result.control); }, swapEquip:function(){ "step 0" game.log(player,'和',target,'交换了装备区中的牌') - var e1=player.getCards('e'); - var todis1=[]; - for(var i=0;i0) return 9; } @@ -15429,7 +15805,7 @@ if(current!=target&&get.attitude(player,current)>0){ var es=target.getCards('e'); for(var i=0;i0&¤t.isEmpty(get.subtype(es[i]))&&get.effect(current,es[i],player,player)>0) return true; + if(get.value(es[i],target)>0&¤t.canEquip(es[i])&&get.effect(current,es[i],player,player)>0) return true; } } })){ @@ -15445,7 +15821,7 @@ if(sgnatt!=0&&att2!=0&&sgnatt!=att2&& get.sgn(get.value(es[i],ui.selected.targets[0]))==-att2&& get.sgn(get.effect(target,es[i],player,target))==sgnatt&& - target.isEmpty(get.subtype(es[i]))){ + target.canEquip(es[i])){ return Math.abs(att); } } @@ -15494,7 +15870,7 @@ return targets1.canAddJudge(button.link); } else{ - return targets1.isEmpty(get.subtype(button.link)); + return targets1.canEquip(button.link); } }); } @@ -17595,105 +17971,6 @@ source.classList.add('topcount'); } }, - equip:function(){ - "step 0" - var owner=get.owner(card) - if(owner){ - event.owner=owner; - owner.lose(card,ui.special,'visible').set('type','equip').set('getlx',false); - } - else if(get.position(card)=='c') event.updatePile=true; - "step 1" - if(event.cancelled){ - event.finish(); - return; - } - if(card.destroyed){ - if(player.hasSkill(card.destroyed)){ - delete card.destroyed; - } - else{ - event.finish(); - return; - } - } - else if(event.owner){ - if(event.owner.getCards('hejsx').contains(card)){ - event.finish(); - return; - } - } - if(event.draw){ - game.delay(0,300); - player.$draw(card); - } - "step 2" - if(card.clone){ - game.broadcast(function(card,player){ - if(card.clone){ - card.clone.moveDelete(player); - } - },card,player); - card.clone.moveDelete(player); - game.addVideo('gain2',player,get.cardsInfo([card.clone])); - } - player.equiping=true; - "step 3" - var info=get.info(card,false); - var current=player.getCards('e',function(card){ - if(info.customSwap) return info.customSwap(card); - return get.subtype(card,false)==info.subtype; - }); - if(current.length){ - player.lose(current,false,'visible').set('type','equip').set('getlx',false).swapEquip=true; - if(info.loseThrow){ - player.$throw(current); - } - event.swapped=true; - //event.redo(); - } - "step 4" - if(player.isMin() || player.countCards('e',{subtype:get.subtype(card)})){ - event.finish(); - game.cardsDiscard(card); - delete player.equiping; - return; - } - var subtype=get.subtype(card); - if(subtype=='equip6') subtype='equip3'; - game.broadcastAll(function(type){ - if(lib.config.background_audio){ - game.playAudio('effect',type); - } - },subtype); - player.$equip(card); - game.addVideo('equip',player,get.cardInfo(card)); - game.log(player,'装备了',card); - if(event.updatePile) game.updateRoundNumber(); - "step 5" - var info=get.info(card,false); - if(info.onEquip&&(!info.filterEquip||info.filterEquip(card,player))){ - if(Array.isArray(info.onEquip)){ - for(var i=0;i0; + }, + //判断一名角色的某个区域被废除的数量 + //用法同上 + countDisabledSlot:function(type){ + var player=this; + var map=(player.disabledSlots||{}); + if(type==undefined){ + num=0; + for(var i=1;i<=5;i++){ + num+=player.countDisabledSlot(i); + } + return num; + } + else{ + if(typeof type=='number') type=('equip'+type); + var num=map[type]; + if(typeof num=='number'&&num>0) return num; + return 0; + } + }, + //判断一名角色是否有某个装备栏空着 + hasEmptySlot:function(type){ + var player=this; + if(type=='horse') return player.hasEmptySlot(3)&&player.hasEmptySlot(4); + return player.countEmptySlot(type)>0; + }, + //判断一名角色的某个装备栏空位的数量 + countEmptySlot:function(type){ + if(!type) return 0; + var player=this; + if(typeof type=='number') type=('equip'+type); + return Math.max(0,player.countEnabledSlot(type)-player.getEquips(type).reduce(function(num,card){ + var types=get.subtypes(card,false); + return num+get.numOf(types,type); + },0)) + }, + //判断一名角色是否有可以用于装备新装备牌的区域(排除金箍棒和六龙等“不可被替换装备”) + //用法同下 + hasEquipableSlot:function(type){ + return this.countEquipableSlot(type)>0; + }, + //统计一名角色有多少个可以用于装备新的装备牌的区域 + //用法同下 + countEquipableSlot:function(type){ + if(!type) return 0; + var player=this; + if(typeof type=='number') type=('equip'+type); + return Math.max(0,player.countEnabledSlot(type)-player.getEquips(type).reduce(function(num,card){ + var types=get.subtypes(card,false); + if(!lib.filter.canBeReplaced(card,player)) num+=get.numOf(types,type); + return num; + },0)) + }, + //判断一名角色是否拥有未被废除的某个区域 + //type为要判断的区域 若为空 则判断玩家是否有任意一个未被废除的区域 + hasEnabledSlot:function(type){ + var player=this; + if(type=='horse') return player.hasEnabledSlot(3)&&player.hasEnabledSlot(4); + return player.countEnabledSlot(type)>0; + }, + //判断一名角色的某个区域未被废除的数量 + //用法同上 + countEnabledSlot:function(type){ + var player=this; + var map=(player.expandedSlots||{}); + if(!type){ + num=0; + for(var i=1;i<=5;i++){ + num+=player.countEnabledSlot(i); + } + return num; + } + else{ + if(typeof type=='number') type=('equip'+type); + var slots=1; + var num=map[type]; + if(typeof num=='number'&&num>0) slots+=num; + slots-=player.countDisabledSlot(type); + return slots; + } + }, + //获取一名角色装备区内某种类型的装备牌 + //参数可以为数字/区域字符串/实体牌/虚拟牌/牌名 + getEquips:function(subtype){ + var type=(typeof subtype); + switch(type){ + case 'string': + if(subtype.indexOf('equip')==0&&parseInt(subtype.slice(5))>0){ + break; + } + else if(lib.card[subtype]){ + return this.getCards('e',card=>card.name==subtype); + } + else return []; + case 'number': + subtype='equip'+subtype; + break; + case 'object': + subtype=get.subtype(subtype,false); + break; + default: + return []; + } + if(!subtype) return []; + return this.getCards('e',function(card){ + return get.subtypes(card,false).contains(subtype); + }) + }, + //新的废除装备区/恢复装备区/扩展装备区 + //参数:废除来源角色(不写默认当前事件角色),废除区域(数字/区域字符串/数组,可以写多个,重复废除) + disableEquip:function(){ + var next=game.createEvent('disableEquip'); + next.player=this; + next.slots=[]; + for(var i=0;i0) next.slots.push(arg); + } + else if(typeof arg=='number'){ + next.slots.push('equip'+arg); + } + } + } + else if(typeof arguments[i]=='string'){ + if(arguments[i].indexOf('equip')==0&&parseInt(arguments[i].slice(5))>0) next.slots.push(arguments[i]); + } + else if(typeof arguments[i]=='number'){ + next.slots.push('equip'+arguments[i]); + } + } + if(!next.source) next.source=_status.event.player; + if(!next.slots.length){ + _status.event.next.remove(next); + } + next.setContent('disableEquip'); + return next; + }, + enableEquip:function(){ + var next=game.createEvent('enableEquip'); + next.player=this; + next.slots=[]; + for(var i=0;i0) next.slots.push(arg); + } + else if(typeof arg=='number'){ + next.slots.push('equip'+arg); + } + } + } + else if(typeof arguments[i]=='string'){ + if(arguments[i].indexOf('equip')==0&&parseInt(arguments[i].slice(5))>0) next.slots.push(arguments[i]); + } + else if(typeof arguments[i]=='number'){ + next.slots.push('equip'+arguments[i]); + } + } + if(!next.source) next.source=_status.event.player; + if(!next.slots.length){ + _status.event.next.remove(next); + } + next.setContent('enableEquip'); + return next; + }, + expandEquip:function(){ + var next=game.createEvent('expandEquip'); + next.player=this; + next.slots=[]; + for(var i=0;i0) next.slots.push(arg); + } + else if(typeof arg=='number'){ + next.slots.push('equip'+arg); + } + } + } + else if(typeof arguments[i]=='string'){ + if(arguments[i].indexOf('equip')==0&&parseInt(arguments[i].slice(5))>0) next.slots.push(arguments[i]); + } + else if(typeof arguments[i]=='number'){ + next.slots.push('equip'+arguments[i]); + } + } + if(!next.source) next.source=_status.event.player; + if(!next.slots.length){ + _status.event.next.remove(next); + } + next.setContent('expandEquip'); + return next; + }, + //判断判定区是否被废除 + isDisabledJudge:function(){ + return Boolean(this.storage._disableJudge); + }, + //同步显示扩展装备区状态 + $syncExpand:function(map){ + var player=this; + if(!map){ + map=(player.expandedSlots||{}); + } + game.addVideo('$syncExpand',player,get.copy(map)) + game.broadcast(function(player,map){ + player.expandedSlots=map; + player.$syncExpand(map); + },player,map); + player.markSkill('expandedSlots'); + }, + //同步装备区废除牌显示状态 + $syncDisable:function(map){ + var player=this; + var suits={equip3:'+1马栏',equip4:'-1马栏',equip6:'特殊栏'}; + if(!map){ + map=(player.disabledSlots||{}); + } + game.addVideo('$syncDisable',player,get.copy(map)) + game.broadcast(function(player,map){ + player.disabledSlots=map; + player.$syncDisable(map); + },player,map) + var map2=get.copy(map); + var cards=Array.from(player.node.equips.childNodes); + for(var card of cards){ + if(card.name.indexOf('feichu_')==0){ + var index=card.name.slice(7); + if(!map2[index]) map2[index]=0; + map2[index]--; + } + } + for(var index in map2){ + if(index.indexOf('equip')!=0||!(parseInt(index.slice(5))>0)) continue; + var num=map2[index]; + if(num>0){ + for(var i=0;i=equipNum){ + player.node.equips.insertBefore(card,player.node.equips.childNodes[j]); + equipped=true; + break; + } + } + if(!equipped){ + player.node.equips.appendChild(card); + if(_status.discarded){ + _status.discarded.remove(card); + } + } + } + } + else if(num<0){ + for(var i=0;i>num;i--){ + var card=cards.find(card=>card.name=='feichu_'+index); + if(card){ + player.node.equips.removeChild(card); + cards.remove(card); + } + } + } + } + }, + //以下函数涉及到本次更新内容而进行修改 + canEquip:function(name,replace){ + var ranges=get.subtypes(name),rangex=[...new Set(ranges)],player=this; + for(var range of rangex){ + var num=this.countEquipableSlot(range); + var num2=get.numOf(rangex,range); + if(!replace) num-=this.getEquips(range).filter(card=>lib.filter.canBeReplaced(card,player)).length; + if(numthis.getEquips(num); + }, + //以下函数将被废弃 + $disableEquip:function(){}, + $enableEquip:function(){}, + //装备区End chooseToDebate:function(){ var next=game.createEvent('chooseToDebate'); next.player=this; @@ -18468,8 +19060,11 @@ inRangeOf:function(source){ return source.inRange(this); }, + getHp:function(){ + return Math.max(0,this.hp); + }, getDamagedHp:function(){ - return this.maxHp-Math.max(0,this.hp); + return this.maxHp-this.getHp(); }, changeGroup:function(group,log,broadcast){ var next=game.createEvent('changeGroup'); @@ -18517,10 +19112,6 @@ next.setContent('chooseToDisable'); return next; }, - countDisabled:function(){ - if(!this.storage.disableEquip) return 0; - return this.storage.disableEquip.length; - }, isPhaseUsing:function(notmeisok){ if(!notmeisok&&_status.currentPhase!=this) return false; return _status.event.name=='phaseUse'||_status.event.getParent('phaseUse').name=='phaseUse'; @@ -18538,90 +19129,11 @@ if(this.hasSkillTag('noCompareSource')||target.hasSkillTag('noCompareTarget')) return false; return true; }, - disableEquip:function(pos){ - if(typeof pos=='number') pos='equip'+pos; - var next=game.createEvent('disableEquip'); - next.player=this; - next.pos=pos; - next.source=_status.event.player; - next.setContent('disableEquip'); - return next; - }, - $disableEquip:function(skill){ - game.broadcast(function(player,skill){ - player.$disableEquip(skill); - },this,skill); - var player=this; - if(!player.storage.disableEquip) player.storage.disableEquip=[]; - player.storage.disableEquip.add(skill); - player.storage.disableEquip.sort(); - var pos={equip1:'武器栏',equip2:'防具栏',equip3:'+1马栏',equip4:'-1马栏',equip5:'宝物栏'}[skill]; - if(!pos) return; - var card=game.createCard('feichu_'+skill,pos,''); - card.fix(); - card.style.transform=''; - card.classList.remove('drawinghidden'); - card.classList.add('feichu'); - delete card._transform; - var equipNum=get.equipNum(card); - var equipped=false; - for(var i=0;i=equipNum){ - player.node.equips.insertBefore(card,player.node.equips.childNodes[i]); - equipped=true; - break; - } - } - if(!equipped){ - player.node.equips.appendChild(card); - if(_status.discarded){ - _status.discarded.remove(card); - } - } - return player; - }, - enableEquip:function(pos){ - if(typeof pos=='number') pos='equip'+pos; - var next=game.createEvent('enableEquip'); - next.player=this; - next.pos=pos; - next.source=_status.event.player; - next.setContent('enableEquip'); - return next; - }, - $enableEquip:function(skill){ - game.broadcast(function(player,skill){ - player.$enableEquip(skill); - },this,skill); - var player=this; - if(player.storage.disableEquip) player.storage.disableEquip.remove(skill); - for(var i=0;i=equipNum){ + player.node.equips.insertBefore(card,player.node.equips.childNodes[i]); + equipped=true; + break; + } } - else{ - game.broadcast(function(player,card){ - player.$equip(card); - },this,card); - card.fix(); - card.style.transform=''; - card.classList.remove('drawinghidden'); - delete card._transform; - var player=this; - var equipNum=get.equipNum(card); - var equipped=false; - for(var i=0;i=equipNum){ - player.node.equips.insertBefore(card,player.node.equips.childNodes[i]); - equipped=true; - break; - } + if(!equipped){ + player.node.equips.appendChild(card); + if(_status.discarded){ + _status.discarded.remove(card); } - if(!equipped){ - player.node.equips.appendChild(card); - if(_status.discarded){ - _status.discarded.remove(card); - } + } + var info=get.info(card); + if(info.skills){ + for(var i=0;i'; - } + this.node.name.innerHTML=name; if(name.length>=5){ this.node.name.classList.add('long'); if(name.length>=7){ @@ -27837,6 +28335,13 @@ all:function(){ return true; }, + //装备栏相关 + canBeReplaced:function(card,player){ + var mod=game.checkMod(card,player,'unchanged','canBeReplaced',player); + if(mod!='unchanged') return mod; + return true; + }, + //装备栏 END buttonIncluded:function(button){ return !(_status.event.excludeButton&&_status.event.excludeButton.contains(button)); }, @@ -28384,6 +28889,36 @@ } }, skill:{ + expandedSlots:{ + markimage:'image/card/expandedSlots.png', + intro:{ + markcount:function(storage,player){ + var all=0,storage=player.expandedSlots; + if(!storage) return 0; + for(var key in storage){ + var num=storage[key]; + if(typeof num=='number'&&num>0){ + all+=num; + } + } + return all; + }, + content:function(storage,player){ + storage=player.expandedSlots; + if(!storage) return '当前没有扩展装备栏'; + var keys=Object.keys(storage).sort(); + var str=''; + for(var key of keys){ + var num=storage[key]; + if(typeof num=='number'&&num>0){ + str+='
  • '+get.translation(key)+'栏:'+num+'个
    ' + } + } + if(str.length) return str.slice(0,str.length-4); + return '当前没有扩展装备栏'; + }, + }, + }, charge:{ markimage:'image/card/charge.png', intro:{ @@ -29067,48 +29602,6 @@ }, group:['dualside_init','dualside_turn'] }, - _disableJudge:{ - marktext:"废", - intro:{ - content:"已经废除了判定区", - }, - mod:{ - targetEnabled:function(card,player,target){ - if(target.storage._disableJudge&&get.type(card)=='delay') return false; - }, - }, - }, - "_disableEquip":{ - marktext:"废", - intro:{ - content:function(storage,player,skill){ - var str=''; - for(var i=0;ibeats.map(value=>Math.round(value*60000/bpm+(offset||0))), updateRenku:function(){ game.broadcast(function(renku){ _status.renku=renku; @@ -32133,6 +32631,20 @@ } } }, + $syncDisable:function(player,map){ + player.disabledSlots=map; + player.$syncDisable(map) + }, + $syncExpand:function(player,map){ + player.expandedSlots=map; + player.$syncExpand(map) + }, + $disableJudge:function(player,map){ + player.$disableJudge() + }, + $enableJudge:function(player,map){ + player.$enableJudge() + }, jiuNode:function(player,bool){ //Powered by 升麻 if(bool){ @@ -37073,7 +37585,8 @@ if(card.enable==undefined) card.enable=true; if(card.selectTarget==undefined) card.selectTarget=-1; if(card.filterTarget==undefined) card.filterTarget=function(card,player,target){ - return target==player; + if(player!=target) return false; + return target.canEquip(card,true); }; if(card.modTarget==undefined) card.modTarget=true; if(card.allowMultiple==undefined) card.allowMultiple=false; @@ -37101,7 +37614,7 @@ if(card.ai.basic.equipValue==undefined) card.ai.basic.equipValue=1; } if(card.ai.basic.value==undefined) card.ai.basic.value=function(card,player,index,method){ - if(player.isDisabled(get.subtype(card))) return 0.01; + if(!player.canEquip(card)) return 0.01; var value=0; var info=get.info(card); var current=player.getEquip(info.subtype); @@ -37141,8 +37654,9 @@ var name=arguments[arguments.length-2]; var skills=arguments[arguments.length-1]; if(skills.getSkills){ - if(name!='cardname') skills=skills.getSkills(); - else skills=skills.getSkills(null,false); + //if(name!='cardname') skills=skills.getSkills(); + //else skills=skills.getSkills(null,false); + skills=skills.getSkills(); } skills=skills.concat(lib.skill.global); game.expandSkills(skills); @@ -46777,7 +47291,8 @@ } ui.window.dataset.radius_size=lib.config.radius_size||'default'; if(game.layout=='long'||game.layout=='mobile'){ - if(lib.config.textequip=='text') ui.arena.classList.add('textequip'); + //if(lib.config.textequip=='text') ui.arena.classList.add('textequip'); + ui.arena.classList.add('textequip'); } if(game.layout=='long'||game.layout=='long2'||game.layout=='mobile'||game.layout=='nova'){ if(lib.config.cardshape=='oblong'){ @@ -47767,6 +48282,8 @@ node.tempSkills={}; node.storage={}; node.marks={}; + node.expandedSlots={}; + node.disabledSlots={}; node.ai={friend:[],enemy:[],neutral:[],handcards:{global:[],source:[],viewed:[]}}; node.queueCount=0; node.outCount=0; @@ -52267,6 +52784,19 @@ }, }; var get={ + //新装备栏相关 + //获取一张装备牌实际占用的装备栏(君曹操六龙) + //用法同get.subtype,返回数组 + subtypes:function(obj,player){ + if(typeof obj=='string') obj={name:obj}; + if(typeof obj!='object') return; + var name=get.name(obj,player); + if(!lib.card[name]) return []; + if(lib.card[name].subtypes) return get.copy(lib.card[name].subtypes); + else if(lib.card[name].subtype) return [lib.card[name].subtype]; + return []; + }, + //装备栏 END pinyin:function(chinese,withtone){ const util=window.pinyinUtilx; if(!window.pinyinUtilx) return []; @@ -53790,22 +54320,7 @@ }, verticalStr:function(str,sp){ if(typeof str!='string') return ''; - str=str.toUpperCase(); - var str2=''; - var nobreak=false; - for(var i=0;ivalue!='`').join(''); }, numStr:function(num,method){ if(num==Infinity){ @@ -55008,7 +55523,7 @@ var i,translation,intro,str; if(node._nointro) return; if(typeof node._customintro=='function'){ - if(node._customintro(uiintro)===false) return; + if(node._customintro(uiintro,evt)===false) return; } else if(Array.isArray(node._customintro)){ var caption=node._customintro[0]; @@ -56263,11 +56778,14 @@ } var value1=get.equipValue(card,target); var value2=0; - var current=target.getEquip(card); - if(current&¤t!=card){ - value2=get.equipValue(current,target); - if(value2>0&&!target.needsToDiscard()&&!get.tag(card,'valueswap')){ - return 0; + if(!player.canEquip(card)){ + if(!player.canEquip(card,true)) return 0; + var current=target.getEquip(card); + if(current&¤t!=card){ + value2=get.equipValue(current,target); + if(value2>0&&!target.needsToDiscard()&&!get.tag(card,'valueswap')){ + return 0; + } } } return Math.max(0,value1-value2)/5; diff --git a/game/update.js b/game/update.js index 727bd3d11..ca8deb2b4 100644 --- a/game/update.js +++ b/game/update.js @@ -1,67 +1,69 @@ window.noname_update={ - version:'1.9.124.0.1', - update:'1.9.124', + version:'1.9.125', + update:'1.9.124.0.1', changeLog:[ - '整合@mengxinzxz @shijian的Pull Request', + '整合@Tipx-L @copcap @shijian @lieren2023 @mengxinzxz的Pull Request', + '神典韦,以及配套的一系列“额外装备栏”机制', + 'OL文钦、族王浑;十周年杜预、郤正', + '孙寒华新谱面+AI操作可跳过', 'bug修复', ], files:[ //'LICENSE', - //'card/extra.js', + 'card/extra.js', //'card/gujian.js', - //'card/guozhan.js', + 'card/guozhan.js', //'card/gwent.js', //'card/huanlekapai.js', //'card/mtg.js', - //'card/sp.js', - //'card/standard.js', + 'card/sp.js', + 'card/standard.js', //'card/swd.js', //'card/yunchou.js', //'card/yingbian.js', - //'card/yongjian.js', + 'card/yongjian.js', //'card/zhenfa.js', - //'card/zhulu.js', + 'card/zhulu.js', 'character/clan.js', - //'character/collab.js', + 'character/collab.js', 'character/ddd.js', - //'character/diy.js', - //'character/extra.js', - //'character/hearth.js', - //'character/huicui.js', + 'character/diy.js', + 'character/extra.js', //'character/gujian.js', //'character/gwent.js', - //'character/hearth.js', + //'character/hearth.js', + 'character/huicui.js', 'character/mobile.js', //'character/mtg.js', - //'character/offline.js', - //'character/old.js', + 'character/offline.js', + 'character/old.js', //'character/ow.js', - 'character/rank.js', - //'character/refresh.js', - //'character/sb.js', - //'character/shenhua.js', - //'character/shiji.js', + //'character/rank.js', + 'character/refresh.js', + 'character/sb.js', + 'character/shenhua.js', + 'character/shiji.js', 'character/sp.js', 'character/sp2.js', - //'character/standard.js', + 'character/standard.js', 'character/tw.js', //'character/swd.js', 'character/xianding.js', //'character/xianjian.js', - //'character/xinghuoliaoyuan.js', - //'character/yijiang.js', - //'character/yingbian.js', + 'character/xinghuoliaoyuan.js', + 'character/yijiang.js', + 'character/yingbian.js', //'character/yxs.js', //'extension/boss/extension.js', //'font/suits.ttf', - //'layout/default/layout.css', + 'layout/default/layout.css', //'layout/default/menu.css', //'layout/long2/layout.css', //'layout/mobile/equip.css', //'layout/mobile/layout.css', //'layout/newlayout/global.css', //'layout/nova/layout.css', - //'mode/boss.js', + 'mode/boss.js', //'mode/brawl.js', //'mode/chess.js', //'mode/connect.js', @@ -71,7 +73,7 @@ window.noname_update={ //'mode/single.js', //'mode/stone.js', //'mode/tafang.js', - //'mode/versus.js', + 'mode/versus.js', 'game/game.js', //'game/keyWords.js', //'game/NoSleep.js', @@ -80,6 +82,7 @@ window.noname_update={ //'game/pinyinjs.js', //'game/asset.js', //'game/source.js', + 'theme/simple/style.css', //'theme/style/hp/custom.css', //'theme/style/hp/emotion.css', //'theme/style/hp/glass.css', diff --git a/image/card/charge.png b/image/card/charge.png index 1e4e44f8b..5f85f33ab 100644 Binary files a/image/card/charge.png and b/image/card/charge.png differ diff --git a/image/card/expandedSlots.png b/image/card/expandedSlots.png new file mode 100644 index 000000000..e10a41649 Binary files /dev/null and b/image/card/expandedSlots.png differ diff --git a/image/character/clan_wanghun.jpg b/image/character/clan_wanghun.jpg new file mode 100644 index 000000000..324fdb7ba Binary files /dev/null and b/image/character/clan_wanghun.jpg differ diff --git a/image/character/clan_zhonghui.jpg b/image/character/clan_zhonghui.jpg new file mode 100644 index 000000000..6eed72eb0 Binary files /dev/null and b/image/character/clan_zhonghui.jpg differ diff --git a/image/character/dc_duyu.jpg b/image/character/dc_duyu.jpg new file mode 100644 index 000000000..96c2be1d8 Binary files /dev/null and b/image/character/dc_duyu.jpg differ diff --git a/image/character/mini_diaochan.jpg b/image/character/mini_diaochan.jpg deleted file mode 100644 index 8c28a0e12..000000000 Binary files a/image/character/mini_diaochan.jpg and /dev/null differ diff --git a/image/character/mini_jiangwei.jpg b/image/character/mini_jiangwei.jpg deleted file mode 100644 index 2fb857cf4..000000000 Binary files a/image/character/mini_jiangwei.jpg and /dev/null differ diff --git a/image/character/mini_lvbu.jpg b/image/character/mini_lvbu.jpg deleted file mode 100644 index 28f3f4e98..000000000 Binary files a/image/character/mini_lvbu.jpg and /dev/null differ diff --git a/image/character/mini_lvmeng.jpg b/image/character/mini_lvmeng.jpg deleted file mode 100644 index 52b336112..000000000 Binary files a/image/character/mini_lvmeng.jpg and /dev/null differ diff --git a/image/character/mini_sunquan.jpg b/image/character/mini_sunquan.jpg deleted file mode 100644 index 757c5e3b4..000000000 Binary files a/image/character/mini_sunquan.jpg and /dev/null differ diff --git a/image/character/mini_zhangchunhua.jpg b/image/character/mini_zhangchunhua.jpg deleted file mode 100644 index 58793602f..000000000 Binary files a/image/character/mini_zhangchunhua.jpg and /dev/null differ diff --git a/image/character/mini_zhugeliang.jpg b/image/character/mini_zhugeliang.jpg deleted file mode 100644 index 51f19d15a..000000000 Binary files a/image/character/mini_zhugeliang.jpg and /dev/null differ diff --git a/image/character/mini_zuoci.jpg b/image/character/mini_zuoci.jpg deleted file mode 100644 index 713d00607..000000000 Binary files a/image/character/mini_zuoci.jpg and /dev/null differ diff --git a/image/character/ol_wenqin.jpg b/image/character/ol_wenqin.jpg new file mode 100644 index 000000000..b17f505f5 Binary files /dev/null and b/image/character/ol_wenqin.jpg differ diff --git a/image/character/shen_dianwei.jpg b/image/character/shen_dianwei.jpg new file mode 100644 index 000000000..6750f51f1 Binary files /dev/null and b/image/character/shen_dianwei.jpg differ diff --git a/image/character/xizheng.jpg b/image/character/xizheng.jpg new file mode 100644 index 000000000..2e1221d9b Binary files /dev/null and b/image/character/xizheng.jpg differ diff --git a/layout/default/layout.css b/layout/default/layout.css index 273b4041e..6c4b8acc0 100644 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -387,6 +387,9 @@ table { right: 7px; bottom: 7px; z-index: 1; + white-space: nowrap; + writing-mode: vertical-rl; + -webkit-writing-mode: vertical-rl; } #splash>div>.avatar { width: 86px; @@ -1319,6 +1322,9 @@ body>.background.land { top: 9px; left: 6px; text-align: center; + white-space: nowrap; + writing-mode: vertical-rl; + -webkit-writing-mode: vertical-rl; } .card.fullimage>.name.long { top: 6px; @@ -1937,6 +1943,9 @@ div:not(.handcards)>.card>.info>span, top: 22px; max-height: 68px; overflow: hidden; + white-space: nowrap; + writing-mode: vertical-rl; + -webkit-writing-mode: vertical-rl; } .button.character>.hp { left: 5px; @@ -2170,6 +2179,9 @@ div:not(.handcards)>.card>.info>span, top: 24px; font-size: 20px; font-family: 'xinwei'; + white-space: nowrap; + writing-mode: vertical-rl; + -webkit-writing-mode: vertical-rl; } .player>.name.name2 { left: 81px @@ -2201,7 +2213,7 @@ div:not(.handcards)>.card>.info>span, } .button.character>.name { - font-family: 'xinwei' + font-family: 'xinwei'; } .player>.intro { top: 87px; @@ -2230,6 +2242,9 @@ div:not(.handcards)>.card>.info>span, top:calc(50% - 50px); width: 100%; left: 0; + white-space: nowrap; + writing-mode: vertical-rl; + -webkit-writing-mode: vertical-rl; } .player>.chain{ top: calc(50% - 10px); @@ -2829,6 +2844,9 @@ div:not(.handcards)>.card>.info>span, .player>.name_seat { opacity: 0; + white-space: nowrap; + writing-mode: vertical-rl; + -webkit-writing-mode: vertical-rl; } .player:not([data-position='0']).unseen.unseen2>.name_seat, .player:not([data-position='0']):not(.fullskin2).unseen>.name_seat { @@ -3765,6 +3783,9 @@ div:hover>.intro { #window>.choosedouble.character>.name { left: 6%; top: 8%; + white-space: nowrap; + writing-mode: vertical-rl; + -webkit-writing-mode: vertical-rl; } .hrefnode{ @@ -4211,10 +4232,8 @@ div[data-decoration="bronze"]::after{ left: 7px; /*border:1px solid #631515;*/ border-radius: 4px; - padding-top: 2px; - padding-bottom: 2px; - padding-left: 1px; - padding-right: 1px; + padding-top: 3px; + padding-bottom: 3px; /*color:#631515;*/ border: 1px solid rgb(74, 29, 1); color: rgb(74, 29, 1); @@ -4454,7 +4473,6 @@ div[data-decoration="bronze"]::after{ } .coin_menu .content>.caption>.coin_buy>.menubutton { width: auto; - display: inline-block; position: relative; float: right; padding-left: 5px; diff --git a/mode/boss.js b/mode/boss.js index dd5d7a734..9f7dd71b9 100644 --- a/mode/boss.js +++ b/mode/boss.js @@ -1890,7 +1890,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ event.num=1.5; 'step 1' var card=cards.shift(); - if(player.isEmpty(get.subtype(card))&&Math.random()target.isMajor()); }, check:function(event,player){ - var num=0,targets=event.targets.some(target=>target.isMajor()); + var num=0,targets=event.targets.filter(target=>target.isMajor()); for(var target of targets) num+=get.sgn(get.attitude(player,target)*get.effect(target,event.card,event.player,player)); return num>=0; }, @@ -966,7 +966,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ equipSkill:true, mod:{ maxHandcard:function(player,num){ - if(!player.isEmpty(2)) return; + if(!player.hasEmptySlot(2)) return; if(player.hasSkill('huangjintianbingfu')){ num+=player.getExpansions('huangjintianbingfu').length; } @@ -978,14 +978,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ audio:'tianshu', inherit:'taipingyaoshu', filter:function(event,player){ - if(!player.isEmpty(2)) return false; + if(!player.hasEmptySlot(2)) return false; return lib.skill.taipingyaoshu.filter(event,player); }, noHidden:true, ai:{ effect:{ target:function(card,player,target){ - if(!target.isEmpty(2)) return; + if(!target.hasEmptySlot(2)) return; if(player==target&&get.subtype(card)=='equip2'){ if(get.equipValue(card)<=7.5) return 0; } @@ -7619,6 +7619,146 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, }, + yigui_gzshan:{ + enable:'chooseToUse', + filter:function(event,player){ + if(event.type!='respondShan'||!event.filterCard({name:'shan'},player,event)||!lib.inpile.contains('shan')) return false; + var storage=player.storage.yigui,target=event.getParent().player; + if(!storage||!target||!storage.character.length||storage.used.contains('shan')) return false; + var identity=target.identity; + return ['unknown','ye'].contains(identity)||storage.character.some(function(i){ + if(lib.character[i][1]=='ye') return true; + var double=get.is.double(i,true); + var groups=(double?double:[lib.character[i][1]]); + return groups.contains(identity); + }); + }, + chooseButton:{ + dialog:function(event,player){ + var dialog=ui.create.dialog('役鬼','hidden'); + dialog.add([player.storage.yigui.character,'character']); + return dialog; + }, + filter:function(button,player){ + var evt=_status.event.getParent('chooseToUse'); + var target=evt.getParent().player,identity=target.identity; + if(['unknown','ye'].contains(identity)) return true; + if(lib.character[button.link][1]=='ye') return true; + var double=get.is.double(button.link,true); + var groups=(double?double:[lib.character[button.link][1]]); + return groups.contains(identity); + }, + check:function(button){ + return 1/(1+game.countPlayer(function(current){ + return current.identity==button.link; + })); + }, + backup:function(links,player){ + var character=links[0]; + var next={ + character:character, + filterCard:()=>false, + selectCard:-1, + complexCard:true, + check:()=>1, + popname:true, + audio:'yigui', + viewAs:{name:'shan',isCard:true}, + onuse:function(result,player){ + player.logSkill('yigui'); + var character=lib.skill.yigui_gzshan_backup.character; + player.flashAvatar('yigui',character); + player.storage.yigui.character.remove(character); + _status.characterlist.add(character); + game.log(player,'从「魂」中移除了','#g'+get.translation(character)); + player.syncStorage('yigui'); + player.updateMarks('yigui'); + player.storage.yigui.used.add(result.card.name); + }, + }; + return next; + }, + }, + ai:{ + respondShan:true, + skillTagFilter:function(player){ + var storage=player.storage.yigui; + if(!storage||!storage.character.length||storage.used.contains('shan')||!lib.inpile.contains('shan')) return false; + }, + order:0.1, + result:{player:1}, + }, + }, + yigui_gzwuxie:{ + hiddenCard:function(player,name){ + var storage=player.storage.yigui; + if(name!='wuxie'||!storage||!storage.character.length||storage.used.contains(name)||!lib.inpile.contains(name)) return false; + return true; + }, + enable:'chooseToUse', + filter:function(event,player){ + if(event.type!='wuxie'||!event.filterCard({name:'wuxie'},player,event)||!lib.inpile.contains('wuxie')) return false; + var storage=player.storage.yigui,target=event.getParent(2).player; + if(!storage||!target||!storage.character.length||storage.used.contains('wuxie')) return false; + var identity=target.identity; + return ['unknown','ye'].contains(identity)||storage.character.some(function(i){ + if(lib.character[i][1]=='ye') return true; + var double=get.is.double(i,true); + var groups=(double?double:[lib.character[i][1]]); + return groups.contains(identity); + }); + }, + chooseButton:{ + dialog:function(event,player){ + var dialog=ui.create.dialog('役鬼','hidden'); + dialog.add([player.storage.yigui.character,'character']); + return dialog; + }, + filter:function(button,player){ + var evt=_status.event.getParent('chooseToUse'); + var target=evt.getParent(2).player,identity=target.identity; + if(['unknown','ye'].contains(identity)) return true; + if(lib.character[button.link][1]=='ye') return true; + var double=get.is.double(button.link,true); + var groups=(double?double:[lib.character[button.link][1]]); + return groups.contains(identity); + }, + check:function(button){ + return 1/(1+game.countPlayer(function(current){ + return current.identity==button.link; + })); + }, + backup:function(links,player){ + var character=links[0]; + var next={ + character:character, + filterCard:()=>false, + selectCard:-1, + complexCard:true, + check:()=>1, + popname:true, + audio:'yigui', + viewAs:{name:'wuxie',isCard:true}, + onuse:function(result,player){ + player.logSkill('yigui'); + var character=lib.skill.yigui_gzwuxie_backup.character; + player.flashAvatar('yigui',character); + player.storage.yigui.character.remove(character); + _status.characterlist.add(character); + game.log(player,'从「魂」中移除了','#g'+get.translation(character)); + player.syncStorage('yigui'); + player.updateMarks('yigui'); + player.storage.yigui.used.add(result.card.name); + }, + }; + return next; + }, + }, + ai:{ + order:0.1, + result:{player:1}, + }, + }, jihun:{ trigger:{ player:'damageEnd', @@ -7858,7 +7998,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(event.numFixed||player.isDisabled(5)) return false; return !game.hasPlayer(function(current){ - return current.getEquip('yuxi'); + return current.getEquips('yuxi').length>0; }) }, content:function(){trigger.num++}, @@ -7876,7 +8016,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ return game.hasPlayer(function(current){ return player.canUse('zhibi',current); })&&!game.hasPlayer(function(current){ - return current.getEquip('yuxi'); + return current.getEquips('yuxi').length>0; }); }, content:function(){ @@ -8243,7 +8383,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ var player=_status.event.player; if(!game.hasPlayer(function(current){ return !current.isUnseen()&¤t.getEquip('yuxi')||current.hasSkill('gzyongsi')&&!game.hasPlayer(function(current){ - return current.getEquip('yuxi'); + return current.getEquips('yuxi').length>0; }); })&&game.hasPlayer(function(current){return current!=player&¤t.isUnseen()})){ var identity; @@ -10797,7 +10937,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ ai:{ order:function(item,player){ if(player.hasSkillTag('noe')||!player.countCards('h',function(card){ - return get.type(card)=='equip'&&player.getEquip(get.subtype(card))&&player.hasValueTarget(card); + return get.type(card)=='equip'&&!player.canEquip(card)&&player.hasValueTarget(card); })) return 1; return 10; }, @@ -11987,7 +12127,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(player==target) return false; var card=ui.selected.cards[0]; if(get.type(card)!='equip') return true; - return target.isEmpty(get.subtype(card)); + return target.canEquip(card); }, prompt:get.prompt2('gzhuyuan'), complexSelect:true, @@ -12053,7 +12193,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, position:'he', filterTarget:function(card,player,target){ - return target.isEmpty(get.subtype(card)); + return target.canEquip(card); }, ai1:function(card){ return 6-get.value(card); @@ -12728,7 +12868,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ var range1=[1,player.maxHp]; if(player.hasSkill('dinglanyemingzhu_skill')){ for(var i=0;i.card{ background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)) !important;