From 6fa835056b2ff8204f7d4519fc4484a76c16e136 Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:01:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=B8=E5=8A=AD=E3=80=90?= =?UTF-8?q?=E8=AF=84=E9=89=B4=E3=80=91=E6=A3=80=E7=B4=A2=E6=AD=A6=E5=B0=86?= =?UTF-8?q?=E7=89=8C=E8=8C=83=E5=9B=B4=E4=BB=85=E9=99=90=E4=BA=8E=E5=89=A9?= =?UTF-8?q?=E4=BD=99=E6=AD=A6=E5=B0=86=E7=89=8C=E5=A0=86=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=A3=80=E6=B5=8BviewAs=E7=B1=BB=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sp2.js | 312 +++++++++++++++++++++++++---------------------- 1 file changed, 165 insertions(+), 147 deletions(-) diff --git a/character/sp2.js b/character/sp2.js index 465099903..aed20935c 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -3816,7 +3816,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } event.finish(); 'step 6' - player.chooseTarget('令一名其他角色弃置一张点数为6的牌,否则交给你一张牌',true,function(card,player,current){ + if(!game.hasPlayer(current=>current!=player)) event.finish(); + else player.chooseTarget('令一名其他角色弃置一张点数为6的牌,否则交给你一张牌',true,function(card,player,current){ return current!=player&¤t.countCards('he')>0; }).set('ai',function(target){ var player=_status.event.player,att=get.attitude(player,target); @@ -4504,7 +4505,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseBegin'}, direct:true, filter:function(event,player){ - return player.phaseNumber==1&&!player.storage.jielie; + return player.phaseNumber==1&&!player.storage.jielie&&game.hasPlayer(current=>current!=player); }, content:function(){ 'step 0' @@ -7916,199 +7917,216 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, pingjian:{ - audio:2, - trigger:{ - player:['damageEnd','phaseJieshuBegin'], - }, initList:function(){ var list=[]; - if(_status.connectMode) var list=get.charactersOL(); + if(_status.connectMode) list=get.charactersOL(); else{ var list=[]; for(var i in lib.character){ - if(lib.filter.characterDisabled2(i)||lib.filter.characterDisabled(i)) continue; - list.push(i); + if(!lib.filter.characterDisabled2(i)&&!lib.filter.characterDisabled(i)) list.push(i); } } game.countPlayer2(function(current){ list.remove(current.name); list.remove(current.name1); list.remove(current.name2); - if(current.storage.rehuashen&¤t.storage.rehuashen.character) list.removeArray(current.storage.rehuashen.character) }); _status.characterlist=list; }, + init:function(player){ + player.addSkill('pingjian_check'); + if(!player.storage.pingjian_check) player.storage.pingjian_check={}; + }, + onremove:function(player){ + player.removeSkill('pingjian_check'); + }, + audio:2, + trigger:{player:['damageEnd','phaseJieshuBegin']}, frequent:true, content:function(){ 'step 0' - if(!player.storage.pingjian) player.storage.pingjian=[]; - event._result={bool:true}; - 'step 1' - if(result.bool){ - if(!_status.characterlist){ - lib.skill.pingjian.initList(); - } - var list=[]; - var skills=[]; - var map=[]; - _status.characterlist.randomSort(); - var name2=event.triggername; - for(var i=0;i<_status.characterlist.length;i++){ - var name=_status.characterlist[i]; - if(name.indexOf('zuoci')!=-1||name.indexOf('xushao')!=-1) continue; - var skills2=lib.character[name][3]; - for(var j=0;j2) break; - } - if(!skills.length){ - //player.draw(); - event.finish(); - } - else{ - //skills.unshift('摸一张牌'); - player.chooseControl(skills).set('dialog',['请选择要发动的技能',[list,'character']]).set('ai',function(){return 0}); } + if(list.length>2) break; } + if(skills.length) player.chooseControl(skills).set('dialog',['评鉴:请选择尝试发动的技能',[list,'character']]); else event.finish(); - 'step 2' - if(result.control=='摸一张牌'){ - player.draw(); - return; + 'step 1' + 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;//暂时想到的让多点伤害只执行一次的拙见 } - player.storage.pingjian.add(result.control); - player.addTempSkill(result.control,event.triggername=='damageEnd'?'damageAfter':'phaseJieshu'); }, group:'pingjian_use', - phaseUse_special:['xinfu_lingren'], + phaseUse_special:[], + ai:{threaten:5}, }, pingjian_use:{ audio:'pingjian', enable:'phaseUse', usable:1, - position:'he', + prompt:()=>lib.translate.pingjian_info, content:function(){ 'step 0' - if(!player.storage.pingjian) player.storage.pingjian=[]; - event._result={bool:true}; - 'step 1' - if(result.bool){ - var list=[]; - var skills=[]; - var map=[]; - if(!_status.characterlist){ - lib.skill.pingjian.initList(); - } - _status.characterlist.randomSort(); - for(var i=0;i<_status.characterlist.length;i++){ - var name=_status.characterlist[i]; - if(name.indexOf('zuoci')!=-1||name.indexOf('xushao')!=-1) continue; - var skills2=lib.character[name][3]; - for(var j=0;j2) break; - } - if(!skills.length){ - //player.draw(); - event.finish(); - } - else{ - //skills.unshift('摸一张牌'); - player.chooseControl(skills).set('dialog',['请选择要发动的技能',[list,'character']]).set('ai',function(){return 0}); } + if(list.length>2) break; } + if(skills.length) player.chooseControl(skills).set('dialog',['评鉴:请选择尝试发动的技能',[list,'character']]); else event.finish(); - 'step 2' - if(result.control=='摸一张牌'){ - player.draw(); - return; - } - player.storage.pingjian.add(result.control); - player.addTempSkill(result.control,'phaseUseEnd'); - player.addTempSkill('pingjian_temp','phaseUseEnd'); - player.storage.pingjian_temp=result.control; - //event.getParent(2).goto(0); + 'step 1' + player.markAuto('pingjian',[result.control]); + player.addTempSkill(result.control); + player.storage.pingjian_check[result.control]='phaseUse'; }, - ai:{order:10,result:{player:1}}, + ai:{order:12,result:{player:1}}, }, - pingjian_temp:{ - onremove:true, - trigger:{player:['useSkillBegin','useCard1']}, - silent:true, - firstDo:true, + pingjian_check:{ + charlotte:true, + trigger:{player:['useSkill','logSkillBegin']}, filter:function(event,player){ - var info=lib.skill[event.skill]; - if(!info) return false; - if(event.skill==player.storage.pingjian_temp) return true; - if(info.sourceSkill==player.storage.pingjian_temp||info.group==player.storage.pingjian_temp) return true; - if(Array.isArray(info.group)&&info.group.contains(player.storage.pingjian_temp)) return true; - return false; + if(get.info(event.skill).charlotte) return false; + var skill=event.sourceSkill||event.skill; + return player.storage.pingjian_check[skill]; }, + direct:true, + firstDo:true, + priority:Infinity, content:function(){ - player.removeSkill(player.storage.pingjian_temp); - player.removeSkill('pingjian_temp'); + var skill=trigger.sourceSkill||trigger.skill; + player.removeSkill(skill); + delete player.storage.pingjian_check[skill]; + }, + group:'pingjian_check2', + }, + pingjian_check2:{ + charlotte:true, + trigger:{player:['phaseUseEnd','damageEnd','phaseJieshuBegin']}, + filter:function(event,player){ + return Object.keys(player.storage.pingjian_check).find(function(skill){ + if(event.name!='damage') return player.storage.pingjian_check[skill]==event.name; + return player.storage.pingjian_check[skill]==event; + }); + }, + direct:true, + lastDo:true, + priority:-Infinity, + content:function(){ + var skills=Object.keys(player.storage.pingjian_check).filter(function(skill){ + if(trigger.name!='damage') return player.storage.pingjian_check[skill]==trigger.name; + return player.storage.pingjian_check[skill]==trigger; + }); + player.removeSkill(skills); + for(var skill of skills) delete player.storage.pingjian_check[skill]; }, }, //上兵伐谋 @@ -9648,7 +9666,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, forced:true, filter:function(event){ - return game.players.length>1&&(event.name!='phase'||game.phaseNumber==0); + return game.hasPlayer(current=>current!=player)&&(event.name!='phase'||game.phaseNumber==0); }, content:function(){ 'step 0' @@ -10121,8 +10139,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xugong:"许贡", zhangchangpu:"张昌蒲", pingjian:'评荐', - pingjian_info:'结束阶段开始时/当你受到伤害后/出牌阶段限一次,你可以令系统随机从剩余武将牌堆中检索出三张拥有发动时机为结束阶段开始时/当你受到伤害后/出牌阶段的技能的武将牌。然后你可以选择尝试发动其中一个技能。每个技能每局只能选择一次。', pingjian_use:'评荐', + pingjian_info:'结束阶段开始时/当你受到伤害后/出牌阶段限一次,你可以令系统随机检索出三张拥有发动时机为结束阶段开始时/当你受到伤害后/出牌阶段的技能的武将牌。然后你可以选择尝试发动其中一个技能。每个技能每局游戏只能选择一次。', songshu:'颂蜀', songshu_info:'出牌阶段,你可以和其他角色拼点。若你没赢,你与其各摸两张牌,且你本阶段内不能再发动〖颂蜀〗。',