diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d7f105139..000000000 --- a/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ -GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/README.md b/README.md deleted file mode 100644 index 0d77a9994..000000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -noname -====== diff --git a/card/compensate.js b/card/compensate.js new file mode 100644 index 000000000..4484a6f6c --- /dev/null +++ b/card/compensate.js @@ -0,0 +1,78 @@ +card.compensate={ + list:[ + ["diamond",3,'guohe'], + ['club',8,'guohe'], + ['spade',13,'guohe'], + + ["heart",4,"huogong","fire"], + ["diamond",5,"huogong","fire"], + ["diamond",10,"huogong","fire"], + ["diamond",13,"huogong","fire"], + + ["heart",1,"juedou"], + ["diamond",1,"juedou"], + ["club",1,"juedou"], + + ["heart",12,"wuzhong"], + ["diamond",3,"wuzhong"], + + ["club",10,"wuxie"], + ["spade",10,"wuxie"], + ["spade",11,"wuxie"], + + // ['heart',5,'jiu'], + // ['spade',9,'jiu'], + // ['spade',2,'jiu'], + + ['heart',8,'tao'], + ['heart',10,'tao'], + + ["heart",10,"sha","fire"], + ["diamond",4,"sha","fire"], + ["heart",5,"sha","fire"], + ["spade",4,"sha","thunder"], + ["spade",5,"sha","thunder"], + ["club",5,"sha","thunder"], + ["spade",9,"sha","thunder"], + ["club",8,"sha"], + ["club",10,"sha"], + ["club",2,"sha"], + ["club",10,"sha"], + ["spade",10,"sha"], + ["spade",10,"sha"], + ["spade",11,"sha"], + ["spade",6,"sha"], + ["club",2,"sha"], + ["club",8,"sha"], + ["spade",9,"sha"], + + ["spade",4,"sha"], + ["spade",7,"sha"], + ["spade",1,"sha"], + ["club",4,"sha"], + ["club",7,"sha"], + ["club",2,"sha"], + + ["heart",11,"shan"], + ["heart",12,"shan"], + ["diamond",6,"shan"], + ["heart",11,"shan"], + ["heart",8,"shan"], + ["diamond",5,"shan"], + ["diamond",2,"shan"], + ["heart",11,"shan"], + ["heart",12,"shan"], + ["heart",12,"shan"], + ["heart",4,"shan"], + ["heart",4,"shan"], + ["diamond",6,"shan"], + ["diamond",7,"shan"], + ["heart",11,"shan"], + ["heart",12,"shan"], + ["diamond",6,"shan"], + ["diamond",7,"shan"], + + ["club",5,"tiesuo"], + ["spade",8,"tiesuo"], + ], +} diff --git a/card/ex.js b/card/ex.js new file mode 100644 index 000000000..70db58861 --- /dev/null +++ b/card/ex.js @@ -0,0 +1,105 @@ +card.ex={ + card:{ + hanbing:{ + fullskin:true, + type:"equip", + subtype:"equip1", + distance:{attackFrom:-1}, + skills:['hanbing_skill'], + ai:{ + basic:{ + equipValue:2 + } + }, + }, + renwang:{ + fullskin:true, + type:"equip", + subtype:"equip2", + skills:['renwang_skill'], + ai:{ + basic:{ + equipValue:8 + }, + }, + }, + }, + skill:{ + hanbing_skill:{ + trigger:{player:'shaHit'}, + direct:true, + filter:function(event,player){ + return event.target.get('he').length>0; + }, + content:function(){ + "step 0" + player.choosePlayerCard('是否发动【寒冰剑】?','he',trigger.target,[1,2],function(button){ + var eff=ai.get.damageEffect(trigger.target,player,player); + if(ai.get.attitude(player,trigger.target)>0){ + if(eff>=0) return false; + return 10-ai.get.buttonValue(button); + } + if(eff<=0) return ai.get.buttonValue(button); + if(trigger.target.hp==1) return false; + if(player.skills.contains('jiu')||player.skills.contains('tianxianjiu')) return false; + if(ui.dialog.buttons.length<2) return -1; + var num=0; + for(var i=0;i1.5) num++; + } + if(num>=2) return ai.get.buttonValue(button)-1.5; + }); + "step 1" + if(result.bool){ + trigger.untrigger(); + var cards=[]; + for(var i=0;i0) return 1; + } + } + } + return 0; + }, + }, + tag:{ + save:1 + } + } + }, + huogong:{ + fullskin:true, + type:'trick', + enable:true, + filterTarget:function(card,player,target){ + if(player!=game.me&&player.num('h')<3) return false; + return target.num('h')>0; + }, + content:function(){ + "step 0" + if(target.get('h').length==0){ + event.finish(); + return; + } + target.chooseCard(true); + "step 1" + event.dialog=ui.create.dialog(get.translation(target.name)+'展示的手牌',result.cards); + event.card2=result.cards[0]; + game.log(get.translation(target.name)+'展示了'+get.translation(event.card2)); + player.chooseToDiscard(function(card){ + return get.suit(card)==get.suit(_status.event.parent.card2); + },function(card){ + if(ai.get.damageEffect(target,player,player,'fire')>0){ + return 6-ai.get.value(card,_status.event.player); + } + return -1; + }).prompt=false; + game.delay(2); + "step 2" + if(result.bool){ + target.damage('fire'); + } + else{ + target.addTempSkill('huogong2','phaseBegin'); + } + event.dialog.close(); + }, + ai:{ + basic:{ + order:4, + value:[3,1], + useful:1, + }, + result:{ + player:function(player){ + var nh=player.num('h'); + if(nh==2&&player.hp==1) return 0; + if(nh<=player.hp&& + _status.event.name=='chooseToUse'&&_status.event.filterCard({name:'huogong'})) return -10; + }, + target:function(player,target){ + if(target.skills.contains('huogong2')) return 0; + return -1.5; + } + }, + tag:{ + damage:1, + fireDamage:1, + natureDamage:1, + } + } + }, + tiesuo:{ + fullskin:true, + type:'trick', + enable:true, + filterTarget:true, + selectTarget:[1,2], + content:function(){ + target.link(); + }, + chongzhu:true, + ai:{ + basic:{ + useful:4, + value:4, + order:7 + }, + result:{ + target:function(player,target){ + if(target.classList.contains('linked')) return 1; + if(ai.get.attitude(player,target)>=0) return -1; + for(var i=0;i3) num-=4; + return num; + } + }, + }, + skills:['tengjia1','tengjia2'] + }, + baiyin:{ + fullskin:true, + type:'equip', + subtype:'equip2', + onLose:function(){ + player.recover(); + }, + filterLose:function(card,player){ + return player.hp0; + } + return att<=0; + }, + content:function(){ + trigger.card.nature='fire'; + player.addSkill('zhuque_skill2'); + player.storage.zhuque_skill=trigger.card; + } + }, + zhuque_skill2:{ + trigger:{player:'useCardAfter'}, + forced:true, + popup:false, + content:function(){ + delete player.storage.zhuque_skill.nature; + } + }, + huogon2:{}, + }, + translate:{ + jiu:'酒', + huogong:'火攻', + tiesuo:'铁锁连环', + huogong_bg:'攻', + tiesuo_bg:'锁', + _chongzhu:'重铸', + _lianhuan:'连环', + _lianhuan2:'连环', + bingliang:'兵粮寸断', + hualiu:'骅骝', + zhuque:'朱雀羽扇', + bingliang_bg:'粮', + bingliang_info:'目标角色判定阶段进行判定:若判定结果不为梅花,则跳过该角色的摸牌阶段。', + hualiu_bg:'+马', + zhuque_bg:'扇', + zhuque_skill:'朱雀羽扇', + zhuque_info:'你可以将一张普通【杀】当具火焰伤害的【杀】使用。', + guding:'古锭刀', + guding_info:'锁定技,当你使用【杀】对目标角色造成伤害时,若其没有手牌,此伤害+1。', + guding_skill:'古锭刀', + tengjia:'藤甲', + tengjia_info:'锁定技,【南蛮入侵】、【万箭齐发】和普通【杀】对你无效。你每次受到火焰伤害时,该伤害+1。', + tengjia1:'藤甲', + tengjia2:'藤甲', + baiyin:'白银狮子', + baiyin_info:'锁定技,你每次受到伤害时,最多承受1点伤害(防止多余的伤害);当你失去装备区里的【白银狮子】时,你回复1点体力。', + baiyin_skill:'白银狮子', + _baiyin:'白银狮子', + }, + list:[ + ["heart",4,"sha","fire"], + ["heart",7,"sha","fire"], + ["heart",10,"sha","fire"], + ["diamond",4,"sha","fire"], + ["diamond",5,"sha","fire"], + ["spade",4,"sha","thunder"], + ["spade",5,"sha","thunder"], + ["spade",6,"sha","thunder"], + ["spade",7,"sha","thunder"], + ["spade",8,"sha","thunder"], + ["club",5,"sha","thunder"], + ["club",6,"sha","thunder"], + ["club",7,"sha","thunder"], + ["club",8,"sha","thunder"], + ["heart",8,"shan"], + ["heart",9,"shan"], + ["heart",11,"shan"], + ["heart",12,"shan"], + ["diamond",6,"shan"], + ["diamond",7,"shan"], + ["diamond",8,"shan"], + ["diamond",10,"shan"], + ["diamond",11,"shan"], + ["heart",5,"tao"], + ["heart",6,"tao"], + ["diamond",2,"tao"], + ["diamond",3,"tao"], + ["diamond",9,"jiu"], + ["spade",3,"jiu"], + ["spade",9,"jiu"], + ["club",3,"jiu"], + ["club",9,"jiu"], + + ["diamond",13,"hualiu"], + ["club",1,"baiyin"], + ["spade",2,"tengjia",'fire'], + ["club",2,"tengjia",'fire'], + ["spade",2,"guding"], + ["diamond",2,"zhuque",'fire'], + + ["heart",2,"huogong","fire"], + ["heart",3,"huogong","fire"], + ["diamond",12,"huogong","fire"], + ["spade",11,"tiesuo"], + ["spade",12,"tiesuo"], + ["club",10,"tiesuo"], + ["club",11,"tiesuo"], + ["club",12,"tiesuo"], + ["club",13,"tiesuo"], + ["heart",13,"wuxie"], + ["heart",13,"wuxie"], + ["spade",13,"wuxie"], + ["spade",10,"bingliang"], + ["club",4,"bingliang"], + ], +} diff --git a/card/guozhan.js b/card/guozhan.js new file mode 100644 index 000000000..d69e7ccba --- /dev/null +++ b/card/guozhan.js @@ -0,0 +1,246 @@ +card.guozhan={ + card:{ + yuanjiao:{ + fullskin:true, + type:'trick', + enable:true, + filterTarget:function(card,player,target){ + if(lib.config.mode!='guozhan') return player!=target; + if(target.identity=='unknown'||player.identity=='unknown') return false; + if(player==target) return false; + if(player.identity=='ye') return true; + return player.identity!=target.identity; + }, + content:function(){ + game.asyncDraw([target,player],[1,lib.config.mode=='guozhan'?3:1]); + }, + ai:{ + basic:{ + useful:4, + value:8, + order:9 + }, + result:{ + target:1, + player:3, + }, + }, + // mode:['guozhan'], + }, + zhibi:{ + fullskin:true, + type:'trick', + enable:true, + chongzhu:true, + filterTarget:function(card,player,target){ + if(player==target) return false; + return (target.get('h').length|| + target.classList.contains('unseen')|| + target.classList.contains('unseen2')) + }, + content:function(){ + "step 0" + if(!player.storage.zhibi){ + player.storage.zhibi=[]; + } + player.storage.zhibi.push(target); + if(!event.isMine()){ + event.finish(); + return; + } + var controls=[]; + if(target.get('h').length) controls.push('手牌'); + if(target.classList.contains('unseen')) controls.push('主将'); + if(target.classList.contains('unseen2')) controls.push('副将'); + if(controls.length>1){ + player.chooseControl(controls); + } + if(controls.length==0) event.finish(); + "step 1" + game.pause(); + ui.create.confirm('o'); + var content; + if(result.control){ + if(result.control=='手牌') content=target.get('h'); + else if(result.control=='主将') content=[[target.name1],'character']; + else content=[[target.name2],'character']; + } + else if(target.get('h').length){ + content=target.get('h'); + } + else if(target.classList.contains('unseen')){ + content=[[target.name1],'character']; + } + else{ + content=[[target.name2],'character']; + } + event.dialog=ui.create.dialog(content); + "step 2" + event.dialog.close(); + }, + mode:['guozhan'], + ai:{ + order:9.5, + result:{ + player:function(player,target){ + if(player.num('h')<=player.hp) return 0; + if(player.storage.zhibi&&player.storage.zhibi.contains(target)) return 0; + return target.isUnseen()?1:0; + } + } + } + }, + yiyi:{ + fullskin:true, + type:'trick', + enable:true, + filterTarget:function(card,player,target){ + if(player.identity=='unknown'||player.identity=='ye'||lib.config.mode!='guozhan') return player==target; + return player.identity==target.identity; + }, + selectTarget:-1, + content:function(){ + target.draw(lib.config.mode=='guozhan'?2:3); + target.chooseToDiscard(2,'he',true).ai=ai.get.disvalue; + }, + ai:{ + basic:{ + useful:4, + value:4, + order:7 + }, + result:{ + target:function(player,target){ + if(lib.config.mode!='guozhan') return 1; + if(target.num('h')<=1){ + return 0; + } + return 1; + }, + }, + }, + // mode:['guozhan'], + }, + wuliu:{ + fullskin:true, + type:'equip', + subtype:'equip1', + distance:{attackFrom:-1}, + ai:{ + basic:{ + equipValue:function(card,player){ + if(player.identity=='unknown'||player.identity=='ye') return 2.5; + var num=2; + for(var i=0;i1; + }, + content:function(){ + "step 0" + var damaged=trigger.player; + player.chooseCardTarget({ + filterTarget:function(card,player,target){ + return get.distance(damaged,target)<=1&&target!=damaged; + }, + ai1:function(card){ + return 9-ai.get.value(card); + }, + ai2:function(target){ + return ai.get.damageEffect(target,player,player); + }, + prompt:'是否发动三尖两刃刀?' + }); + "step 1" + if(result.bool){ + player.logSkill('sanjian'); + player.discard(result.cards); + result.targets[0].damage(); + } + } + }, + }, + translate:{ + yuanjiao:'远交近攻', + yuanjiao_info:'对一名不同势力的角色使用,对方摸一张牌,然后你摸3张牌(非国战模式中改为摸1张)', + yuanjiao_bg:'交', + zhibi:'知己知彼', + zhibi_info:'出牌阶段对一名其他角色使用,观看其手牌或装备牌', + yiyi:'以逸待劳', + yiyi_info:'对与自己势力相同的所有角色使用,摸两张牌然后弃置两张牌(非国战模式改为对自己使用,摸3张弃两张)', + yiyi_bg:'逸', + wuliu:'吴六剑', + wuliu_info:'与装备者势力相同的角色攻击范围+1', + sanjian:'三尖两刃刀', + sanjian_info:'当你使用杀造成伤害后,可以弃置1张手牌对一名距离受伤害角色1以内的其他角色造成1点伤害', + wuliu_skill:'吴六剑', + sanjian_skill:'三尖两刃刀', + jingfanma_bg:'-马', + jingfanma:'惊帆', + }, + list:[ + ['heart',9,'yuanjiao'], + ['club',3,'zhibi'], + ['club',4,'zhibi'], + ['diamond',4,'yiyi'], + ['heart',11,'yiyi'], + ['diamond',6,'wuliu'], + ['diamond',12,'sanjian'], + ['heart',3,'jingfanma'], + ], +} diff --git a/card/qimou.js b/card/qimou.js new file mode 100644 index 000000000..04d86a4ae --- /dev/null +++ b/card/qimou.js @@ -0,0 +1,351 @@ +card.qimou={ + card:{ + chenhuodajie:{ + fullskin:true, + type:'trick', + content:function(){ + if(target.num('he')){ + player.gainPlayerCard('he',target,true); + } + }, + ai:{ + order:1, + useful:6, + value:6, + result:{ + target:-1 + }, + tag:{ + loseCard:1 + } + } + }, + shushangkaihua:{ + fullskin:true, + type:'trick', + enable:true, + selectTarget:-1, + multitarget:true, + multiline:true, + filterTarget:function(card,player,target){ + var num=target.num('h'); + for(var i=0;i0){ + num++; + } + else if(eff<0){ + num--; + } + } + } + return num; + } + } + } + }, + yihuajiemu:{ + fullskin:true, + type:'trick', + enable:true, + filterTarget:function(card,player,target){ + if(ui.selected.targets.length){ + return target.get('e',{subtype:'equip5'}).length==0; + } + else{ + return target.get('e',{subtype:'equip5'}).length>0; + } + }, + selectTarget:2, + multitarget:true, + content:function(){ + if(targets[0].get('e','5')){ + targets[0].$give(targets[0].get('e','5'),targets[1]); + targets[1].equip(targets[0].get('e','5')); + game.delay(); + } + }, + ai:{ + order:1, + result:{ + target:function(player,target){ + if(target.get('e',{subtype:'equip5'}).length){ + if(ai.get.attitude(target,player)>0){ + return -0.5; + } + return -1; + } + return 1; + } + }, + tag:{ + loseCard:1 + } + } + }, + fudichouxin:{ + fullskin:true, + type:'trick', + enable:true, + filterTarget:function(card,player,target){ + return player!=target&&target.get('h').length; + }, + content:function(){ + "step 0" + player.chooseToCompare(target).clear=false; + "step 1" + if(result.bool){ + player.gain([result.player,result.target]); + result.player.clone.moveTo(player).delete(); + result.target.clone.moveTo(player).delete(); + } + else if(!result.cancelled){ + result.player.clone.delete(); + result.target.clone.delete(); + } + }, + ai:{ + order:4, + result:{ + target:function(player,target){ + if(player.get('h').length<=1) return 0; + return -1; + }, + player:function(player){ + if(player.get('h').length<=1) return 0; + return 0.5; + } + }, + tag:{ + loseCard:1 + } + } + }, + shuiyanqijun:{ + fullskin:true, + type:'trick', + enable:true, + filterTarget:function(card,player,target){ + return target.num('e'); + }, + selectTarget:-1, + content:function(){ + if(target.num('e')) target.chooseToDiscard('e',true); + }, + ai:{ + order:9, + result:{ + target:-1 + }, + tag:{ + multitarget:1, + multineg:1 + } + } + }, + toulianghuanzhu:{ + fullskin:true, + type:'trick', + enable:true, + filterTarget:function(card,player,target){ + return target.num('h')>0; + }, + selectTarget:2, + multitarget:true, + targetprompt:['被拿牌','得牌'], + content:function(){ + "step 0" + targets[0].addTempSkill('toulianghuanzhu2','phaseAfter'); + var hs=targets[0].get('h'); + event.num=Math.min(2,hs.length); + if(event.num){ + targets[1].gain(hs.randomGets(event.num)); + targets[0].$give(event.num,targets[1]); + game.delay(); + } + else{ + event.finish(); + } + "step 1" + if(targets[1].num('h')){ + targets[1].chooseCard(true,event.num,'选择'+get.cnNumber(event.num)+'张手牌还给'+get.translation(targets[0])).ai=ai.get.disvalue; + } + else{ + event.finish(); + } + "step 2" + targets[0].gain(result.cards); + targets[1].$give(event.num,targets[0]); + }, + ai:{ + order:9, + tag:{ + discard:1, + multitarget:1, + multineg:1 + }, + result:{ + target:function(player,target){ + if(ui.selected.targets.length){ + if(target==player&&target.num('h')<=1) return 0; + return 0.5; + } + if(target.skills.contains('toulianghuanzhu2')) return 0; + return -0.5; + } + }, + useful:3, + value:7 + } + }, + }, + skill:{ + toulianghuanzhu2:{}, + _chenhuodajie:{ + trigger:{global:'damageEnd'}, + direct:true, + filter:function(event,player){ + if(event.player==player) return false; + if(!event.player.num('he')) return false; + if(player.num('h','chenhuodajie')) return true; + var mn=player.get('e','5'); + if(mn&&mn.name=='muniu'&&mn.cards&&mn.cards.length){ + for(var i=0;i=3&&ai.get.attitude(game.players[i],player)>=3){ + players.push(game.players[i]); + } + } + players.sort(lib.sort.seat); + var choice=players[0]; + player.chooseTarget('是否移动木牛流马?',function(card,player,target){ + return player!=target&&!target.get('e','5'); + }).ai=function(target){ + return target==choice?1:-1; + }; + "step 1" + if(result.bool){ + var card=player.get('e','5'); + result.targets[0].equip(card); + player.addTempSkill('muniu_skill6','equipAfter'); + player.$give(card,result.targets[0]); + game.delay(); + } + }, + ai:{ + save:true, + respondSha:true, + respondShan:true, + order:1, + result:{ + player:1 + } + } + }, + muniu_skill2:{ + group:['muniu_skill3','muniu_skill4'] + }, + muniu_skill3:{ + trigger:{player:'chooseToRespondBegin'}, + filter:function(event,player){ + if(event.responded) return false; + var muniu=player.get('e','5'); + if(!muniu.cards) return false; + for(var i=0;i=ai.get.equipValue(button.link)) return -1; + return 1; + } + if(get.tag(button.link,'multitarget')) return -1; + return 1; + }).filterButton=function(button){ + return trigger.filterCard(button.link,player,trigger); + }; + player.addTempSkill('muniu_skill8',['useCardAfter','phaseAfter']); + "step 1" + if(result.bool){ + lib.skill.muniu_skill5.viewAs=result.buttons[0].link; + event.parent.parent.backup('muniu_skill5'); + event.parent.parent.step=0; + if(event.isMine()){ + event.parent.parent.openskilldialog='选择'+get.translation(result.buttons[0].link)+'的目标'; + } + } + else{ + event.parent.parent.step=0; + } + }, + ai:{ + order:4, + result:{ + player:function(player){ + if(player.tempSkills['muniu_skill8']) return 0; + if(_status.dying) return ai.get.attitude(player,_status.dying); + return 1; + } + }, + useful:-1, + value:-1 + } + }, + muniu_skill5:{ + filterCard:function(){return false}, + selectCard:-1 + }, + muniu_skill6:{}, + muniu_skill8:{}, + muniu_skill7:{ + filter:function(){return false}, + hiddenCard:function(player,name){ + var muniu=player.get('e','5'); + if(!muniu.cards) return false; + for(var i=0;i2; + }, + distance:{attackFrom:-Infinity}, + onEquip:function(){ + //player.loseHp(); + if(!player.skills.contains('xuanyuan')&&player.hp<=2){ + player.discard(card); + } + }, + onLose:function(){ + if(!player.skills.contains('xuanyuan')) player.loseHp(); + }, + ai:{ + equipValue:20 + } + }, + pangufu:{ + fullskin:true, + type:'equip', + subtype:'equip1', + skills:['pangufu'], + distance:{attackFrom:-3}, + ai:{ + equipValue:8 + } + }, + lianyaohu:{ + fullskin:true, + type:'equip', + subtype:'equip5', + onLose:function(){ + delete player.storage.lianhua; + }, + ai:{ + equipValue:8 + }, + skills:['lianhua','shouna'] + }, + haotianta:{ + type:'equip', + subtype:'equip5', + skills:['haotianta'], + enable:function(card,player){return player==game.me;}, + onEquip:function(){ + //player.loseHp(); + }, + onLose:function(){ + //player.loseHp(); + }, + ai:{ + equipValue:0 + } + }, + fuxiqin:{ + fullskin:true, + type:'equip', + subtype:'equip5', + skills:['kongxin'], + ai:{ + equipValue:8 + } + }, + shennongding:{ + fullskin:true, + type:'equip', + subtype:'equip5', + skills:['shennongding'], + ai:{ + equipValue:6 + } + }, + kongdongyin:{ + fullskin:true, + type:'equip', + subtype:'equip5', + skills:['kongdongyin'], + ai:{ + basic:{ + equipValue:function(card,player){ + if(player.hp==2) return 7; + if(player.hp==1) return 9; + return 5; + } + } + } + }, + // kunlunjing:{ + // type:'equip', + // subtype:'equip5', + // skills:['kunlunjing'], + // onEquip:function(){ + // //if(player==game.me) player.loseHp(); + // }, + // onLose:function(){ + // //if(player==game.me) player.loseHp(); + // }, + // ai:{ + // equipValue:5 + // } + // }, + nvwashi:{ + fullskin:true, + type:'equip', + subtype:'equip5', + skills:['nvwashi'], + ai:{ + equipValue:7 + } + } + }, + skill:{ + lianhua:{ + enable:'phaseUse', + filter:function(event,player){ + var hu=player.get('e','5'); + if(hu&&hu.storage.shouna&&hu.storage.shouna.length>1){ + return true; + } + return false; + }, + usable:1, + content:function(){ + "step 0" + event.hu=player.get('e','5'); + player.chooseCardButton('弃置两张壶中的牌,然后从牌堆中获得一张类别不同的牌',2,event.hu.storage.shouna).ai=function(){ + return 1; + } + "step 1" + if(result.bool){ + var type=[]; + player.$throw(result.links); + game.log(get.translation(player)+'弃置了'+get.translation(result.links)); + for(var i=0;i0; + }, + content:function(){ + trigger.player.chooseToDiscard(true,'he'); + } + }, + shouhua:{ + mode:['identity','infinity'], + enable:'phaseUse', + filter:function(event,player){ + return player==game.me; + }, + usable:1, + filterTarget:function(card,player,target){ + return target!=game.zhu&&target!=game.me&&target.hp0){ + return trigger.judge(button.link); + } + if(ai.get.attitude(player,trigger.player)<0){ + return -trigger.judge(button.link); + } + }; + "step 1" + var card=result.links[0]; + event.cards.remove(card); + for(var i=0;i0){ + trigger.result.bool=true; + trigger.player.popup('洗具'); + } + if(trigger.result.judge<0){ + trigger.result.bool=false; + trigger.player.popup('杯具'); + } + game.log(get.translation(trigger.player)+'的判定结果为'+get.translation(card)+ + '('+get.translation(get.suit(card))+get.number(card)+')'); + trigger.direct=true; + trigger.position.appendChild(card); + game.delay(2); + } + else{ + event.finish(); + } + "step 2" + var card=trigger.result.card; + if(trigger.position!=ui.discardPile){ + trigger.position.appendChild(card); + trigger.result.node.delete(); + } + else{ + player.gain(card); + player.$gain2(card); + } + game.delay(); + }, + ai:{ + tag:{ + rejudge:10 + } + } + }, + shennongding:{ + enable:'phaseUse', + usable:1, + filterCard:true, + selectCard:2, + check:function(card){ + if(get.tag(card,'recover')>=1) return 0; + return 7-ai.get.value(card); + }, + filter:function(event,player){ + return player.hp0; + }, + content:function(){ + trigger.untrigger(); + trigger.finish(); + player.hp=1; + player.draw(); + player.discard(player.get('e',{subtype:'equip5'})); + game.delay(); + } + }, + + nvwashi:{ + trigger:{global:'dying'}, + priority:6, + filter:function(event,player){ + return event.player.hp<=0; + }, + check:function(event,player){ + return ai.get.attitude(player,event.player)>0; + }, + content:function(){ + "step 0" + trigger.player.judge(function(card){ + return get.suit(card)=='heart'?1:0; + }); + "step 1" + if(result.bool){ + trigger.player.recover(); + } + }, + ai:{ + threaten:1.2, + expose:0.2 + } + }, + kongxin:{ + enable:'phaseUse', + usable:1, + filterTarget:function(card,player,target){ + return target!=player&&target.num('h'); + }, + filter:function(event,player){ + return player.num('h')?true:false; + }, + content:function(){ + "step 0" + player.chooseToCompare(target); + "step 1" + if(result.bool){ + event.bool=true; + player.chooseTarget('选择一个目标视为'+get.translation(target)+'对其使用一张杀',function(card,player,target2){ + return player!=target2&&target.canUse('sha',target2); + }).ai=function(target){ + return ai.get.effect(target,{name:'sha'},target,player); + } + } + else{ + target.discardPlayerCard(player); + } + "step 2" + if(event.bool&&result.bool){ + target.useCard({name:'sha'},result.targets); + } + }, + ai:{ + order:7, + result:{ + target:function(player,target){ + if(ai.get.attitude(player,target)>=0) return 0; + for(var i=0;i0){ + return -1; + } + } + return 0; + } + } + } + }, + kongxin2:{ + trigger:{player:'dying'}, + priority:10, + forced:true, + popup:false, + filter:function(event,player){ + return player==game.me; + }, + content:function(){ + player.removeSkill('kongxin2'); + game.swapPlayer(player); + player.storage.kongxin.lockOut=false; + player.storage.kongxin.out(); + if(player==game.me) game.swapPlayer(player.storage.kongxin); + if(lib.config.mode=='identity') player.storage.kongxin.setIdentity(); + delete player.storage.kongxin; + }, + }, + lianyao_hujia:{ + mode:['identity','guozhan'], + enable:'phaseUse', + usable:1, + filter:function(event,player){ + if(player!=game.me) return false; + var card=player.get('e','5'); + if(card.storage.shouhua&&card.storage.shouhua.length) return true; + return false; + }, + content:function(){ + "step 0" + var list=[]; + var card=player.get('e','5'); + for(var i=0;i=0) return -1; + return 1; + }; + next.autochoose=lib.filter.autoRespondShan; + } + "step 1" + if(result.bool==false){ + event.trigger('shaHit'); + } + else{ + event.trigger('shaMiss'); + } + "step 2" + if(result.bool==false&&!event.unhurt){ + target.damage(get.nature(event.card)); + event.result={bool:true} + event.trigger('shaDamage'); + } + else{ + event.result={bool:false} + event.trigger('shaUnhirt'); + } + }, + ai:{ + basic:{ + useful:[5,1], + value:[5,1], + }, + order:3, + result:{ + target:-1.5, + }, + tag:{ + respond:1, + respondShan:1, + damage:function(card){ + if(card.nature=='poison') return; + return 1; + }, + natureDamage:function(card){ + if(card.nature) return 1; + }, + fireDamage:function(card,nature){ + if(card.nature=='fire') return 1; + }, + thunderDamage:function(card,nature){ + if(card.nature=='thunder') return 1; + }, + poisonDamage:function(card,nature){ + if(card.nature=='poison') return 1; + } + } + } + }, + shacopy:{ + ai:{ + basic:{ + useful:[5,1], + value:[5,1], + }, + order:3, + result:{ + target:-1.5, + }, + tag:{ + respond:1, + respondShan:1, + damage:function(card){ + if(card.nature=='poison') return; + return 1; + }, + natureDamage:function(card){ + if(card.nature) return 1; + }, + fireDamage:function(card,nature){ + if(card.nature=='fire') return 1; + }, + thunderDamage:function(card,nature){ + if(card.nature=='thunder') return 1; + }, + poisonDamage:function(card,nature){ + if(card.nature=='poison') return 1; + } + } + } + }, + shan:{ + fullskin:true, + type:'basic', + ai:{ + basic:{ + useful:[7,2], + value:[7,2] + } + } + }, + tao:{ + fullskin:true, + type:'basic', + enable:function(card,player){ + return player.hp2) return 0; + if(target.hp<0&&target!=player&&target.identity!='zhu') return 0; + if(ai.get.attitude(player,target)<3) return 0; + if(lib.config.mode=='identity'&&player.identity=='fan'&&target.identity=='fan'){ + var tri=_status.event.parent._trigger; + if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='fan'&&tri.source!=target){ + var num=target.num('h','jiu')?1:0; + for(var i=0;i1) return 2; + } + } + return 0; + } + } + return 2; + }, + }, + tag:{ + recover:1, + save:1, + } + } + }, + bagua:{ + fullskin:true, + type:'equip', + subtype:'equip2', + ai:{ + basic:{ + equipValue:8 + } + }, + skills:['bagua_skill'] + }, + jueying:{ + fullskin:true, + type:'equip', + subtype:'equip3', + distance:{globalTo:1}, + }, + dilu:{ + fullskin:true, + type:'equip', + subtype:'equip3', + distance:{globalTo:1}, + }, + zhuahuang:{ + fullskin:true, + type:'equip', + subtype:'equip3', + distance:{globalTo:1}, + }, + chitu:{ + fullskin:true, + type:'equip', + subtype:'equip4', + distance:{globalFrom:-1}, + }, + dawan:{ + fullskin:true, + type:'equip', + subtype:'equip4', + distance:{globalFrom:-1}, + }, + zixin:{ + fullskin:true, + type:'equip', + subtype:'equip4', + distance:{globalFrom:-1}, + }, + zhuge:{ + fullskin:true, + type:'equip', + subtype:'equip1', + ai:{ + basic:{ + equipValue:function(card,player){ + var num=1,i,no_target=true; + for(i=0;i1) return 0; + return 2-2*get.distance(player,target,'absolute')/game.players.length; + } + }, + tag:{ + draw:1, + multitarget:1 + } + } + }, + taoyuan:{ + fullskin:true, + type:'trick', + enable:true, + selectTarget:-1, + filterTarget:function(card,player,target){ + return target.hp=0) return 0; + return 1; + }; + next.autochoose=lib.filter.autoRespondSha; + "step 1" + if(result.bool==false){ + target.damage(); + } + }, + ai:{ + wuxie:function(target,card,player,viewer){ + if(ai.get.attitude(viewer,target)>0&&target.num('h','sha')){ + if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; + } + }, + basic:{ + order:9, + useful:[5,1] + }, + result:{ + target:function(player,target){ + var num=0; + for(var i=0;i1) return 0; + return -1.5; + }, + }, + tag:{ + respond:1, + respondSha:1, + damage:1, + multitarget:1, + multineg:1, + } + } + }, + wanjian:{ + fullskin:true, + type:'trick', + enable:true, + selectTarget:-1, + filterTarget:function(card,player,target){ + return target!=player; + }, + content:function(){ + "step 0" + var next=target.chooseToRespond({name:'shan'}); + next.ai=function(card){ + if(ai.get.damageEffect(target,player,target)>=0) return 0; + return 1; + }; + next.autochoose=lib.filter.autoRespondShan; + "step 1" + if(result.bool==false){ + target.damage(); + } + }, + ai:{ + wuxie:function(target,card,player,viewer){ + if(ai.get.attitude(viewer,target)>0&&target.num('h','shan')){ + if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; + } + }, + basic:{ + order:9, + useful:1 + }, + result:{ + target:function(player,target){ + var num=0; + for(var i=0;i1) return 0; + return -1.5; + }, + }, + tag:{ + respond:1, + respondShan:1, + damage:1, + multitarget:1, + multineg:1, + } + } + }, + wuzhong:{ + fullskin:true, + type:'trick', + enable:true, + selectTarget:-1, + filterTarget:function(card,player,target){ + return target==player; + }, + content:function(){ + target.draw(2); + }, + ai:{ + basic:{ + order:7.2, + useful:4, + value:10 + }, + result:{ + target:2, + }, + tag:{ + draw:2 + } + } + }, + juedou:{ + fullskin:true, + type:'trick', + enable:true, + filterTarget:function(card,player,target){ + return target!=player; + }, + content:function(){ + "step 0" + if(event.turn==undefined) event.turn=target; + "step 1" + event.trigger('juedou'); + "step 2" + if(event.directHit){ + event._result={bool:false}; + } + else{ + var next=event.turn.chooseToRespond({name:'sha'}); + next.ai=function(card){ + if(event.turn==target){ + if(ai.get.attitude(target,player)<0){ + return ai.get.unuseful2(card) + } + return -1; + } + else{ + if(ai.get.attitude(player,target)<0){ + return ai.get.unuseful2(card) + } + return -1; + } + }; + next.autochoose=lib.filter.autoRespondSha; + if(event.turn==target){ + next.source=player; + } + else{ + next.source=target; + } + } + "step 3" + if(result.bool){ + if(event.turn==target) event.turn=player; + else event.turn=target; + event.goto(1); + } + else{ + if(event.turn==target){ + target.damage(); + } + else{ + player.damage(target); + } + } + }, + ai:{ + basic:{ + order:5, + useful:1, + value:4 + }, + result:{ + target:-1.5, + player:function(player,target){ + if(ai.get.damageEffect(target,player,target)>0&&ai.get.attitude(player,target)>0&&ai.get.attitude(target,player)>0){ + return 0; + } + if(target.num('h','sha')>player.num('h','sha')){ + return -2; + } + return -0.5; + } + }, + tag:{ + respond:2, + respondSha:2, + damage:1, + } + } + }, + shunshou:{ + fullskin:true, + type:'trick', + enable:true, + range:{global:1}, + selectTarget:1, + filterTarget:function(card,player,target){ + if(player==target) return false; + return (target.num('hej')>0); + }, + content:function(){ + "step 0" + if(target.num('hej')){ + player.choosePlayerCard(target,true); + } + else{ + event.finish(); + } + "step 1" + player.gain(result.buttons[0].link); + target.$give(1,player); + }, + ai:{ + wuxie:function(target,card,player,viewer){ + if(ai.get.attitude(viewer,player)>0&&ai.get.attitude(viewer,target)>0){ + return 0; + } + }, + basic:{ + order:7.5, + useful:4, + value:9 + }, + result:{ + target:function(player,target){ + if(ai.get.attitude(player,target)<=0) return (target.num('he')>0)?-1.5:1.5; + var js=target.get('j'); + if(js.length){ + var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; + if(jj.name=='shunshou') return 3; + if(js.length==1&&ai.get.effect(target,jj,target,player)>=0){ + return -1.5; + } + return 3; + } + return -1.5; + }, + player:1 + }, + tag:{ + loseCard:1, + gain:1, + } + } + }, + guohe:{ + fullskin:true, + type:'trick', + enable:true, + selectTarget:1, + filterTarget:function(card,player,target){ + if(player==target) return false; + return (target.num('hej')>0); + }, + content:function(){ + "step 0" + if(target.num('hej')){ + player.choosePlayerCard(target,true); + } + else{ + event.finish(); + } + "step 1" + target.discard(result.buttons[0].link); + }, + ai:{ + basic:{ + order:9, + useful:1, + value:5, + }, + result:{ + target:function(player,target){ + if(ai.get.attitude(player,target)<=0) return (target.num('he'))?-1.5:1.5; + var js=target.get('j'); + if(js.length){ + var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; + if(jj.name=='guohe') return 3; + if(js.length==1&&ai.get.effect(target,jj,target,player)>=0){ + return -1.5; + } + return 2; + } + return -1.5; + }, + }, + tag:{ + loseCard:1, + } + } + }, + jiedao:{ + fullskin:true, + type:'trick', + enable:true, + selectTarget:2, + multitarget:true, + targetprompt:['被借刀','出杀目标'], + filterTarget:function(card,player,target){ + if(ui.selected.targets.length==0){ + return (player!=target&&target.get('e',{subtype:'equip1'}).length); + } + else{ + return lib.filter.filterTarget({name:'sha'},ui.selected.targets[0],target); + } + }, + content:function(){ + "step 0" + targets[0].chooseToUse('对'+get.translation(targets[1])+'使用一张杀,或令'+get.translation(player)+'获得你的武器牌',{name:'sha'},targets[1],-1); + "step 1" + if(result.bool==false){ + player.gain(targets[0].get('e',{subtype:'equip1'})); + targets[0].$give(targets[0].get('e',{subtype:'equip1'}),player); + } + }, + ai:{ + basic:{ + order:8, + value:2, + useful:1, + }, + result:{ + target:-1.5, + player:function(player){ + if(player.get('he',{subtype:'equip1'}).length) return 0; + return 1.5; + }, + }, + tag:{ + gain:1, + use:1, + useSha:1, + multitarget:1, + multineg:1, + loseCard:1, + } + } + }, + wuxie:{ + fullskin:true, + type:'trick', + ai:{ + basic:{ + useful:[6,4], + value:[6,4], + }, + result:{player:1}, + expose:0.2 + }, + notarget:true, + content:function(){}, + }, + lebu:{ + fullskin:true, + type:'delay', + filterTarget:function(card,player,target){ + return (lib.filter.judge(card,player,target)&&player!=target); + }, + judge:function(card){ + if(get.suit(card)=='heart') return 0; + return -3; + }, + effect:function(){ + if(result.bool==false){ + player.skip('phaseUse'); + } + }, + ai:{ + basic:{ + order:1, + useful:1, + value:8, + }, + result:{ + target:function(player,target){ + var num=target.hp-target.num('h')-2; + if(num>-1) return -1; + if(target.hp<3) num--; + if(target.hp<2) num--; + if(target.hp<1) num--; + return num; + } + }, + tag:{ + skip:'phaseUse' + } + } + }, + shandian:{ + fullskin:true, + type:'delay', + enable:function(card,player){ + return (lib.filter.judge(card,player,player)); + }, + filterTarget:function(card,player,target){ + return (lib.filter.judge(card,player,target)&&player==target); + }, + selectTarget:[-1,-1], + judge:function(card){ + if(get.suit(card)=='spade'&&get.number(card)>1&&get.number(card)<10) return -6; + return 0; + }, + effect:function(){ + if(result.judge){ + player.damage(3,'thunder','nosource'); + } + else{ + if(!card.expired){ + if(card.name!='shandian'){ + player.next.addJudge('shandian',card); + } + else{ + player.next.addJudge(card); + } + } + else{ + card.expired=false; + } + } + }, + cancel:function(){ + if(!card.expired){ + player.next.addJudge(card); + } + else{ + card.expired=false; + } + }, + ai:{ + basic:{ + order:1, + useful:0, + value:0, + }, + result:{ + target:function(player,target){ + var rejudge,num=0; + for(var i=0;i0&& + ai.get.attitude(game.players[i],target)>0) num+=rejudge; + else num-=rejudge; + } + } + } + if(num>0) return num; + if(num==0){ + if(lib.config.mode=='identity'){ + if(target.identity=='nei') return 1; + var situ=ai.get.situation(); + if(target.identity=='fan'){ + if(situ>1) return 1; + } + else{ + if(situ<-1) return 1; + } + } + else if(lib.config.mode=='guozhan'){ + if(target.identity=='ye') return 1; + for(var i=0;i2&&target.hp<2) return 1; + if(game.players.length<3) return -1; + if(target.hp<=2&&target.num('he')<=3) return 1; + } + } + } + return -1; + } + }, + tag:{ + // damage:1, + // natureDamage:1, + // thunderDamage:1, + } + } + }, + }, + skill:{ + zhuge_skill:{ + mod:{ + cardUsable:function(card,player,num){ + if(card.name=='sha') return Infinity; + } + }, + }, + cixiong_skill:{ + trigger:{player:'shaBegin'}, + priority:5, + filter:function(event,player){ + if(player.sex=='male'&&event.target.sex=='female') return true; + if(player.sex=='female'&&event.target.sex=='male') return true; + return false; + }, + content:function(){ + "step 0" + trigger.target.chooseToDiscard().ai=function(card){ + return -ai.get.attitude(trigger.target,player)-ai.get.value(card); + }; + "step 1" + if(result.bool==false) player.draw(); + } + }, + qinggang_skill:{ + trigger:{player:'useCard'}, + forced:true, + priority:10, + filter:function(event){ + return event.card.name=='sha'; + }, + content:function(){ + player.addTempSkill('unequip','useCardAfter'); + } + }, + qinglong_skill:{ + trigger:{player:'shaMiss'}, + direct:true, + content:function(){ + "step 0" + player.chooseToUse('是否发动青龙偃月刀?',{name:'sha'},trigger.target,-1); + "step 1" + if(result.bool) player.logSkill('qinglong'); + } + }, + zhangba_skill:{ + enable:['chooseToUse','chooseToRespond'], + filterCard:true, + selectCard:2, + position:'h', + viewAs:{name:'sha'}, + prompt:'将两张手牌当杀使用或打出', + check:function(card){return 6-ai.get.useful(card)}, + ai:{ + respondSha:true, + } + }, + guanshi_skill:{ + trigger:{player:'shaMiss'}, + direct:true, + filter:function(event,player){ + return player.num('he')>2; + }, + content:function(){ + "step 0" + player.chooseToDiscard('是否发动贯石斧?',2,'he',function(card){ + return player.get('e',{subtype:'equip1'}).contains(card)==false; + }).ai= + function(card){ + if(ai.get.attitude(player,trigger.target)<0){ + if(player.skills.contains('jiu')|| + player.skills.contains('tianxianjiu')|| + trigger.target.hp==1){ + return 7-ai.get.value(card) + } + return 5-ai.get.value(card) + } + return -1; + }; + "step 1" + if(result.bool){ + player.logSkill('guanshi'); + trigger.untrigger(); + trigger.trigger('shaHit'); + trigger._result.bool=false; + } + } + }, + fangtian_skill:{ + mod:{ + selectTarget:function(card,player,range){ + if(card.name!='sha') return; + if(range[1]==-1) return; + var cards=player.get('h'); + for(var i=0;i0 + }, + content:function(){ + "step 0" + player.chooseButton(ui.create.dialog('选择要弃置的马',trigger.target.get('e',{subtype:['equip3','equip4']}))); + "step 1" + if(result.bool){ + trigger.target.discard(result.buttons[0].link); + } + } + }, + bagua_skill:{ + trigger:{player:'chooseToRespondBegin'}, + filter:function(event,player){ + if(!event.filterCard({name:'shan'})) return false; + if(event.parent.player.num('s','unequip')) return false; + return true; + }, + content:function(){ + "step 0" + player.judge('bagua',function(card){return (get.color(card)=='red')?1.5:-0.5}); + "step 1" + if(result.judge>0){ + trigger.untrigger(); + trigger.responded=true; + trigger.result={bool:true,card:{name:'shan'}} + } + }, + ai:{ + effect:{ + target:function(card,player,target,effect){ + if(player.num('s','unequip')) return; + if(get.tag(card,'respondShan')) return 0.5; + } + } + } + }, + _wuxie1:{ + trigger:{player:'useCardToBefore'}, + priority:5, + filter:function(event,player){ + if(!event.target) return false; + if(get.type(event.card)!='trick') return false; + return true; + }, + popup:false, + forced:true, + content:function(){ + "step 0" + if(trigger.multitarget){ + event.source2=trigger.targets; + } + event.source=trigger.target; + event.current=trigger.player; + event.end=trigger.player; + event.state=true; + event.card=trigger.card; + "step 1" + if(ui.wuxie.classList.contains('glow')&&!_status.auto){ + if(event.current==game.me){ + event._result={bool:false}; + return; + } + if(lib.config.mode=='versus'&&lib.storage.single_control&&event.current.side==game.me.side){ + event._result={bool:false}; + return; + } + } + if(event.current.num('h','wuxie')==0){ + var noask=true; + var skills=event.current.get('s',true).concat(lib.skill.global); + game.expandSkills(skills); + for(var i=0;i1; + }, + content:function(){ + "step 0" + target.chooseToDiscard({color:'black'},'弃置一张黑色手牌或受流失一点体力').ai=function(card){ + return 8-ai.get.value(card); + }; + "step 1" + if(!result.bool){ + target.loseHp(); + } + }, + ai:{ + basic:{ + order:9, + value:3, + useful:1, + }, + result:{ + target:-2 + }, + tag:{ + discard:1, + loseHp:1 + } + } + }, + caoyao:{ + fullskin:true, + type:'basic', + range:{global:1}, + enable:true, + filterTarget:function(card,player,target){ + return target.hp0}, + notarget:true, + content:function(){ + "step 0" + var list=[]; + for(var i=0;i3) return 7; + } + return -10; + }, + result:{ + player:function(player){ + if(player.hp<=2) return -1; + for(var i=0;i3) return 2; + } + return -10; + } + }, + } + }, + pantao:{ + type:'basic', + enable:function(card,player){ + return player.hp0) return 1; + } + } + } + return 0; + }, + }, + } + }, + langeguaiyi:{ + fullskin:true, + type:'equip', + subtype:'equip5', + skills:['longfan'], + ai:{ + basic:{ + equipValue:7, + } + } + }, + guiyoujie:{ + fullskin:true, + type:'delay', + filterTarget:function(card,player,target){ + return (lib.filter.judge(card,player,target)&&player!=target); + }, + judge:function(card){ + if(get.color(card)=='red') return 0; + return -3; + }, + effect:function(){ + if(result.bool==false){ + player.turnOver(); + player.draw(); + } + }, + ai:{ + basic:{ + order:1, + useful:1, + value:6, + }, + result:{ + target:-3 + }, + } + }, + yufulu:{ + fullskin:true, + type:'equip', + enable:function(card,player){ + return player.sex=='female'; + }, + subtype:'equip5', + skills:['touzhi'], + ai:{ + basic:{ + equipValue:function(card,player){ + if(player.sex=='female') return 5; + return 0; + }, + } + } + }, + xixueguizhihuan:{ + fullskin:true, + type:'equip', + subtype:'equip5', + skills:['xixue'], + ai:{ + basic:{ + equipValue:5 + } + } + }, + zhufangshenshi:{ + fullskin:true, + chongzhu:true, + type:'basic', + enable:function(){ + return game.players.length>2; + }, + filterTarget:function(card,player,target){ + return player.next==target||player.previous==target; + }, + content:function(){ + game.swapSeat(player,target); + }, + ai:{ + basic:{ + order:7, + }, + result:{ + target:function(player,target){ + if(player.next==target) return -1; + if(player.previous==target) return 1; + } + } + }, + mode:['identity','guozhan'], + }, + jingleishan:{ + fullskin:true, + type:'trick', + enable:true, + selectTarget:-1, + filterTarget:function(card,player,target){ + return target!=player; + }, + content:function(){ + "step 0" + var next=target.chooseToRespond({name:'sha'}); + next.ai=function(card){ + if(ai.get.damageEffect(target,player,target,'thunder')>=0) return 0; + return 1; + }; + next.autochoose=lib.filter.autoRespondSha; + "step 1" + if(result.bool==false){ + target.damage('thunder'); + } + }, + ai:{ + wuxie:function(target,card,player,viewer){ + if(ai.get.attitude(viewer,target)>0&&target.num('h','sha')){ + if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; + } + }, + basic:{ + order:9, + useful:[5,1] + }, + result:{ + target:function(player,target){ + if(target.hasSkillTag('nothunder')) return 0; + var num=0; + for(var i=0;i1) return 0; + return -1.5; + }, + }, + tag:{ + respond:1, + respondSha:1, + damage:1, + natureDamage:1, + thunderDamage:1, + multitarget:1, + multineg:1, + } + } + }, + chiyuxi:{ + fullskin:true, + type:'trick', + enable:true, + selectTarget:-1, + filterTarget:function(card,player,target){ + return target!=player; + }, + content:function(){ + "step 0" + var next=target.chooseToRespond({name:'shan'}); + next.ai=function(card){ + if(ai.get.damageEffect(target,player,target,'fire')>=0) return 0; + return 1; + }; + next.autochoose=lib.filter.autoRespondShan; + "step 1" + if(result.bool==false){ + target.damage('fire'); + } + }, + ai:{ + wuxie:function(target,card,player,viewer){ + if(ai.get.attitude(viewer,target)>0&&target.num('h','shan')){ + if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; + } + }, + basic:{ + order:9, + useful:1 + }, + result:{ + target:function(player,target){ + if(target.hasSkillTag('nofire')) return 0; + var num=0; + for(var i=0;i1) return 0; + return -1.5; + }, + }, + tag:{ + respond:1, + respondShan:1, + damage:1, + natureDamage:1, + fireDamage:1, + multitarget:1, + multineg:1, + } + } + }, + guangshatianyi:{ + fullskin:true, + type:'equip', + enable:function(card,player){ + return player.sex=='female'; + }, + subtype:'equip2', + skills:['guangshatianyi'], + ai:{ + basic:{ + equipValue:function(card,player){ + if(player.sex=='female') return 6; + return 0; + }, + } + } + }, + guilingzhitao:{ + type:'equip', + subtype:'equip5', + skills:['nigong'], + ai:{ + basic:{ + equipValue:function(card,player){ + if(!player.storage.nigong) return 5; + return 5+player.storage.nigong; + } + } + }, + onLose:function(){ + player.storage.nigong=0; + }, + onEquip:function(){ + player.storage.nigong=0; + } + }, + qipoguyu:{ + type:'equip', + subtype:'equip5', + skills:['xujin'], + onLose:function(){ + player.storage.xujin=0; + }, + onEquip:function(){ + player.storage.xujin=0; + } + }, + sadengjinhuan:{ + fullskin:true, + type:'equip', + subtype:'equip5', + skills:['sadengjinhuan'], + ai:{ + basic:{ + equipValue:6 + } + }, + }, + ximohu:{ + type:'equip', + subtype:'equip5', + skills:['ximohu'], + ai:{ + basic:{ + equipValue:6 + } + }, + }, + guiyanfadao:{ + type:'equip', + subtype:'equip1', + distance:{attackFrom:-1}, + ai:{ + basic:{ + equipValue:3 + } + }, + skills:['guiyanfadao'] + }, + }, + skill:{ + baihupifeng:{ + trigger:{player:'phaseEnd'}, + frequent:true, + filter:function(event,player){ + if(player.hp==player.maxHp) return false; + for(var i=0;igame.players[i].hp) return false; + } + return true; + }, + content:function(){ + player.recover(); + }, + }, + // fengxueren:{ + // trigger:{source:'damageEnd'}, + // filter:function(event){ + // return event.card&&event.card.name=='sha'; + // }, + // forced:true, + // content:function(){ + // "step 0" + // trigger.player.turnOver(); + // trigger.player.popup('fengxueren'); + // "step 1" + // trigger.player.draw(); + // "step 2" + // if(player.num('he')){ + // player.chooseToDiscard(true); + // } + // } + // }, + fengxueren:{ + trigger:{player:'shaHit'}, + check:function(event,player){ + var att=ai.get.attitude(player,event.target); + if(player.skills.contains('jiu')) return att>0; + if(event.target.hasSkillTag('maixie')){ + return att<=0; + } + if(event.target.hp==1) return att>0; + if(player.skills.contains('tianxianjiu')) return false; + return att<=0; + }, + filter:function(event,player){ + return !event.target.isTurnedOver()&&!player.skills.contains('fengxueren2'); + }, + content:function(){ + trigger.unhurt=true; + trigger.target.turnOver(); + player.addTempSkill('fengxueren2','phaseAfter') + } + }, + fengxueren2:{}, + chilongya:{ + trigger:{source:'damageBefore'}, + forced:true, + priority:5, + content:function(){ + trigger.nature='fire'; + } + }, + chilongya2:{ + trigger:{source:'damageBegin'}, + filter:function(event,player){ + return (event.card&&event.card.name=='sha'); + }, + popup:false, + forced:true, + content:function(){ + if(Math.random()<0.5){ + trigger.num++; + trigger.player.addSkill('chilongfengxue'); + } + } + }, + chilongfengxue:{ + trigger:{global:'shaAfter'}, + forced:true, + popup:false, + content:function(){ + player.draw(); + player.removeSkill('chilongfengxue'); + } + }, + shentou:{ + enable:'phaseUse', + usable:1, + filterCard:true, + check:function(card){ + return 8-ai.get.value(card); + }, + filterTarget:function(card,player,target){ + if(target.get('h').length==0) return false; + if(target==player) return false; + if(target.num('h')<=player.num('h')) return false; + return true; + }, + content:function(){ + "step 0" + player.judge(function(card){ + if(get.suit(card)=='club') return -1; + return 1; + }); + "step 1" + if(result.bool){ + player.gain(target.get('h').randomGet()); + target.$give(1,player); + } + }, + ai:{ + basic:{ + order:5 + }, + result:{ + player:0.3, + target:-1, + } + } + }, + pusafazhou:{ + trigger:{player:'dieBefore'}, + forced:true, + filter:function(event,player){ + return player.maxHp>0; + }, + content:function(){ + trigger.untrigger(); + trigger.finish(); + player.hp=1; + player.draw(); + player.discard(player.get('e',{subtype:'equip5'})); + game.delay(); + } + }, + old_longfan:{ + enable:'phaseUse', + usable:1, + prompt:'?', + filterTarget:true, + content:function(){ + "step 0" + if(event.isMine()){ + event.longfan=ui.create.control('〇','〇','〇','〇',function(){ + event.longfan.status--; + }); + event.longfan.status=4; + for(var i=0;i1) event.count(1); + if(event.longfan.status>2) event.count(2); + if(event.longfan.status>3) event.count(3); + },200); + event.count=function(num){ + event.longfan.childNodes[num].num=(event.longfan.childNodes[num].num+1)%10; + if(event.longfan.childNodes[num].num==2) event.longfan.childNodes[num].innerHTML='二'; + else event.longfan.childNodes[num].innerHTML=get.cnNumber(event.longfan.childNodes[num].num); + } + game.pause(); + } + else{ + event.finish(); + var x=Math.random(); + if(x<0.1) target.draw(); + else if(x<0.2) target.chooseToDiscard(true); + else if(x<0.3) target.loseHp(); + else if(x<0.4) target.recover(); + else if(x<0.6){ + if(ai.get.attitude(player,target)>0) target.draw(); + else target.chooseToDiscard(true); + } + else if(x<0.8){ + if(ai.get.attitude(player,target)>0) target.recover(); + else target.loseHp(); + } + } + "step 1" + var str=''; + for(var i=0;iplayer.hp?2:0;break; + case 'diamond':return 1;break; + case 'club':return 1;break; + case 'spade':return 0;break; + } + }); + "step 1" + switch(result.suit){ + case 'heart':player.recover();break; + case 'diamond':player.draw();break; + case 'club':{ + player.chooseTarget('弃置一名角色的一张牌',function(card,player,target){ + return player!=target&&target.num('he')>0; + }).ai=function(target){ + return -ai.get.attitude(player,target); + }; + break; + } + } + if(result.suit!='club'){ + event.finish(); + } + "step 2" + if(result.bool&&result.targets&&result.targets.length){ + player.discardPlayerCard(result.targets[0],'he',true); + } + }, + ai:{ + order:10, + result:{ + player:1 + } + } + }, + touzhi:{ + enable:'phaseUse', + usable:1, + filterCard:function(card){ + return get.subtype(card)=='equip1'; + }, + filter:function(event,player){ + return player.num('he',{subtype:'equip1'})>0; + }, + discard:false, + prepare:function(cards,player,targets){ + player.$give(cards,targets[0]); + }, + filterTarget:function(card,player,target){ + if(player==target) return false; + return true; + }, + content:function(){ + target.damage(); + target.gain(cards); + game.delay(); + }, + check:function(card){ + return 10-ai.get.value(card); + }, + position:'he', + ai:{ + basic:{ + order:8 + }, + result:{ + target:-1 + } + } + }, + xixue:{ + trigger:{source:'damageEnd'}, + forced:true, + filter:function(event,player){ + return event.card&&event.card.name=='sha' + }, + content:function(){ + player.recover(trigger.num); + } + }, + guangshatianyi:{ + trigger:{player:'damageBegin'}, + forced:true, + filter:function(event,player){ + if(event.source&&event.source.num('s','unequip')) return; + if(Math.random()>1/3) return false; + if(event.parent.player.num('s','unequip')) return false; + return true; + }, + content:function(){ + trigger.num--; + } + }, + nigong:{ + trigger:{player:'damageAfter'}, + group:['nigong2'], + forced:true, + content:function(){ + player.storage.nigong+=trigger.num; + if(player.storage.nigong>4){ + player.storage.nigong=4; + } + }, + ai:{ + threaten:0.6, + effect:function(card,player,target){ + if(get.tag(card,'damage')) return [1,0.5]; + } + }, + intro:{ + content:function(storage){ + return '已积攒'+storage+'点伤害'; + } + } + }, + nigong2:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.storage.nigong>1; + }, + filterTarget:function(card,player,target){ + return player!=target; + }, + content:function(){ + target.damage(Math.floor(player.storage.nigong/2)); + player.storage.nigong=0; + }, + ai:{ + order:10, + result:{ + target:function(player,target){ + return -Math.floor(player.storage.nigong/2); + } + } + } + }, + xujin:{ + trigger:{player:'phaseBefore'}, + check:function(){return false;}, + filter:function(event,player){ + return player.storage.xujin0; + }, + content:function(){ + trigger.num+=player.storage.xujin; + player.storage.xujin--; + } + }, + sadengjinhuan:{ + trigger:{player:'shaMiss'}, + check:function(event,player){ + return ai.get.attitude(player,event.target)<0; + }, + content:function(){ + "step 0" + player.judge(function(card){ + return get.color(card)=='red'?1:0; + }) + "step 1" + if(result.bool){ + trigger.target.chooseToRespond({name:'shan'}).autochoose=lib.filter.autoRespondShan; + } + else{ + event.finish(); + } + "step 2" + if(!result.bool){ + trigger.untrigger(); + trigger.trigger('shaHit'); + trigger._result.bool=false; + } + } + }, + ximohu:{ + trigger:{player:'damageBefore'}, + forced:true, + filter:function(event){ + return event.nature=='thunder'; + }, + content:function(){ + trigger.untrigger(); + trigger.finish(); + player.recover(trigger.num); + }, + ai:{ + effect:function(card){ + if(get.tag(card,'thunderDamage')) return [0,2]; + } + } + }, + guiyanfadao:{ + trigger:{player:'useCardToBefore'}, + priority:5, + filter:function(event,player){ + if(event.card.name=='sha'&&!event.card.nature) return true; + }, + content:function(){ + trigger.card.nature='poison'; + player.addSkill('guiyanfadao2'); + player.storage.zhuque_skill=trigger.card; + } + }, + guiyanfadao2:{ + trigger:{player:'useCardAfter'}, + forced:true, + popup:false, + content:function(){ + delete player.storage.zhuque_skill.nature; + } + }, + tianxianjiu:{ + trigger:{source:'damageEnd'}, + filter:function(event){ + return (event.card&&(event.card.name=='sha')); + }, + forced:true, + content:function(){ + player.draw(2); + player.removeSkill('tianxianjiu'); + } + }, + }, + translate:{ + guiyanfadao:'鬼眼法刀', + guiyanfadao_bg:'眼', + // guiyanfadao_info:'你可以将一张普通杀当毒杀使用', + tianxianjiu:'天仙酒', + tianxianjiu_bg:'仙', + tianxianjiu_info:'出牌阶段对自己使用,你使用的下一张杀造成伤害后可以摸两张牌', + xiangyuye:'翔羽叶', + xiangyuye_info:'出牌阶段,对一名攻击范围外的角色使用,令其弃置一张黑色手牌或流失一点体力', + huanpodan:'还魄丹', + huanpodan_bg:'魄', + // huanpodan_info:'出牌阶段对一名已死亡角色使用,令其复活并回复一点体力,然后你流失一点体力', + ximohu:'吸魔壶', + ximohu_bg:'魔', + // ximohu_info:'锁定技,你将即将受到的雷属性伤害转化为你的体力值', + sadengjinhuan:'萨登荆环', + sadengjinhuan_info:'当你的杀被闪避后,可以进行一次判定,若结果为红色目标需再打出一张闪', + // sadengjinhuan_info:'锁定技,每当你使用一张杀被闪避后,若此杀在弃牌堆,你有50%的机率对目标再使用一次此杀', + sadengjinhuan_bg:'荆', + qipoguyu:'奇魄古玉', + xujin:'蓄劲', + xujin2:'蓄劲', + // qipoguyu_info:'装备后获得蓄劲技能', + xujin_info:'回合开始前,若你的蓄劲标记数小于当前的体力值,你可以跳过此回合,并获得一枚蓄劲标记。锁定技,每当你即将造成伤害,你令此伤害+X,然后弃置一枚蓄劲标记,X为你拥有的蓄劲标记数', + guilingzhitao:'归灵指套', + nigong:'逆攻', + nigong2:'逆攻', + nigong3:'逆攻', + nigong4:'逆攻', + // guilingzhitao_info:'装备后获得逆攻技能', + nigong_info:'每当你受到一点伤害,你获得一个逆攻标记,标记数不能超4。出牌阶段,你可以弃置所有逆攻标记并令任意一名其他角色X/2点伤害,X为逆攻标记的数量且向下取整', + baihupifeng:'白狐披风', + baihupifeng_bg:'狐', + baihupifeng_info:'回合结束阶段,若你的体力值是全场最小的之一,你可以回复一点体力', + fengxueren:'封雪刃', + fengxueren_bg:'雪', + // fengxueren_info:'你使用杀击中目标后,可以防止伤害并令目标翻面,每回合限发动一次', + chilongya:'赤龙牙', + // chilongya_info:'锁定技,你即将造成的伤害均视为火焰伤害', + daihuofenglun:'带火风轮', + daihuofenglun_bg:'轮', + // daihuofenglun_info:'你与其他角色的距离-2,其他角色与你的距离-1', + xiayuncailing:'霞云彩绫', + xiayuncailing_bg:'云', + // xiayuncailing_info:'你与其他角色的距离+1,其他角色与你的距离+2', + shentoumianju:'神偷面具', + shentoumianju_bg:'偷', + shentoumianju_info:'出牌阶段,你可以指定一名手牌比你多的角色进行一次判定,若结果不为梅花,你获得其一张手牌', + shentou:'神偷', + shentou_info:'出牌阶段,你可以进行一次判定,若结果不为梅花,你获得任意一名角色的一张手牌', + pusafazhou:'菩萨发咒', + pusafazhou_bg:'发', + // pusafazhou_info:'令你抵挡一次死亡,将体力回复至1,并摸一张牌', + yuhuanghua:'雨皇花', + yuhuanghua_bg:'皇', + // yuhuanghua_info:'令所有角色回复一点体力并摸一张牌', + caoyao:'草药', + caoyao_info:'出牌阶段,对距离为1以内的角色使用,回复一点体力。', + pantao:'蟠桃', + // pantao_info:'出牌阶段,对自己使用,回复两点体力。', + langeguaiyi:'蓝格怪衣', + langeguaiyi_bg:'格', + langeguaiyi_info:'?', + longfan:'龙帆', + longfan_info:'出牌阶段限一次,你可以进行一次判定,然后按花色执行以下效果。红桃:你回复一点体力;方片:你摸一张牌;梅花:你弃置一名其他角色的一张牌;黑桃:无事发生', + // longfan_info:'0000:翻面;1111:弃手牌;2222:弃装备牌;3333:受伤害;4444:流失体力;5555:连环;6666:摸牌;7777:回复体力;8888:弃置判定牌;9999:置衡', + guiyoujie:'鬼幽结', + guiyoujie_info:'出牌阶段,对一名其他角色使用。若判定结果为黑色,则将其翻面。', + yufulu:'御夫录', + yufulu_info:'仅女性角色可以使用,出牌阶段,可弃置一张武器牌令一名角色受到一点伤害,然后该角色获得此武器牌', + touzhi:'投掷', + touzhi_info:'出牌阶段,可弃置一张武器牌令一名角色受到一点伤害,然后该角色获得此武器牌', + xixueguizhihuan:'吸血鬼指环', + xixueguizhihuan_info:'锁定技,每当你使用杀造成一点伤害,你回复一点体力', + xixue:'吸血', + xixue_info:'锁定技,每当你使用杀造成一点伤害,你回复一点体力', + zhufangshenshi:'土地神符', + zhufangshenshi_info:'出牌阶段,对一名相邻角色使用,与其交换位置', + jingleishan:'惊雷闪', + jingleishan_info:'出牌阶段,对所有其他角色使用。每名目标角色需打出一张【杀】,否则受到1点雷电伤害。', + chiyuxi:'炽羽袭', + chiyuxi_info:'出牌阶段,对所有其他角色使用。每名目标角色需打出一张【闪】,否则受到1点火焰伤害。', + guangshatianyi:'光纱天衣', + guangshatianyi_bg:'纱', + // guangshatianyi_info:'仅女性可装备,锁定技,每当你即将受到伤害,有三分之一的概率令伤害减一', + }, + list:[ + ['spade',1,'baihupifeng'], + // ['club',1,'fengxueren'], + ['diamond',1,'langeguaiyi'], + // ['heart',1,'daihuofenglun','fire'], + +// ['diamond',2,'xiayuncailing'], + // ['spade',2,'pusafazhou'], +// ['heart',2,'pantao'], + //['club',2,'huanpodan'], + + ['club',3,'caoyao'], + // ['diamond',3,'chilongya','fire'], + ['spade',3,'guiyoujie'], + //['heart',3,'xiangyuye','poison'], + + ['club',4,'caoyao'], + //['heart',4,'zhufangshenshi'], + //['spade',4,'huanpodan'], +// ['diamond',4,'xiangyuye','poison'], + + ['club',5,'caoyao'], + ['spade',5,'xixueguizhihuan'], + //['diamond',5,'huanpodan'], + + ['club',6,'shentoumianju'], + ['spade',6,'yufulu'], +// ['heart',6,'xiangyuye','poison'], + //['diamond',6,'xiangyuye','poison'], + + ['diamond',7,'chiyuxi','fire'], + ['club',7,'jingleishan','thunder'], + // ['spade',7,'guilingzhitao'], +// ['heart',7,'xiangyuye','poison'], + + ['spade',8,'zhufangshenshi'], + ['club',8,'xiangyuye'], + //['heart',8,'huanpodan'], + + // ['spade',9,'ximohu','brown'], + ['club',9,'guiyoujie'], + ['diamond',9,'xiangyuye'], + + // ['diamond',9,'tianxianjiu'], + ['heart',9,'tianxianjiu'], + ['spade',5,'jiu'], + ['diamond',2,'tianxianjiu'], + + //['spade',10,'qipoguyu'], + //['diamond',10,'xiangyuye','poison'], + + ['spade',11,'xiangyuye'], + // ['club',11,'xiangyuye','poison'], + +// ['diamond',12,'xiangyuye','poison'], + //['spade',12,'guiyanfadao','poison'], + + // ['heart',13,'yuhuanghua'], + // ['diamond',13,'guangshatianyi'], + ['club',13,'sadengjinhuan'], + //['spade',6,'xiangyuye','poison'], + ], +} diff --git a/card/wanxiang.js b/card/wanxiang.js new file mode 100644 index 000000000..2a8fc5e90 --- /dev/null +++ b/card/wanxiang.js @@ -0,0 +1,14 @@ +card.wanxiang={ + card:{ + + }, + skill:{ + + }, + translate:{ + + }, + list:[ + + ], +} \ No newline at end of file diff --git a/card/yibao.js b/card/yibao.js new file mode 100644 index 000000000..29964337c --- /dev/null +++ b/card/yibao.js @@ -0,0 +1,414 @@ +card.yibao={ + card:{ + hufu:{ + fullskin:true, + type:'basic', + ai:{ + value:[7.5,5,2], + useful:[7.5,5,2], + } + }, + huoshan:{ + fullskin:true, + type:'delay', + enable:function(card,player){ + return (lib.filter.judge(card,player,player)); + }, + filterTarget:function(card,player,target){ + return (lib.filter.judge(card,player,target)&&player==target); + }, + selectTarget:[-1,-1], + judge:function(card){ + if(get.suit(card)=='heart'&&get.number(card)>1&&get.number(card)<10) return -6; + return 0; + }, + effect:function(){ + if(result.judge){ + player.damage(2,'fire','nosource'); + var players=get.players(); + for(var i=0;i0&& + ai.get.attitude(game.players[i],target)>0) num+=rejudge; + else num-=rejudge; + } + } + } + if(num>0) return num; + if(num==0){ + if(lib.config.mode=='identity'){ + if(target.identity=='nei') return 1; + var situ=ai.get.situation(); + if(target.identity=='fan'){ + if(situ>1) return 1; + } + else{ + if(situ<-1) return 1; + } + } + else if(lib.config.mode=='guozhan'){ + if(target.identity=='ye') return 1; + for(var i=0;i2&&target.hp<2) return 1; + if(game.players.length<3) return -1; + if(target.hp<=2&&target.num('he')<=3) return 1; + } + } + } + return -1; + } + }, + tag:{ + // damage:1, + // natureDamage:1, + // fireDamage:1, + } + } + }, + hongshui:{ + type:'delay', + enable:function(card,player){ + return (lib.filter.judge(card,player,player)); + }, + filterTarget:function(card,player,target){ + return (lib.filter.judge(card,player,target)&&player==target); + }, + selectTarget:[-1,-1], + judge:function(card){ + if(get.suit(card)=='club'&&get.number(card)>1&&get.number(card)<10) return -3; + return 0; + }, + fullskin:true, + effect:function(){ + if(result.judge){ + if(player.num('he')==0) player.loseHp(); + else player.chooseToDiscard('he',true,3); + var players=get.players(); + for(var i=0;i0&& + ai.get.attitude(game.players[i],target)>0) num+=rejudge; + else num-=rejudge; + } + } + } + if(num>0) return num; + if(num==0){ + if(lib.config.mode=='identity'){ + if(target.identity=='nei') return 1; + var situ=ai.get.situation(); + if(target.identity=='fan'){ + if(situ>0) return 1; + } + else{ + if(situ<0) return 1; + } + } + else if(lib.config.mode=='guozhan'){ + if(game.players.length<=2) return -1; + if(target.identity=='ye') return 1; + for(var i=0;i0; + }, + content:function(){ + "step 0" + target.chooseToDiscard('he',[1,2]).ai=function(card){ + if(target.hasSkillTag('nofire')) return 0; + if(target.hasSkillTag('maixie')&&target.hp>1&&ui.selected.cards.length){ + return 0; + } + if(get.type(card)!='basic'){ + return 10-ai.get.value(card); + } + return 8-ai.get.value(card); + }; + "step 1" + if(!result.bool||result.cards.length<2){ + if(result.bool) target.damage(2-result.cards.length,'fire'); + else target.damage(2,'fire'); + } + }, + ai:{ + basic:{ + order:4, + value:7, + useful:2, + }, + result:{ + target:function(player,target){ + if(target.hasSkillTag('nofire')) return 0; + return -2; + } + }, + tag:{ + damage:2, + fireDamage:2, + natureDamage:2, + discard:2, + loseCard:2, + position:'he', + } + } + }, + dujian:{ + fullskin:true, + type:'basic', + enable:true, + filterTarget:function(card,player,target){ + return target.num('h')>0; + }, + content:function(){ + "step 0" + if(target.num('h')==0||player.num('h')==0){ + event.finish(); + return; + } + player.chooseCard(true); + "step 1" + event.card1=result.cards[0]; + target.chooseCard(true); + "step 2" + event.card2=result.cards[0]; + player.$compare(event.card1,target,event.card2); + game.delay(4); + "step 3" + if(get.color(event.card2)==get.color(event.card1)){ + player.discard(event.card1).animate=false; + target.$gain2(event.card2); + var clone=event.card1.clone; + if(clone){ + clone.style.transition='all 0.5s'; + clone.style.webkitTransform='scale(1.2)'; + clone.delete(); + } + target.loseHp(); + } + else{ + player.$gain2(event.card1); + target.$gain2(event.card2); + target.addTempSkill('dujian2','phaseBegin'); + } + }, + ai:{ + basic:{ + order:2, + value:3, + useful:1, + }, + result:{ + player:function(player,target){ + if(player.num('h')<=Math.max(2,player.hp)&& + _status.event.name=='chooseToUse'&&_status.event.filterCard({name:'dujian'})) return -10; + }, + target:-1.5 + }, + tag:{ + loseHp:1 + } + } + }, + qiankundai:{ + fullskin:true, + type:'equip', + subtype:'equip5', + onLose:function(){ + player.draw(); + }, + skills:['qiankundai'], + ai:{ + order:9.5, + basic:{ + equipValue:function(card,player){ + if(player.num('h','qiankundai')) return 6; + return 1; + } + } + } + }, + }, + skill:{ + dujian2:{}, + qiankundai:{ + mod:{ + maxHandcard:function(player,num){ + return num+1; + } + }, + }, + _hufu_sha:{ + enable:['chooseToRespond','chooseToUse'], + filter:function(event,player){ + return player.num('h','hufu')>0; + }, + filterCard:{name:'hufu'}, + viewAs:{name:'sha'}, + prompt:'将一张虎符当杀使用或打出', + check:function(card){return 1}, + ai:{ + order:1, + useful:7.5, + value:7.5 + } + }, + _hufu_shan:{ + enable:['chooseToRespond','chooseToUse'], + filter:function(event,player){ + return player.num('h','hufu')>0; + }, + filterCard:{name:'hufu'}, + viewAs:{name:'shan'}, + prompt:'将一张虎符当闪使用或打出', + check:function(){return 1}, + ai:{ + order:1, + useful:7.5, + value:7.5 + } + }, + _hufu_jiu:{ + enable:['chooseToRespond','chooseToUse'], + filter:function(event,player){ + return player.num('h','hufu')>0; + }, + filterCard:{name:'hufu'}, + viewAs:{name:'jiu'}, + prompt:'将一张虎符当酒使用', + check:function(){return 1}, + }, + }, + translate:{ + huoshan:'火山', + huoshan_info:'出牌阶段,对自己使用。若判定结果为红桃2~9,则目标角色受到2点火焰伤害,距离目标1以内的其他角色受到1点火焰伤害。若判定不为红桃2~9,将之移动到下家的判定区里。', + hongshui:'洪水', + hongshui_info:'出牌阶段,对自己使用。若判定结果为梅花2~9,该角色须弃置3张牌,距离该角色为X的角色须弃置3-X张牌,若没有牌则失去一点体力,X至少为1', + liuxinghuoyu:'流星火羽', + liuxinghuoyu_info:'出牌阶段,对一名有手牌或装备牌的角色使用,令其弃置0~2张牌,并受到2-X点火焰伤害,X为弃置的卡牌数', + dujian:'毒箭', + dujian_info:'出牌阶段,对一名有手牌或装备牌的角色使用,令其展示一张手牌,若与你选择的手牌颜色相同,你对其造成一点毒属性伤害', + qiankundai:'乾坤袋', + qiankundai_info:'你的手牌上限+1。当你失去该装备时,你摸取一张牌。', + hufu:'虎符', + hufu_bg:'符', + _hufu_sha:'符杀', + _hufu_shan:'符闪', + _hufu_jiu:'符酒', + hufu_info:'你可以将一张虎符当作杀、闪或酒使用或打出', + }, + list:[ + ['heart',1,'hufu'], + ['spade',1,'hufu'], + ['club',1,'qiankundai'], + ['heart',6,'huoshan','fire'], + ['club',7,'hongshui'], + ['diamond',3,'liuxinghuoyu','fire'], + ['heart',6,'liuxinghuoyu','fire'], + ['heart',9,'liuxinghuoyu','fire'], + //['heart',11,'liuxinghuoyu','fire'], + //['heart',12,'liuxinghuoyu','fire'], + ['spade',3,'dujian'], + //['club',6,'dujian','poison'], + //['club',9,'dujian','poison'], + ['club',11,'dujian'], + ['club',12,'dujian'], + //['club',3,'sha','poison'], + //['club',4,'sha','poison'], + //['club',5,'sha','poison'], + //['spade',6,'sha','poison'], + //['spade',7,'sha','poison'], + //['club',3,'sha','poison'], + //['club',4,'sha','poison'], + //['club',5,'sha','poison'], + //['spade',6,'sha','poison'], + //['spade',7,'sha','poison'], + ], +} diff --git a/card/zhenfa.js b/card/zhenfa.js new file mode 100644 index 000000000..3d44f736f --- /dev/null +++ b/card/zhenfa.js @@ -0,0 +1,423 @@ +card.zhenfa={ + card:{ + pozhenjue:{ + type:'zhenfa', + chongzhu:true, + enable:true, + filterTarget:true, + selectTarget:-1, + multitarget:true, + content:function(){ + var n=game.players.length; + while(n--){ + game.swapSeat(game.players.randomGet(),game.players.randomGet()); + } + }, + mode:['guozhan'], + ai:{ + order:8, + result:{ + player:1, + }, + } + }, + changshezhen:{ + type:'zhenfa', + chongzhu:true, + enable:function(card,player){ + if(player.identity=='unknown') return false; + return player.next.identity==player.identity||player.previous.identity==player.identity; + }, + filterTarget:function(card,player,target){ + if(player==target) return player.inline(); + return player.inline(target); + }, + selectTarget:-1, + multitarget:true, + multiline:true, + content:function(){ + game.asyncDraw(targets); + }, + mode:['guozhan'], + ai:{ + order:7, + result:{ + target:1, + }, + tag:{ + draw:1 + } + } + }, + tianfuzhen:{ + type:'zhenfa', + chongzhu:true, + enable:true, + filterTarget:function(card,player,target){ + if(target.get('he').length==0) return false; + if(target.identity=='unknown'||target.identity=='ye') return false; + var wei=get.population('wei'),shu=get.population('shu'),wu=get.population('wu'),qun=get.population('qun'); + if(wei<=1&&shu<=1&&wu<=1&&qun<=1) return false; + var max=Math.max(wei,shu,wu,qun); + return get.population(target.identity)==max; + }, + selectTarget:-1, + content:function(){ + target.chooseToDiscard('he',true); + }, + mode:['guozhan'], + ai:{ + order:7, + result:{ + target:-1, + }, + tag:{ + discard:1 + } + } + }, + dizaizhen:{ + type:'zhenfa', + chongzhu:true, + enable:true, + multitarget:true, + multiline:true, + filterTarget:function(card,player,target){ + if(target.identity=='unknown') return false; + var wei=get.population('wei'),shu=get.population('shu'),wu=get.population('wu'),qun=get.population('qun'); + if(wei<=1&&shu<=1&&wu<=1&&qun<=1) return false; + if(target.identity=='ye') return true; + var max=Math.max(wei,shu,wu,qun); + return get.population(target.identity)!=max; + }, + selectTarget:-1, + content:function(){ + game.asyncDraw(targets); + }, + mode:['guozhan'], + ai:{ + order:7, + result:{ + target:1, + }, + tag:{ + draw:1 + } + } + }, + fengyangzhen:{ + type:'zhenfa', + chongzhu:true, + enable:true, + filterTarget:function(card,player,target){ + return target.sieged(); + }, + selectTarget:-1, + content:function(){ + target.addTempSkill('feiying',{player:'damageAfter'}); + target.popup('feiying'); + game.log(get.translation(target)+'获得了技能飞影'); + }, + mode:['guozhan'], + ai:{ + order:7, + result:{ + target:2, + }, + } + }, + yunchuizhen:{ + type:'zhenfa', + chongzhu:true, + enable:true, + filterTarget:function(card,player,target){ + return target.sieging(); + }, + selectTarget:-1, + content:function(){ + target.addTempSkill('wushuang',{source:'damageAfter'}); + target.popup('wushuang'); + game.log(get.translation(target)+'获得了技能无双'); + }, + mode:['guozhan'], + ai:{ + order:7, + result:{ + target:2, + }, + } + }, + qixingzhen:{ + type:'zhenfa', + chongzhu:true, + enable:function(card,player){ + if(player.identity=='unknown'||player.identity=='ye') return false; + return (get.population(player.identity)>1) + }, + filterTarget:function(card,player,target){ + return target.identity==player.identity; + }, + multitarget:true, + selectTarget:-1, + content:function(){ + lib.temp=targets[0]; + targets.sort(lib.sort.seat); + var rest=game.players.slice(0); + rest.remove(targets); + rest.sort(function(a,b){ + if(a.identity=='unknown') return 1; + else return -1; + }) + lib.temp={}; + if(targets.length>rest.length+1) targets.length=rest.length+1; + for(var i=1;i1) + }, + filterTarget:function(card,player,target){ + return target.identity==player.identity; + }, + multitarget:true, + selectTarget:-1, + content:function(){ + lib.temp=targets[0]; + targets.sort(lib.sort.seat); + lib.temp={}; + for(var i=1;i0){ + return 6-ai.get.value(card); + } + return 0; + }; + "step 1" + if(result.bool){ + player.useCard({name:'sha'},result.cards,target,false); + } + "step 2" + if(target==player.next) event.player2=player.next.next; + else event.player2=player.previous.previous; + event.player2.chooseCard('将一张非基本牌当作杀对'+get.translation(target)+'使用','he',function(card){ + return get.type(card)!='basic'; + }).ai=function(card){ + if(ai.get.effect(target,{name:'sha'},event.player2,event.player2)>0){ + return 6-ai.get.value(card); + } + return 0; + }; + "step 3" + if(result.bool){ + event.player2.useCard({name:'sha'},result.cards,target,false); + } + }, + mode:['guozhan'], + ai:{ + order:7, + result:{ + target:-2, + }, + } + }, + niaoxiangzhen:{ + type:'zhenfa', + chongzhu:true, + enable:true, + filterTarget:function(card,player,target){ + if(player.identity==target.identity) return false; + if(target.identity=='unknown'||target.identity=='ye') return false; + return target.identity==target.next.identity||target.identity==target.previous.identity + }, + selectTarget:-1, + content:function(){ + "step 0" + var next=target.chooseToRespond({name:'shan'}); + next.ai=function(card){ + if(ai.get.damageEffect(target,player,target)>=0) return 0; + return 1; + }; + next.autochoose=lib.filter.autoRespondShan; + "step 1" + if(result.bool==false){ + target.damage(); + } + }, + ai:{ + basic:{ + order:9, + useful:1 + }, + result:{ + target:-1.5, + }, + tag:{ + respond:1, + respondShan:1, + damage:1, + } + }, + mode:['guozhan'], + }, + }, + skill:{ + + }, + translate:{ + zhenfa:'阵法', + changshezhen:'长蛇阵', + pozhenjue:'破阵决', + tianfuzhen:'天覆阵', + dizaizhen:'地载阵', + fengyangzhen:'风扬阵', + yunchuizhen:'云垂阵', + qixingzhen:'七星阵', + shepanzhen:'蛇蟠阵', + shepanzhen_bg:'列', + yunchuizhen_bg:'垂', + longfeizhen:'龙飞阵', + huyizhen:'虎翼阵', + niaoxiangzhen:'鸟翔阵', + niaoxiangzhen_info:'令所有非你阵营的队列的角色今次打出一张闪,或者受到一点伤害', + huyizhen_info:'将一张非基本牌当作杀对你围攻的角色使用', + longfeizhen_info:'弃置围攻你的角色各一张牌', + qixingzhen_info:'令我方所有角色进入围攻状态', + shepanzhen_info:'令我方所有角色进入队列状态', + yunchuizhen_info:'令所有围攻角色获得技能【无双】,直到其首次造成伤害', + fengyangzhen_info:'令所有被围攻角色获得技能【飞影】,直到其首次受到伤害', + dizaizhen_info:'令势力数不是最多的所有角色摸一张牌', + changshezhen_info:'与你同一队列的所有角色摸一张牌', + pozhenjue_info:'将所有角色的顺序随机重排', + tianfuzhen_info:'令势力数最多的所有角色弃置一张牌' + }, + list:[ + ["diamond",1,'changshezhen'], + ["club",1,'changshezhen'], + // ["spade",1,'changshezhen'], + // ["heart",1,'changshezhen'], + + ["diamond",2,'tianfuzhen'], + // ["club",2,'tianfuzhen'], + ["spade",2,'tianfuzhen'], + ["heart",2,'tianfuzhen'], + + ["diamond",3,'dizaizhen'], + // ["club",3,'dizaizhen'], + ["spade",3,'dizaizhen'], + ["heart",3,'dizaizhen'], + + ["diamond",4,'fengyangzhen'], + ["club",4,'fengyangzhen'], + // ["spade",4,'fengyangzhen'], + // ["heart",4,'fengyangzhen'], + + // ["diamond",5,'zhonghuangzhen'], + // ["club",5,'zhonghuangzhen'], + // ["spade",5,'zhonghuangzhen'], + // ["heart",5,'zhonghuangzhen'], + + ["diamond",6,'huyizhen'], + ["club",6,'huyizhen'], + // ["spade",6,'huyizhen'], + // ["heart",6,'huyizhen'], + + ["diamond",7,'qixingzhen'], + // ["club",7,'qixingzhen'], + // ["spade",7,'qixingzhen'], + ["heart",7,'qixingzhen'], + + ["diamond",8,'shepanzhen'], + // ["club",8,'shepanzhen'], + // ["spade",8,'shepanzhen'], + ["heart",8,'shepanzhen'], + + // ["diamond",9,'longfeizhen'], + // ["club",9,'longfeizhen'], + ["spade",9,'longfeizhen'], + ["heart",9,'longfeizhen'], + + ["diamond",11,'niaoxiangzhen'], + // ["club",11,'niaoxiangzhen'], + ["spade",11,'niaoxiangzhen'], + ["heart",11,'niaoxiangzhen'], + + ["diamond",12,'yunchuizhen'], + // ["club",12,'yunchuizhen'], + // ["spade",12,'yunchuizhen'], + ["heart",12,'yunchuizhen'], + + ["diamond",13,'pozhenjue'], + // ["club",13,'pozhenjue'], + // ["spade",13,'pozhenjue'], + //["heart",13,'pozhenjue'], + ], +} diff --git a/character/diy.js b/character/diy.js new file mode 100644 index 000000000..abff5b912 --- /dev/null +++ b/character/diy.js @@ -0,0 +1,791 @@ +character.diy={ + character:{ + // diy_caocao:['male','wei',4,['xicai','diyjianxiong','hujia']], + // diy_hanlong:['male','wei',4,['siji','ciqiu'],['fullskin']], + diy_feishi:['male','shu',3,['shuaiyan','moshou'],['fullskin']], + diy_liuyan:['male','shu',4,['juedao','geju'],['fullskin']], + diy_luxun:['male','wu',3,['shaoying','zonghuo'],['fullskin']], + diy_yuji:['male','qun',3,['diyguhuo','diychanyuan'],['fullskin']], + // diy_zhouyu:['male','wu',3,['jieyan','honglian']], + diy_zhouyu:['male','wu',3,['xiongzi','yaliang'],['fullskin']], + diy_caiwenji:['female','qun',3,['beige','guihan'],['fullskin']], + diy_lukang:['male','wu',4,['luweiyan','qianxun'],['fullskin']], + diy_xuhuang:['male','wei',4,['diyduanliang'],['fullskin']], + diy_dianwei:['male','wei',4,['diyqiangxi'],['fullskin']], + diy_huangzhong:['male','shu',4,['liegong','fuli'],['fullskin']], + diy_weiyan:['male','shu',4,['diykuanggu'],['fullskin']], + diy_zhenji:['female','wei',3,['jiaoxia','yiesheng'],['fullskin']], + diy_menghuo:['male','shu',4,['huoshou','zaiqix'],['fullskin']], + re_huangyueying:['female','shu',3,['rejizhi','qicai'],['fullskin']], + old_zhonghui:['male','wei',3,['zzhenggong','zquanji','zbaijiang'],['fullskin']], + }, + skill:{ + zaiqix:{ + trigger:{player:'phaseDrawBefore'}, + filter:function(event,player){ + return player.hp=2; + } + return true; + }, + content:function(){ + "step 0" + trigger.untrigger(); + trigger.finish(); + event.cards=get.cards(player.maxHp-player.hp+1); + player.showCards(event.cards); + "step 1" + var num=0; + for(var i=0;i=player.maxHp-1) return [0,0]; + } + } + } + }, + jiaoxia:{ + trigger:{target:'useCardToBegin'}, + filter:function(event,player){ + return event.card&&get.color(event.card)=='red'; + }, + frequent:true, + content:function(){ + player.draw(); + }, + ai:{ + effect:function(card,player,target){ + if(get.color(card)=='red') return [1,1]; + }, + } + }, + diykuanggu:{ + trigger:{source:'damageEnd'}, + forced:true, + content:function(){ + if(get.distance(trigger.player,player,'attack')>1){ + player.draw(trigger.num); + } + else{ + player.recover(trigger.num); + } + } + }, + diyduanliang:{ + group:['diyduanliang1','diyduanliang2'], + ai:{ + threaten:1.2 + } + }, + diyduanliang1:{ + enable:'phaseUse', + usable:1, + discard:false, + filter:function(event,player){ + var cards=player.get('he',{color:'black'}); + for(var i=0;i0; + }, + content:function(){ + trigger.source.discard(trigger.source.get('he',{color:'red'})); + }, + ai:{ + expose:0.1, + result:{ + threaten:0.8, + target:function(card,player,target){ + if(get.tag(card,'damage')&&ai.get.attitude(target,player)<0){ + return [1,0,0,-player.num('he',{color:'red'})]; + } + } + } + } + }, + diyguhuo:{ + trigger:{player:'phaseBegin'}, + forced:true, + filter:function(event,player){ + return player.num('hej')>0; + }, + content:function(){ + "step 0" + player.draw(2); + "step 1" + player.chooseToDiscard('hej',2,true); + }, + ai:{ + effect:{ + target:function(card){ + if(get.type(card)=='delay') return [0,1]; + } + } + } + }, + diychanyuan:{ + trigger:{player:'dieBegin'}, + forced:true, + filter:function(event){ + return event.source!=undefined; + }, + content:function(){ + trigger.source.addSkill('benghuai'); + }, + ai:{ + threaten:function(player,target){ + if(target.hp==1) return 0.2; + }, + result:{ + target:function(card,player,target,current){ + if(target.hp<=1&&get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-5]; + return [1,0,0,-10]; + } + } + } + } + }, + zonghuo:{ + trigger:{source:'damageBefore'}, + direct:true, + priority:10, + filter:function(event){ + return event.nature!='fire'; + }, + content:function(){ + "step 0" + player.chooseToDiscard('是否发动【纵火】?').ai=function(card){ + var att=ai.get.attitude(player,trigger.player); + if(trigger.player.hasSkillTag('nofire')){ + if(att>0) return 8-ai.get.value(card); + return -1; + } + if(att<0){ + return 7-ai.get.value(card); + } + return -1; + } + "step 1" + if(result.bool){ + player.logSkill('zonghuo',trigger.player,'fire'); + trigger.nature='fire'; + } + } + }, + shaoying:{ + trigger:{source:'damageAfter'}, + direct:true, + filter:function(event){ + return event.nature=='fire'; + }, + content:function(){ + "step 0" + player.chooseTarget('是否发动【烧营】?',function(card,player,target){ + return get.distance(trigger.player,target)<=1&&trigger.player!=target; + }).ai=function(target){ + return ai.get.damageEffect(target,player,player,'fire'); + } + "step 1" + if(result.bool){ + var card=get.cards()[0]; + ui.discardPile.appendChild(card); + player.showCards(card); + event.bool=get.color(card)=='red'; + event.target=result.targets[0]; + player.logSkill('shaoying',event.target,false); + trigger.player.line(event.target,'fire'); + } + else{ + event.finish(); + } + "step 2" + if(event.bool){ + event.target.damage('fire'); + } + } + }, + tiangong:{ + group:['tiangong2'], + trigger:{player:'damageBefore'}, + filter:function(event){ + if(event.nature=='thunder') return true; + }, + forced:true, + content:function(){ + trigger.untrigger(); + trigger.finish(); + }, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(card.name=='tiesuo') return 0; + if(get.tag(card,'thunderDamage')) return 0; + } + } + } + }, + tiangong2:{ + trigger:{source:'damageAfter'}, + filter:function(event){ + if(event.nature=='thunder') return true; + }, + forced:true, + content:function(){ + player.draw(); + }, + }, + diyleiji:{ + trigger:{player:'respond'}, + filter:function(event,player){ + return event.card.name=='shan'; + }, + direct:true, + content:function(){ + "step 0"; + player.chooseTarget('是否发动新雷击?').ai=function(target){ + return ai.get.damageEffect(target,player,player,'thunder'); + }; + "step 1" + if(result.bool){ + player.logSkill('diyleiji',result.targets,'thunder'); + event.target=result.targets[0]; + event.target.judge(function(card){ + // var suit=get.suit(card); + // if(suit=='spade') return -4; + // if(suit=='club') return -2; + if(get.color(card)=='black') return -2; + return 0; + }); + } + else{ + event.finish(); + } + "step 2" + if(result.bool==false){ + event.target.damage('thunder'); + player.recover(); + } + }, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(get.tag(card,'respondShan')){ + var hastarget=false; + for(var i=0;i2){ + return [0,hastarget?target.num('h')/4:0]; + } + if(target.num('h')>3||(be&&target.num('h')>=2)){ + return [0,0]; + } + if(target.num('h')==0){ + return [1.5,0]; + } + if(target.num('h')==1&&!be){ + return [1.2,0]; + } + return [1,Math.min(0.5,(target.num('h')+be)/4)]; + } + } + } + } + }, + xicai:{ + inherit:'jianxiong' + }, + diyjianxiong:{ + mode:['identity'], + trigger:{global:'dieBefore'}, + forced:true, + filter:function(event,player){ + return event.player!=game.zhu&&_status.currentPhase==player; + }, + content:function(){ + trigger.player.identity='fan'; + trigger.player.setIdentity('fan'); + trigger.player.identityShown=true; + } + }, + shuaiyan:{ + trigger:{global:'recoverAfter'}, + filter:function(event,player){ + return event.player!=player&&_status.currentPhase!=player; + }, + content:function(){ + "step 0" + var att=ai.get.attitude(trigger.player,player); + var bool=0; + if(att<0){ + if(trigger.player.num('e')==0&&trigger.player.num('h')>2) bool=1; + else if(trigger.player.num('he')==0) bool=1; + } + else if(att==0&&trigger.player.num('he')==0){ + bool=1; + } + trigger.player.chooseControl('draw_card','discard_card').ai=function(){ + return bool; + }; + "step 1" + if(result.control=='draw_card'){ + player.draw(); + event.finish(); + } + else if(trigger.player.num('he')){ + player.discardPlayerCard(trigger.player,true,'he'); + } + else{ + event.finish(); + } + } + }, + moshou:{ + mod:{ + targetEnabled:function(card,player,target,now){ + if(card.name=='bingliang'||card.name=='lebu') return false; + } + }, + }, + siji:{ + trigger:{player:'phaseDiscardEnd'}, + frequent:true, + filter:function(event,player){ + if(event.cards){ + for(var i=0;i0; + }, + content:function(){ + var list=[]; + for(var i=0;i0) player.draw(list.length); + } + }, + diyqiangxi:{ + enable:'phaseUse', + usable:1, + filterCard:function(card){ + return get.subtype(card)=='equip1'; + }, + selectCard:[0,1], + filterTarget:function(card,player,target){ + if(player==target) return false; + return get.distance(player,target,'attack')<=1; + }, + content:function(){ + "step 0" + if(cards.length==0){ + player.loseHp(); + } + "step 1" + target.damage(); + "step 2" + if(target.isAlive()&&target.num('he')){ + player.discardPlayerCard(target); + } + }, + check:function(card){ + return 10-ai.get.value(card); + }, + position:'he', + ai:{ + order:8, + result:{ + player:function(player,target){ + if(ui.selected.cards.length) return 0; + if(player.hp>=target.hp) return -0.9; + if(player.hp<=2) return -10; + return -2; + }, + target:function(player,target){ + if(player.hp<=1) return 0; + return ai.get.damageEffect(target,player); + } + } + }, + threaten:1.3 + }, + }, + translate:{ + diy_caocao:'曹操', + diy_menghuo:'孟获', + diy_huangzhong:'黄忠', + diy_xuhuang:'徐晃', + diy_zhangjiao:'张角', + diy_dianwei:'典韦', + diy_weiyan:'魏延', + xicai:'惜才', + diyjianxiong:'奸雄', + diy_feishi:'费诗', + shuaiyan:'率言', + moshou:'墨守', + diy_hanlong:'韩龙', + diy_luxun:'陆伯言', + diy_yuji:'于吉', + diy_zhouyu:'神周瑜', + diy_zhouyu:'周公瑾', + diy_lukang:'陆抗', + diy_caiwenji:'蔡昭姬', + diy_zhenji:'甄姬', + siji:'伺机', + ciqiu:'刺酋', + ciqiu2:'刺酋', + ciqiu3:'刺酋', + diy_liuyan:'刘焉', + juedao:'绝道', + geju:'割据', + diyleiji:'雷击', + tiangong:'天公', + tiangong2:'天公', + shaoying:'烧营', + zonghuo:'纵火', + diychanyuan:'缠怨', + diyguhuo:'蛊惑', + jieyan:'劫焰', + honglian:'红莲', + xiongzi:'雄姿', + yaliang:'雅量', + yaliang_info:'每当你对其他角色造成1点伤害后,或受到其他角色造成的1点伤害后,你可与该角色各摸一张牌。', + luweiyan:'围堰', + guihan:'归汉', + diyduanliang:'断粮', + diyduanliang1:'断粮', + diyduanliang2:'断粮', + diyqiangxi:'强袭', + diykuanggu:'狂骨', + jiaoxia:'皎霞', + diyzaiqi:'再起', + batu:'霸图', + zaiqix:'再起', + zaiqix_info:'摸牌阶段,若你已受伤,你可以放弃摸牌并展示牌堆顶的X+1张牌,X为你已损失的体力值,其中每有一张♥牌,你回复1点体力,然后弃掉这些♥牌,将其余的牌收入手牌。', + batu_info:'回合结束阶段,你可以将手牌数补至X,X为现存的势力数', + diyzaiqi_info:'锁定技,你摸牌阶段额外摸X张牌,X为你已损失的体力值', + jiaoxia_info:'每当你成为红色牌的目标,你可以摸一张牌', + diykuanggu_info:'锁定技,每当你造成一点伤害,你在其攻击范围内,你回复一点体力,否则你摸一张牌', + diyqiangxi_info:'出牌阶段,你可以自减一点体力或弃一张武器牌,然后你对你攻击范围内的一名角色造成一点伤害并弃置其一张牌,每回合限一次。', + diyduanliang_info:'出牌阶段限一次,你可以将一张黑色的基本牌或装备牌当兵粮寸断对一名角色使用,然后摸一张牌。你的兵粮寸断可以指定距离2以内的角色作为目标', + guihan_info:'限定技,当你进入濒死状态时,可以指定一名男性角色与其各回复一点体力并摸两张牌', + luweiyan_info:'你可以将一张装备牌当水淹七军使用', + xiongzi_info:'锁定技,你于摸牌阶段额外摸X+1张牌,X为你装备区牌数的一半,向下取整', + honglian_info:'每当你受到来自其他角色的伤害,可以弃置伤害来源的所有红色牌', + jieyan_info:'出牌阶段限一次,你可以弃置一张红色手牌令场上所有角色受到一点火焰伤害', + diyguhuo_info:'锁定技,回合开始阶段,你摸两张牌,然后弃置区域内的两张牌', + diychanyuan_info:'锁定技,杀死你的角色获得技能【崩坏】', + zonghuo_info:'你可弃置一张牌将你即将造成的伤害变为火焰伤害', + shaoying_info:'每当你造成一次火焰伤害,可指定距离受伤害角色1以内的另一名角色,并展示牌堆顶的一张牌,若此牌为红色,该角色受到一点火焰伤害', + tiangong_info:'锁定技,你防止即将受到的雷电伤害,每当你造成一次雷电伤害,你摸一张牌', + diyleiji_info:'每当你使用或打出一张【闪】,可令任意一名角色进行一次判定,若结果为黑色,其受到一点雷电伤害,然后你摸回复一点体力', + juedao_info:'出牌阶段,你可以弃置一张手牌,横置你的武将牌;锁定技,若你处于连环状态,你与其他角色的距离、其他角色与你的距离各+1。', + geju_info:'准备阶段开始时,你可以摸X张牌(X为攻击范围内不含有你的势力数)。', + siji_info:'弃牌阶段结束后,你可以摸2X张牌(X为你于此阶段内弃置的【杀】的数量)。', + ciqiu_info:'锁定技,每当你使用【杀】对目标角色造成伤害时,若该角色未受伤,你令此伤害+1;锁定技,每当未受伤的角色因受到你使用【杀】造成的伤害而扣减体力后,若该角色的体力值为0,你令其死亡,然后你失去“刺酋”。 ', + shuaiyan_info:'每当其他角色于你的回合外回复体力后,你可以令该角色选择一项:1.令你摸一张牌;2.令你弃置其一张牌。 ', + moshou_info:'锁定技,你不能成为乐不思蜀和兵粮寸断的目标。', + xicai_info:'你可以立即获得对你造成伤害的牌', + diyjianxiong_info:'锁定技,在身份局中,在你回合内死亡的角色均视为反贼,国战中,在你回合内死亡的角色若与你势力相同则随机改为另一个势力', + }, +} diff --git a/character/extra.js b/character/extra.js new file mode 100644 index 000000000..c9e772fdf --- /dev/null +++ b/character/extra.js @@ -0,0 +1,1127 @@ +character.extra={ + character:{ + shen_guanyu:['male','shu',6,['wuhun','wushen'],['fullskin']], + shen_zhaoyun:['male','shu',2,['juejing','longhun'],['fullskin'],['fullskin']], + shen_zhugeliang:['male','shu',3,['qixing','kuangfeng','dawu'],['fullskin']], + shen_lvmeng:['male','wu',3,['shelie','gongxin'],['fullskin']], + shen_zhouyu:['male','wu',4,['yeyan','swdqinyin'],['fullskin']], + shen_simayi:['male','wei',4,['renjie','sbaiyin','lianpo'],['fullskin']], + shen_caocao:['male','wei',3,['guixin','feiying'],['fullskin']], + shen_lvbu:['male','qun',5,['baonu','wuqian','shenfen'],['fullskin']], + }, + skill:{ + lianpo:{ + trigger:{source:'dieAfter'}, + forced:true, + filter:function(event,player){ + return !player.skills.contains('lianpo2'); + }, + content:function(){ + player.addSkill('lianpo2'); + } + }, + lianpo2:{ + trigger:{global:'phaseAfter'}, + forced:true, + content:function(){ + player.removeSkill('lianpo2'); + player.phase(); + } + }, + baonu:{ + trigger:{source:'damageEnd',player:'damageEnd'}, + forced:true, + mark:true, + filter:function(event){ + return event.num>0; + }, + init:function(player){ + player.storage.baonu=2; + }, + content:function(){ + player.storage.baonu+=trigger.num; + }, + intro:{ + content:'mark' + } + }, + shenfen:{ + enable:'phaseUse', + filter:function(event,player){ + return !player.storage.shenfen&&player.storage.baonu>=6; + }, + init:function(player){ + player.storage.shenfen=false; + }, + mark:true, + content:function(){ + "step 0" + player.unmark('shenfen'); + player.storage.shenfen=true; + player.storage.baonu-=6; + event.targets=game.players.slice(0); + event.targets.remove(player); + event.targets.sort(lib.sort.seat); + event.targets2=event.targets.slice(0); + player.turnOver(); + "step 1" + if(event.targets.length){ + event.targets.shift().damage(); + event.redo(); + } + "step 2" + if(event.targets2.length){ + var cur=event.targets2.shift(); + if(cur&&cur.num('he')){ + cur.chooseToDiscard('he',true,4); + } + event.redo(); + } + }, + intro:{ + content:'limited' + }, + ai:{ + order:10, + result:{ + player:function(player){ + var num=0; + for(var i=0;i0?1:-1; + } + } + return num; + } + } + } + }, + wuqian:{ + enable:'phaseUse', + filter:function(event,player){ + return player.storage.baonu>=2&&!player.skills.contains('wushuang'); + }, + content:function(){ + player.storage.baonu-=2; + player.addTempSkill('wushuang','phaseAfter'); + }, + ai:{ + order:5, + result:{ + player:function(player){ + if(!player.storage.shenfen) return 0; + var cards=player.get('h','sha'); + if(cards.length){ + for(var i=0;i0&& + game.players[i].num('h','shan')){ + return 1; + } + } + } + return 0; + } + } + } + }, + renjie:{ + trigger:{player:'damageEnd'}, + forced:true, + unique:true, + group:'renjie2', + mark:true, + filter:function(event){ + return event.num>0; + }, + init:function(player){ + player.storage.renjie=0; + }, + content:function(){ + player.storage.renjie+=trigger.num; + }, + intro:{ + content:'mark' + }, + ai:{ + maixie:true, + effect:{ + target:function(card,player,target){ + if(player.skills.contains('jueqing')) return [1,-2]; + if(get.tag(card,'damage')){ + if(target.hp==target.maxHp){ + if(!target.skills.contains('jilue')){ + return [0,1]; + } + return [0.7,1]; + } + return 0.7; + } + }, + player:function(card,player){ + if(_status.currentPhase!=player) return; + if(card.name=='wuzhong'||card.name=='yiyi'|| + card.name=='yuanjiao'||card.name=='shunshou') return; + if(player.hp<=2) return; + if(!player.skills.contains('jilue')||player.storage.renjie==0){ + return [0,0,0,0]; + } + + } + } + } + }, + renjie2:{ + trigger:{player:'phaseDiscardEnd'}, + forced:true, + filter:function(event){ + return event.cards&&event.cards.length>0; + }, + content:function(){ + player.storage.renjie+=trigger.cards.length; + } + }, + sbaiyin:{ + trigger:{player:'phaseBegin'}, + forced:true, + unique:true, + filter:function(event,player){ + return player.storage.renjie>=4; + }, + content:function(){ + player.loseMaxHp(); + player.addSkill('jilue'); + player.removeSkill('sbaiyin'); + } + }, + jilue:{ + unique:true, + group:['jilue_guicai','jilue_fangzhu','jilue_wansha','jilue_zhiheng','jilue_jizhi'] + }, + jilue_guicai:{ + trigger:{global:'judge'}, + direct:true, + filter:function(event,player){ + return player.num('h')>0&&player.storage.renjie>0; + }, + content:function(){ + "step 0" + player.chooseCard('是否弃置一枚“忍”,并发动【鬼才】?').ai=function(card){ + var trigger=_status.event.parent._trigger; + var player=_status.event.player; + var result=trigger.judge(card)-trigger.judge(trigger.player.judging); + var attitude=ai.get.attitude(player,trigger.player); + if(attitude==0||result==0) return 0; + if(attitude>0){ + return result-ai.get.value(card)/2; + } + else{ + return -result-ai.get.value(card)/2; + } + }; + "step 1" + if(result.bool){ + player.respond(result.cards); + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + player.logSkill('jilue_guicai'); + player.storage.renjie--; + if(trigger.player.judging.clone) trigger.player.judging.clone.delete(); + ui.discardPile.appendChild(trigger.player.judging); + trigger.player.judging=result.cards[0]; + trigger.position.appendChild(result.cards[0]); + game.log(get.translation(trigger.player)+'的判定牌改为'+get.translation(result.cards[0])); + game.delay(2); + } + }, + ai:{ + tag:{ + rejudge:1, + } + } + }, + jilue_fangzhu:{ + trigger:{player:'damageEnd'}, + direct:true, + priority:-1, + filter:function(event,player){ + return player.storage.renjie>0; + }, + content:function(){ + "step 0" + player.chooseTarget('是否弃置一枚“忍”,并发动【放逐】?',function(card,player,target){ + return player!=target + }).ai=function(target){ + if(target.isTurnedOver()){ + return ai.get.attitude(player,target)-1; + } + else{ + if(player.maxHp-player.hp==1){ + return -ai.get.attitude(player,target)-1; + } + } + return 0; + } + "step 1" + if(result.bool){ + player.storage.renjie--; + player.logSkill('jilue_fangzhu',result.targets); + result.targets[0].draw(player.maxHp-player.hp); + result.targets[0].turnOver(); + } + }, + }, + jilue_wansha:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.storage.renjie>0; + }, + content:function(){ + player.storage.renjie--; + player.addTempSkill('wansha','phaseAfter'); + } + }, + jilue_zhiheng:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.storage.renjie>0; + }, + position:'he', + filterCard:true, + selectCard:[1,Infinity], + prompt:'弃置一枚“忍”,然后弃置任意张牌并摸等量的牌', + check:function(card){return 6-ai.get.value(card)}, + content:function(){ + player.storage.renjie--; + player.draw(cards.length); + }, + ai:{ + order:1, + result:{ + player:function(player){ + var num=0; + var cards=player.get('he'); + for(var i=0;i2) return 1; + if(cards.length==2&&player.storage.jilue>1); + return 0; + } + }, + threaten:1.5 + }, + }, + jilue_jizhi:{ + trigger:{player:'useCard'}, + filter:function(event,player){ + return (get.type(event.card)=='trick'&&event.cards[0]&&event.cards[0]==event.card)&&player.storage.renjie>0; + }, + content:function(){ + player.storage.renjie--; + player.draw(); + }, + ai:{ + threaten:1.4 + } + }, + wushen:{ + mod:{ + cardEnabled:function(card,player){ + if(card.name!='sha'&&get.suit(card)=='heart') return false; + }, + cardUsable:function(card,player){ + if(card.name!='sha'&&get.suit(card)=='heart') return false; + }, + cardRespondable:function(card,player){ + if(card.name!='sha'&&get.suit(card)=='heart') return false; + }, + cardSavable:function(card,player){ + if(card.name!='sha'&&get.suit(card)=='heart') return false; + }, + targetInRange:function(card){ + if(get.suit(card)=='heart'||_status.event.skill=='wushen') return true; + } + }, + enable:['chooseToUse','chooseToRespond'], + filterCard:{suit:'heart'}, + viewAs:{name:'sha'}, + check:function(){return 1}, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(get.tag(card,'respondSha')&¤t<0) return 0.6 + } + }, + respondSha:true, + order:4, + useful:-1, + value:-1 + } + }, + wuhun:{ + trigger:{player:'dieBegin'}, + forced:true, + filter:function(event){ + return event.source!=undefined; + }, + content:function(){ + trigger.source.loseHp(trigger.source.hp); + }, + ai:{ + threaten:function(player,target){ + if(target.hp==1) return 0.5; + }, + result:{ + target:function(card,player,target,current){ + if(target.hp<=1&&get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-5]; + if(player.hp>2&&ai.get.attitude(player,target<=0)) return [0,2]; + return [1,0,0,-player.hp]; + } + } + } + } + }, + guixin:{ + trigger:{player:'damageEnd'}, + check:function(event,player){ + if(player.isTurnedOver()) return true; + var num=0; + for(var i=0;i0){ + num++; + } + if(num>=2) return true; + } + return false; + }, + content:function(){ + "step 0" + var targets=game.players.slice(0); + targets.remove(player); + targets.sort(lib.sort.seat); + event.targets=targets; + event.num=0; + "step 1" + if(num0){ + num++; + } + if(num>2) return [0,1]; + if(num==2) return [0.5,1]; + } + } + } + } + } + }, + qixing:{ + unique:true, + trigger:{global:'gameDrawAfter',player:'phaseBegin'}, + forced:true, + check:function(event,player){ + return player.hp<=1; + }, + filter:function(event,player){ + return !player.storage.qixing; + }, + content:function(){ + "step 0" + player.gain(get.cards(7))._triggered=null; + "step 1" + player.chooseCard('选择七张牌作为星',7,true).ai=function(card){ + return ai.get.value(card); + }; + "step 2" + player.lose(result.cards,ui.special)._triggered=null; + player.storage.qixing=result.cards; + }, + mark:true, + intro:{ + mark:function(dialog,content,player){ + if(content&&content.length){ + if(player==game.me){ + dialog.add(content); + } + else{ + return '共有'+get.cnNumber(content.length)+'张星'; + } + } + }, + content:function(content,player){ + if(content&&content.length){ + if(player==game.me){ + return get.translation(content); + } + return '共有'+get.cnNumber(content.length)+'张星'; + } + } + }, + group:['qixing2'], + }, + qixing2:{ + trigger:{player:'phaseDrawAfter'}, + direct:true, + filter:function(event,player){ + return player.storage.qixing&&player.storage.qixing.length; + }, + content:function(){ + "step 0" + player.chooseCard('选择任意张手牌与星交换',[1,player.num('h')]).ai=function(card){ + return 1; + }; + "step 1" + if(result.bool){ + player.logSkill('qixing'); + player.lose(result.cards,ui.special)._triggered=null; + player.storage.qixing=player.storage.qixing.concat(result.cards); + event.num=result.cards.length; + } + else{ + event.finish(); + } + "step 2" + player.chooseCardButton(player.storage.qixing,'选择'+event.num+'张牌作为手牌',event.num,true).ai=function(button){ + if(player.skipList.contains('phaseUse')){ + return -ai.get.value(button.link); + } + return ai.get.value(button.link); + } + if(player==game.me&&_status.auto){ + game.delay(0.5); + } + "step 3" + player.gain(result.links)._triggered=null; + for(var i=0;i=5){ + if(target.hp==1&&target.maxHp>2) return att; + if(target.hp==2&&target.maxHp>3&&target.num('he')==0) return att*0.7; + return 0; + } + return -1; + } + "step 1" + if(result.bool){ + var length=result.targets.length; + for(var i=0;i=2; + }, + direct:true, + content:function(){ + "step 0" + var recover=0,lose=0; + for(var i=0;i0){ + if(game.players[i].hp<2){ + lose--; + recover+=0.5; + } + lose--; + recover++; + } + else if(ai.get.attitude(player,game.players[i])<0){ + if(game.players[i].hp<2){ + lose++; + recover-=0.5; + } + lose++; + recover--; + } + } + else{ + if(ai.get.attitude(player,game.players[i])>0){ + lose--; + } + else if(ai.get.attitude(player,game.players[i])<0){ + lose++; + } + } + } + } + player.chooseControl('失去体力','回复体力','cancel').ai=function(){ + if(lose>recover&&lose>0) return 0; + if(lose0) return 1; + return 2; + } + "step 1" + if(result.bool==false||result.control=='cancel'){ + event.finish(); + } + else{ + player.logSkill('qinyin'); + event.bool=(result.control=='回复体力'); + event.num=0; + event.players=game.players.slice(0); + } + "step 2" + if(event.num=1) return [0,0]; + var hasfriend=false; + for(var i=0;i=0){ + hasfriend=true;break; + } + } + if(!hasfriend) return; + if((get.tag(card,'damage')==1||get.tag(card,'loseHp'))&&target.hp>1) return [0,1]; + } + }, + threaten:function(player,target){ + if(target.hp==1) return 2; + return 0.5; + }, + } + }, + longhun1:{ + enable:['chooseToUse','chooseToRespond'], + prompt:'将一张红桃牌当桃使用', + position:'he', + check:function(card,event){ + if(_status.event.player.hp>1) return 0; + return 10-ai.get.value(card); + }, + selectCard:function(){ + return Math.max(1,_status.event.player.hp); + }, + viewAs:{name:'tao'}, + filterCard:function(card){ + return get.suit(card)=='heart'; + } + }, + longhun2:{ + enable:['chooseToUse','chooseToRespond'], + prompt:'将一张方片牌当火杀使用或打出', + position:'he', + check:function(card,event){ + if(_status.event.player.hp>1) return 0; + return 10-ai.get.value(card); + }, + selectCard:function(){ + return Math.max(1,_status.event.player.hp); + }, + viewAs:{name:'sha',nature:'fire'}, + filterCard:function(card){ + return get.suit(card)=='diamond'; + } + }, + longhun3:{ + enable:['chooseToUse','chooseToRespond'], + prompt:'将一张黑桃牌当无懈可击使用', + position:'he', + viewAsFilter:function(player){ + return player.num('he',{color:'black'})>=player.hp; + }, + check:function(card,event){ + if(_status.event.player.hp>1) return 0; + return 7-ai.get.value(card); + }, + selectCard:function(){ + return Math.max(1,_status.event.player.hp); + }, + viewAs:{name:'wuxie'}, + viewAsFilter:function(player){ + return player.num('he',{suit:'spade'})>0; + }, + filterCard:function(card){ + return get.suit(card)=='spade'; + } + }, + longhun4:{ + enable:['chooseToUse','chooseToRespond'], + prompt:'将一张梅花牌当闪打出', + position:'he', + check:function(card,event){ + if(_status.event.player.hp>1) return 0; + return 10-ai.get.value(card); + }, + selectCard:function(){ + return Math.max(1,_status.event.player.hp); + }, + viewAs:{name:'shan'}, + filterCard:function(card){ + return get.suit(card)=='club'; + } + }, + juejing:{ + mod:{ + maxHandcard:function(player,num){ + return 2+num; + } + }, + trigger:{player:'phaseDrawBegin'}, + priority:-5, + filter:function(event,player){ + return player.hpplayer.hp){ + return 6-ai.get.value(card); + } + return 4-ai.get.value(card) + } + }, + bazhen:{ + inherit:'bagua_skill', + filter:function(event,player){ + if(!event.filterCard({name:'shan'})) return false; + if(event.parent.player.num('s','unequip')) return false; + if(player.get('e','2')) return false; + return true; + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(player==target&&get.subtype(card)=='equip2'){ + if(ai.get.equipValue(card)<=8) return 0; + } + if(target.num('e','2')) return; + if(player.skills.contains('unequip')) return; + if(get.tag(card,'respondShan')) return [0.5,0]; + } + } + } + }, + kanpo:{ + enable:'chooseToUse', + filterCard:function(card){ + return get.color(card)=='black'; + }, + viewAsFilter:function(player){ + return player.num('h',{color:'black'})>0; + }, + viewAs:{name:'wuxie'}, + prompt:'将一张黑色牌当无懈可击使用', + check:function(card){return 8-ai.get.value(card)}, + threaten:1.2 + }, + lianhuan:{ + group:['lianhuan1','lianhuan2'] + }, + lianhuan1:{ + enable:'phaseUse', + filter:function(event,player){ + return player.num('h',{suit:'club'})>0; + }, + filterCard:function(card){ + return get.suit(card)=='club'; + }, + viewAs:{name:'tiesuo'}, + prompt:'将一张梅花牌当铁锁连环使用', + check:function(card){return 4-ai.get.value(card)} + }, + lianhuan2:{ + enable:'phaseUse', + filter:function(event,player){ + return player.num('h',{suit:'club'})>0; + }, + filterCard:function(card){ + return get.suit(card)=='club'; + }, + check:function(card){ + return 5-ai.get.useful(card); + }, + content:function(){ + player.draw(); + }, + discard:false, + prepare:function(cards,player){ + player.$throw(cards); + }, + ai:{ + basic:{ + order:1 + }, + result:{ + player:1, + }, + } + }, + niepan:{ + unique:true, + enable:'chooseToUse', + mark:true, + init:function(player){ + player.storage.niepan=false; + }, + filter:function(event,player){ + if(event.type!='dying') return false; + if(player!=_status.dying) return false; + if(player.storage.niepan) return false; + }, + content:function(){ + player.hp=Math.min(3,player.maxHp); + player.discard(player.get('hej')); + player.draw(3); + player.unmarkSkill('niepan'); + if(player.classList.contains('linked')) player.link(); + if(player.classList.contains('turnedover')) player.turnOver(); + player.storage.niepan=true; + }, + ai:{ + save:true, + result:{ + player:10 + }, + threaten:function(player,target){ + if(!target.storage.niepan) return 0.6; + } + }, + intro:{ + content:'limited' + } + }, + quhu:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + if(player.num('h')==0) return false; + for(var i=0;iplayer.hp&&game.players[i].num('h')) return true; + } + return false; + }, + filterTarget:function(card,player,target){ + return target.hp>player.hp&&target.num('h')>0; + }, + content:function(){ + "step 0" + player.chooseToCompare(target); + "step 1" + if(result.bool){ + player.chooseTarget(function(card,player,target1){ + return target1!=target&&get.distance(target,target1,'attack')<=1; + },true).ai=function(target1){ + return ai.get.damageEffect(target1,target,player); + } + } + else{ + player.damage(target); + event.finish(); + } + "step 2" + if(result.bool){ + result.targets[0].damage(target); + } + }, + ai:{ + order:0.5, + result:{ + target:function(player,target){ + var att=ai.get.attitude(player,target); + var oc=(target.num('h')==1); + if(att>0&&oc) return 0; + for(var i=0;i0){ + return att>0?att/2:att-(oc?5:0); + } + } + } + return 0; + }, + player:function(player){ + var mn=1; + var hs=player.get('h'); + for(var i=0;i2){ + max=Math.max(Math.min(5,game.players[i].hp)-game.players[i].num('h'),max); + } + } + switch(max){ + case 0:return mn==13?0:-20; + case 1:return mn>=12?0:-15; + case 2:return 0; + case 3:return 1; + default:return max; + } + } + }, + expose:0.2 + } + }, + jieming:{ + trigger:{player:'damageEnd'}, + direct:true, + filter:function(event,player){ + return event.num>0 + }, + content:function(){ + "step 0" + player.chooseTarget([1,trigger.num],function(card,player,target){ + return target.num('h')2){ + return Math.min(5,target.maxHp)-target.num('h'); + } + return att/3; + } + "step 1" + if(result.bool){ + player.logSkill('jieming',result.targets); + for(var i=0;i1){ + if(player.skills.contains('jueqing')) return [1,-2]; + var max=0; + for(var i=0;i0){ + max=Math.max(Math.min(5,game.players[i].hp)-game.players[i].num('h'),max); + } + } + switch(max){ + case 0:return 2; + case 1:return 1.5; + case 2:return [1,2]; + default:return [0,max]; + } + } + if((card.name=='tao'||card.name=='caoyao')&& + target.hp>1&&target.num('h')<=target.hp) return [0,0]; + } + }, + } + }, + qiangxi:{ + enable:'phaseUse', + usable:1, + filterCard:function(card){ + return get.subtype(card)=='equip1'; + }, + selectCard:[0,1], + filterTarget:function(card,player,target){ + if(player==target) return false; + return get.distance(player,target,'attack')<=1; + }, + content:function(){ + "step 0" + if(cards.length==0){ + player.loseHp(); + } + "step 1" + target.damage(); + }, + check:function(card){ + return 10-ai.get.value(card); + }, + position:'he', + ai:{ + order:8, + result:{ + player:function(player,target){ + if(ui.selected.cards.length) return 0; + if(player.hp>=target.hp) return -0.9; + if(player.hp<=2) return -10; + return -2; + }, + target:function(player,target){ + return ai.get.damageEffect(target,player); + } + } + }, + threaten:1.3 + }, + tianyi:{ + enable:'phaseUse', + usable:1, + filterTarget:function(card,player,target){ + return player!=target&&target.num('h')>0; + }, + filter:function(event,player){ + return player.num('h')>0; + }, + content:function(){ + "step 0" + player.chooseToCompare(target); + "step 1" + if(result.bool){ + player.addTempSkill('tianyi2','phaseAfter'); + } + else{ + player.addTempSkill('tianyi3','phaseAfter'); + } + }, + ai:{ + order:function(name,player){ + var cards=player.get('h'); + if(player.num('h','sha')==0){ + return 1; + } + for(var i=0;i11&&ai.get.value(cards[i])<7){ + return 9; + } + } + return lib.card.sha.ai.order-1; + }, + result:{ + player:function(player){ + if(player.num('h','sha')>0) return 0.6; + var num=player.num('h'); + if(num>player.hp) return 0; + if(num==1) return -2; + if(num==2) return -1; + return -0.7; + }, + target:function(player,target){ + var num=target.num('h'); + if(num==1) return -1; + if(num==2) return -0.7; + return -0.5 + }, + }, + threaten:1.3 + } + }, + tianyi2:{ + mod:{ + targetInRange:function(card,player,target,now){ + if(card.name=='sha') return true; + }, + selectTarget:function(card,player,range){ + if(card.name=='sha'&&range[1]!=-1) range[1]++; + }, + cardUsable:function(card,player,num){ + if(card.name=='sha') return num+1; + } + }, + }, + tianyi3:{ + mod:{ + cardEnabled:function(card){if(card.name=='sha') return false} + } + }, + shuangxiong:{ + trigger:{player:'phaseDrawBefore'}, + check:function(event,player){ + if(player.num('h')>player.hp) return true; + if(player.num('h')>3) return true; + return false; + }, + content:function(){ + "step 0" + player.judge(); + "step 1" + player.gain(result.card); + player.addTempSkill('shuangxiong2','phaseAfter'); + player.storage.shuangxiong=get.color(result.card); + trigger.untrigger(); + trigger.finish(); + } + }, + shuangxiong2:{ + enable:'phaseUse', + viewAs:{name:'juedou'}, + filterCard:function(card,player){ + return get.color(card)!=player.storage.shuangxiong; + }, + check:function(card){ + return 6-ai.get.value(card); + }, + ai:{ + basic:{ + order:10 + } + } + }, + luanji:{ + enable:'phaseUse', + viewAs:{name:'wanjian'}, + filterCard:function(card,player){ + if(ui.selected.cards.length){ + return get.suit(card)==get.suit(ui.selected.cards[0]); + } + var cards=player.get('h'); + for(var i=0;i0; + }, + check:function(event,player){ + return ai.get.attitude(player,event.target)<0; + }, + content:function(){ + player.discardPlayerCard('he',trigger.target,true); + } + }, + }, + translate:{ + zhugeliangwolong:'卧龙', + pangtong:'庞统', + xunyu:'荀彧', + dianwei:'典韦', + taishici:'太史慈', + yanwen:'颜良文丑', + yuanshao:'袁绍', + pangde:'庞德', + huoji:'火计', + bazhen:'八阵', + kanpo:'看破', + lianhuan:'连环', + lianhuan1:'连环', + lianhuan2:'重铸♣︎', + niepan:'涅槃', + quhu:'驱虎', + jieming:'节命', + qiangxi:'强袭', + tianyi:'天义', + shuangxiong:'双雄', + shuangxiong2:'双雄', + luanji:'乱击', + xueyi:'血裔', + mengjin:'猛进', + huoji_info:'出牌阶段,你可以将你的任意一张♥或♦手牌当【火攻】使用。', + bazhen_info:'当你没装备防具时,始终视为你装备着【八卦阵】。', + kanpo_info:'你可以将你的任意一张♠或♣手牌当【无懈可击】使用。', + lianhuan_info:'出牌阶段,你可以将你任意一张梅花手牌当【铁索连环】使用或重铸。', + niepan_info:'当你处于濒死状态时,你可以丢弃你所有的牌和你判定区里的牌,并重置你的武将牌,然后摸三张牌且体力回复至3点。', + quhu_info:'出牌阶段,你可以与一名体力比你多的角色拼电,若你赢,则该角色对其攻击范围内另一名由你指定的角色造成1点伤害。若你没赢,他/她对你造成一点伤害。每回合限用一次。', + jieming_info:'你每受到1点伤害,可令任意一名角色将手牌补至其体力上限的张数(不能超过五张)。', + qiangxi_info:'出牌阶段,你可以自减一点体力或弃一张武器牌,然后你对你攻击范围内的一名角色造成一点伤害,每回合限一次。', + tianyi_info:'出牌阶段,你可以和一名角色拼点,若你赢,你获得以下技能直到回合结束:攻击范围无限;可额外使用一张【杀】;使用【杀】时可额外指定一个目标,若你没赢,你不能使用【杀】直到回合结束。每回合限一次。', + shuangxiong_info:'摸牌阶段,你可选择放弃摸牌并进行一次判定:你获得此判定牌,且于此回合的出牌阶段,你可以将任意一张与此判定牌不同颜色的手牌当【决斗】使用。', + luanji_info:'出牌阶段,你可以将任意两张相同花色的手牌当【万箭齐发】使用。', + xueyi_info:'场上每有一名其他群雄角色存活,你的手牌上限便+2。', + mengjin_info:'当你使用的【杀】被【闪】抵消时,你可以弃掉对方的一张牌。', + }, + help:{ + + } +} diff --git a/character/gujian.js b/character/gujian.js new file mode 100644 index 000000000..87daa8dc0 --- /dev/null +++ b/character/gujian.js @@ -0,0 +1,1048 @@ +character.gujian={ + character:{ + gjqt_bailitusu:['male','shu',4,['xuelu','fanshi','shahun'],['fullskin']], + gjqt_fengqingxue:['female','wu',3,['qinglan','yuehua','swd_wuxie'],['fullskin']], + gjqt_xiangling:['female','wu',3,['qianhuan','meihu','xidie'],['fullskin']], + gjqt_fanglansheng:['male','wu',3,['fanyin','mingkong','fumo'],['fullskin']], + gjqt_yinqianshang:['male','qun',4,['zhongji','zuizhan'],['fullskin']], + gjqt_hongyu:['female','shu',4,['jianwu','meiying'],['fullskin']], + + gjqt_yuewuyi:['male','wei',4,['yanjia','xiuhua'],['fullskin']], + gjqt_wenrenyu:['female','shu',4,['jizhan','qianjun'],['fullskin']], + gjqt_xiayize:['male','qun',3,['xuanning','liuguang','yangming'],['fullskin']], + gjqt_aruan:['female','wu',3,['zhaolu','jiehuo','yuling'],['fullskin']], + }, + skill:{ + jianwu:{ + trigger:{player:'shaBegin'}, + forced:true, + filter:function(event,player){ + return get.distance(event.target,player,'attack')>1; + }, + content:function(){ + trigger.directHit=true; + } + }, + zuizhan:{ + trigger:{player:'useCard'}, + popup:false, + filter:function(event,player){ + if(event.card.name!='sha') return false; + for(var i=0;iplayer.hp&&player.num('h','lebu')==0)||get.distance(player,event.player)>1); + }, + prompt:function(event,player){ + return '是否对'+get.translation(event.player)+'发动【魅影】?' + }, + content:function(){ + "step 0" + player.phase(); + player.storage.meiying=trigger.player; + "step 1" + if(!player.isTurnedOver()){ + player.turnOver(); + } + delete player.storage.meiying; + }, + mod:{ + targetInRange:function(card,player,target,now){ + if(target==player.storage.meiying) return true; + }, + }, + ai:{ + effect:{ + target:function(card){ + if(card.name=='guiyoujie') return [0,0]; + } + } + } + }, + xidie:{ + trigger:{player:'phaseBegin'}, + direct:true, + filter:function(event,player){ + return player.num('h')>player.hp; + }, + content:function(){ + "step 0" + player.chooseToDiscard('是否发动【戏蝶】?',[1,Math.min(3,player.num('h')-player.hp)]).ai=function(card){ + return 6-ai.get.value(card); + } + "step 1" + if(result.bool){ + player.logSkill('xidie'); + player.storage.xidie=result.cards.length; + } + }, + group:'xidie2' + }, + xidie2:{ + trigger:{player:'phaseEnd'}, + forced:true, + filter:function(event,player){ + return player.storage.xidie>0; + }, + content:function(){ + player.draw(player.storage.xidie); + player.storage.xidie=0; + } + }, + meihu:{ + trigger:{player:'damageEnd'}, + check:function(event,player){ + return ai.get.attitude(player,event.source)<4; + }, + filter:function(event,player){ + return event.source&&event.source!=player&&event.source.num('h')>0; + }, + content:function(){ + "step 0" + trigger.source.chooseCard('交给'+get.translation(player)+'一张手牌',true).ai=function(card){ + return -ai.get.value(card); + }; + "step 1" + if(result.bool){ + player.gain(result.cards[0]); + trigger.source.$give(1,player); + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-1.5]; + return [1,0,0,-0.5]; + } + } + } + } + }, + qianhuan:{ + trigger:{player:'phaseAfter'}, + check:function(event,player){ + return player.hp==1||player.isTurnedOver(); + }, + filter:function(event,player){ + return player.hp1||player.num('h',{color:'black'})>1; + }, + direct:true, + content:function(){ + "step 0" + player.chooseToDiscard('是否发动伏魔?',2,function(card){ + if(ui.selected.cards.length){ + return get.color(card)==get.color(ui.selected.cards[0]); + } + return player.num('h',{color:get.color(card)})>1; + }).ai=function(card){ + if(ai.get.damageEffect(trigger.source,player,player,'thunder')>0){ + return 8-ai.get.value(card); + } + return 0; + }; + "step 1" + if(result.bool){ + player.logSkill('fumo',trigger.source,'thunder'); + // player.line(trigger.source,'thunder'); + trigger.source.damage('thunder'); + } + }, + ai:{ + threaten:0.8 + } + }, + fanyin:{ + trigger:{player:'phaseEnd'}, + direct:true, + content:function(){ + "step 0" + player.chooseTarget('是否发动【梵音】?',function(card,player,target){ + if(player==target) return false; + if(target.isLinked()) return true; + if(target.isTurnedOver()) return true; + if(target.num('j')) return true; + if(target.hp==target.maxHp) return false; + for(var i=0;i0){ + var min=true; + for(var i=0;i0){ + return num+att; + } + } + return num; + } + "step 1" + if(result.bool){ + event.target=result.targets[0]; + player.logSkill('fanyin',event.target); + } + else{ + event.finish(); + } + "step 2" + if(event.target.isLinked()){ + event.target.link(); + } + "step 3" + if(event.target.isTurnedOver()){ + event.target.turnOver(); + } + "step 4" + var cards=event.target.get('j'); + if(cards.length){ + event.target.discard(cards); + } + "step 5" + var min=true; + for(var i=0;i=1; + }, + content:function(){ + if(trigger.num>=1){ + trigger.num--; + } + if(trigger.source){ + trigger.source.storage.mingkong=true; + trigger.source.addTempSkill('mingkong2','phaseBefore'); + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')&&target.num('h')==0){ + if(player.skills.contains('jueqing')) return; + return 0.1; + } + } + } + }, + }, + mingkong2:{ + trigger:{source:'damageEnd'}, + forced:true, + popup:false, + filter:function(event,player){ + return player.storage.mingkong?true:false; + }, + content:function(){ + player.draw(); + player.storage.mingkong=false; + player.removeSkill('mingkong2'); + } + }, + yuehua:{ + trigger:{player:['useCardAfter','respondAfter','discardAfter']}, + frequent:true, + filter:function(event,player){ + if(player==_status.currentPhase) return false; + if(event.cards){ + for(var i=0;i0; + }, + direct:true, + priority:-5, + content:function(){ + "step 0" + player.chooseToDiscard('是否对'+get.translation(trigger.player)+'发动【晴岚】?','he').ai=function(card){ + if(trigger.num>1||!trigger.source){ + if(ai.get.attitude(player,trigger.player)>0){ + return 9-ai.get.value(card); + } + return -1; + } + else if(ai.get.attitude(player,trigger.player)>0){ + if(trigger.player.hp==1){ + return 8-ai.get.value(card); + } + if(trigger.source.hp==trigger.source.maxHp){ + return 6-ai.get.value(card); + } + } + else if(ai.get.attitude(player,trigger.source)>0&& + trigger.source.hp1){ + if(get.color(card)=='red') return 5-ai.get.value(card); + } + return -1; + } + "step 1" + if(result.bool){ + player.logSkill('qinglan'); + trigger.untrigger(); + trigger.finish(); + if(trigger.source){ + trigger.source.recover(); + } + } + else{ + event.finish(); + } + "step 2" + if(trigger.source){ + trigger.source.draw(); + } + }, + ai:{ + expose:0.1 + } + }, + fanshi:{ + trigger:{player:'phaseDiscardAfter'}, + forced:true, + filter:function(event,player){ + return player.getStat('damage')>0; + }, + check:function(event,player){ + return player.hp==player.maxHp; + }, + content:function(){ + "step 0" + player.loseHp(); + "step 1" + player.draw(); + } + }, + xuelu:{ + unique:true, + trigger:{player:'phaseEnd'}, + direct:true, + filter:function(event,player){ + return player.maxHp>player.hp; + }, + content:function(){ + "step 0" + player.chooseCardTarget({ + position:'he', + filterTarget:function(card,player,target){ + return player!=target; + }, + filterCard:true, + ai1:function(card){ + return 9-ai.get.value(card); + }, + ai2:function(target){ + return ai.get.damageEffect(target,player,player,'fire'); + }, + prompt:'是否发动【血戮】?' + }); + "step 1" + if(result.bool){ + event.target=result.targets[0]; + player.logSkill('xuelu',event.target,'fire'); + event.num=Math.ceil((player.maxHp-player.hp)/2); + player.discard(result.cards); + } + else{ + event.finish(); + } + "step 2" + if(event.target){ + event.target.damage(event.num,'fire'); + } + }, + ai:{ + maixie:true, + expose:0.2, + threaten:function(player,target){ + if(target.hp==1) return 3; + if(target.hp==2) return 1.5; + return 0.5; + }, + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(target.hp==target.maxHp) return [0,1]; + } + if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0]; + } + } + } + }, + xiuhua:{ + forbid:['versus'], + trigger:{player:'shaHit'}, + filter:function(event,player){ + return event.target!=player.previous; + }, + content:function(){ + game.swapSeat(trigger.target,player,true,true); + } + }, + shahun:{ + enable:'chooseToUse', + filter:function(event,player){ + return !player.storage.shahun&&player.hp<=0; + }, + content:function(){ + "step 0" + var cards=player.get('hej'); + player.discard(cards); + event.num=Math.max(3,cards.length); + "step 1" + if(player.isLinked()) player.link(); + "step 2" + if(player.isTurnedOver()) player.turnOver(); + "step 3" + player.draw(event.num); + "step 4" + player.recover(1-player.hp); + player.removeSkill('fanshi'); + player.addSkill('juejing'); + player.storage.shahun=3; + player.markSkill('shahun'); + }, + group:'shahun2', + intro:{ + content:'turn' + }, + ai:{ + save:true, + result:{ + player:3 + } + } + }, + shahun2:{ + trigger:{player:'phaseAfter'}, + forced:true, + filter:function(event,player){ + return player.storage.shahun?true:false; + }, + content:function(){ + if(player.storage.shahun>1){ + player.storage.shahun--; + } + else{ + player.die(); + } + } + }, + yanjia:{ + enable:'chooseToUse', + filter:function(event,player){ + return player.num('he',{type:'equip'})>0; + }, + filterCard:function(card){ + return get.type(card)=='equip'; + }, + position:'he', + viewAs:{name:'wuzhong'}, + prompt:'将一张装备牌当无中生有使用', + check:function(card){ + var player=_status.currentPhase; + if(player.num('he',{subtype:get.subtype(card)})>1){ + return 11-ai.get.equipValue(card); + } + if(player.num('h')0&&player.storage.xuanning!=3; + }, + filterCard:function(card){ + return get.type(card)=='basic'; + }, + check:function(card){ + return 7-ai.get.useful(card); + }, + content:function(){ + player.storage.xuanning=3; + player.markSkill('xuanning'); + }, + ai:{ + result:{ + player:function(player){ + var num=player.num('h'); + if(num>player.hp+1) return 1; + if(player.storage.xuanning>=2) return 0; + if(num>player.hp) return 1 + if(player.storage.xuanning>=1) return 0; + return 1; + }, + }, + order:5 + } + }, + xuanning2:{ + trigger:{player:'damageEnd'}, + forced:true, + filter:function(event,player){ + if(player.storage.xuanning){ + return (event.source&&event.source.num('he')>0); + } + return false; + }, + content:function(){ + player.discardPlayerCard(trigger.source,ai.get.buttonValue,'he',true); + player.storage.xuanning--; + if(!player.storage.xuanning){ + player.unmarkSkill('xuanning'); + } + } + }, + liuguang:{ + trigger:{player:'phaseBegin'}, + direct:true, + filter:function(event,player){ + if(player.storage.xuanning) return true; + return false; + }, + content:function(){ + "step 0" + player.chooseTarget(function(card,player,target){ + return player!=target; + },'是否发动【流光】?',[1,3]).ai=function(target){ + return ai.get.damageEffect(target,player,player); + } + "step 1" + if(result.bool){ + player.storage.xuanning--; + if(!player.storage.xuanning){ + player.unmarkSkill('xuanning'); + } + event.targets=result.targets.slice(0); + event.targets.sort(lib.sort.seat); + player.logSkill('liuguang',result.targets); + } + else{ + event.finish(); + } + "step 2" + if(event.targets.length){ + var target=event.targets.shift(); + var next=target.chooseToDiscard('流光:弃置一张牌或受到一点伤害','he'); + next.ai=function(card){ + if(ai.get.damageEffect(_status.event.player,player,_status.event.player)>=0) return -1; + if(_status.event.player.hp==1) return 9-ai.get.value(card); + return 8-ai.get.value(card); + }; + next.autochoose=function(){ + return this.player.num('he')==0; + }; + event.current=target; + } + else{ + event.finish(); + } + "step 3" + if(result.bool&&result.cards&&result.cards.length){ + event.goto(2); + } + else{ + event.current.damage(); + } + }, + ai:{ + expose:0.2 + } + }, + yangming:{ + enable:'phaseUse', + filter:function(event,player){ + if(player.storage.yangming2>0) return false; + return player.num('h',{color:'red'})>0; + }, + filterCard:function(card){ + return get.color(card)=='red'; + }, + content:function(){ + player.storage.yangming2=2; + player.addSkill('yangming2'); + }, + check:function(card){ + return 6-ai.get.value(card); + }, + ai:{ + result:{ + player:1 + }, + order:6 + } + }, + yangming2:{ + trigger:{player:'phaseUseEnd'}, + direct:true, + mark:true, + content:function(){ + "step 0" + player.storage.yangming2--; + if(player.storage.yangming2>0){ + event.finish(); + } + else{ + player.removeSkill('yangming2'); + var num=0 + for(var i=0;i5; + }, + check:function(event,player){ + return player.num('h')<2; + }, + content:function(){ + player.chooseToDiscard(true,player.num('h')-5); + } + }, + yuling4:{ + mod:{ + cardEnabled:function(card,player){ + if(_status.currentPhase!=player) return; + if(get.cardCount(true,player)>=player.maxHp+2) return false; + } + } + }, + yuling5:{ + trigger:{player:['useCardAfter','phaseBegin']}, + forced:true, + popup:false, + silent:true, + content:function(){ + player.storage.yuling=player.maxHp+2-get.cardCount(true,player); + } + }, + yuling6:{ + trigger:{player:'phaseAfter'}, + forced:true, + popup:false, + silent:true, + content:function(){ + delete player.storage.yuling; + } + }, + }, + translate:{ + gjqt_bailitusu:'百里屠苏', + gjqt_fengqingxue:'风晴雪', + gjqt_fanglansheng:'方兰生', + gjqt_xiangling:'襄铃', + gjqt_yinqianshang:'尹千觞', + gjqt_hongyu:'红玉', + + gjqt_yuewuyi:'乐无异', + gjqt_wenrenyu:'闻人羽', + gjqt_xiayize:'夏夷则', + gjqt_aruan:'阿阮', + + xidie:'戏蝶', + xidie2:'戏蝶', + xidie_info:'回合开始阶段,若你的手牌数大于体力值,可以弃置至多X张牌,并于回合结束阶段摸等量的牌,X为你的体力值与手牌数之差且不超过3', + meihu:'魅狐', + meihu2:'魅狐', + meihu_info:'当你受到伤害后,可令伤害来源交给你一张手牌', + jianwu:'剑舞', + jianwu_info:'锁定技,每当你使用一张杀,若你不在目标的攻击范围内,此杀不可闪避。', + meiying:'魅影', + meiying_info:'在一名其他角色的回合开始前,若你的武将牌正面朝上,你可以进行一个额外回合,并在回合结束后翻面(若已翻面则不翻回来)。若如此做,你对其使用卡牌无视距离直到回合结束。', + zhongji:'重击', + zhongji_info:'每当你即将造成伤害,可弃置一张黑色手牌令伤害+1', + zuizhan:'醉斩', + zuizhan_info:'每当你使用一张杀,可以摸一张牌,然后此杀随机增加一个额外目标', + qianhuan:'千幻', + qianhuan_info:'回合结束后,若你已受伤,你可以回复一点体力并摸一张牌,然后将武将牌翻面。若你的武将牌背面朝上,你不能使用卡牌,也不能成为卡牌的目标', + fumo:'伏魔', + fumo_info:'每当你受到一次伤害,可以弃置两张颜色相同的手牌并对伤害来源造成一点雷电伤害', + fanyin:'梵音', + fanyin_info:'回合结束阶段,你可以令一名角色重置武将牌。若其体力值是全场最少的之一,其回复一点体力。', + mingkong:'明空', + mingkong_info:'锁定技,若你没有手牌,你受到的伤害-1,然后伤害来源摸一张牌', + qinglan:'晴岚', + qinglan_info:'每当有一名角色即将受到属性伤害,你可以弃置一张牌令其防止此伤害,然后伤害来源摸一张牌并回复一点体力', + yuehua:'月华', + yuehua_info:'每当你于回合外使用、打出或弃置红色牌,你可以摸一张牌', + xuelu:'血戮', + xuelu_info:'回合结束阶段,你可以弃置一张牌并对一名其他角色造成X点火焰伤害,X为你已损失体力值的一半,向上取整', + fanshi:'反噬', + fanshi_info:'锁定技,若你于回合内造成过伤害,你于弃牌阶段结束时流失一点体力并摸一张牌', + shahun:'煞魂', + shahun2:'煞魂', + shahun_info:'限定技,濒死阶段,你可以重置武将牌,弃置所有牌并摸等量的牌(至少三张),然后将体力回复至1;若如此做,你失去技能【反噬】,并获得技能【绝境】,然后于三回合后立即死亡', + + xiuhua:'袖花', + xiuhua_info:'每当你使用杀击中目标,你可以将其拉至你的旁边', + liuying:'流影', + liuying_info:'你可以将一张装备牌当顺手牵羊使用', + yanjia:'偃甲', + yanjia_info:'你可以将一张装备牌当无中生有使用', + boyun:'拨云', + boyun1:'拨云', + boyun2:'拨云', + boyun_info:'在你的回合内,你可以弃置一张装备牌,并展示牌堆顶的一张牌,若其为装备牌,你须将其交给任意一张角色并对其造成一点伤害,否则你摸一张牌', + jizhan:'疾战', + jizhan_info:'出牌阶段,你可以将移动到任意一名角色的前一位,视为对其使用了一张杀,每阶段限一次', + qianjun:'千军', + qianjun_info:'每当你使用一张杀,你可以弃置一张非基本牌,令距离目标1以内的所有角色成为额外目标', + xuanning:'玄凝', + xuanning1:'玄凝', + xuanning2:'玄凝', + liuguang:'流光', + yangming:'养命', + yangming2:'养命', + xuanning_info:'出牌阶段,你可以弃置一基本牌,获得至多3个玄凝标记。当你受到伤害时,若你有玄凝标记,你须弃置一个玄凝标记并弃置伤害来源一张牌', + liuguang_info:'回合开始阶段,若你有玄凝标记,你可以弃置一枚玄凝标记,选择至多三名角色依次令其弃置一张牌或受到一点伤害,若有角色受到伤害则终止结算', + yangming_info:'出牌阶段,你可以弃置一张红色牌,并在下个出牌阶段结束时令距离1以内的任意名角色回复一点体力,在此之前不可再次发动', + zhaolu:'朝露', + jiehuo:'劫火', + yuling:'御灵', + yuling1:'御灵', + yuling2:'御灵', + yuling3:'御灵', + yuling4:'御灵', + zhaolu_info:'锁定技,每隔X回合,你流失一点体力上限,每当你受到一点伤害或有人死亡,视为减少两个回合,X为现存角色数且至多为5', + jiehuo_info:'限定技,出牌阶段,你可以令所有其他角色受到X点火焰伤害,然后你立即死亡,X为你的体力值且不超过该角色的当前体力值', + yuling_info:'锁定技,你没有摸牌和弃牌阶段,你的手牌数始终为5,你在一个出牌阶段最多使用X+2张牌,X为你的体力上限', + }, +} diff --git a/character/guozhan.js b/character/guozhan.js new file mode 100644 index 000000000..ed3eca138 --- /dev/null +++ b/character/guozhan.js @@ -0,0 +1,16 @@ +character.guozhan={ + character:{ + ganfuren:['female','shu',3,['shushen','shenzhi'],['fullskin']], + mifuren:['female','shu',3,['guixiu','cunsi'],['fullskin']], + mateng:['male','qun',4,['xiongyi','mashu'],['fullskin']], + tianfeng:['male','qun',3,['sijian','suishi'],['fullskin']], + yuejin:['male','wei',4,['xiaoguo'],['fullskin']], + chendong:['male','wu',4,['duanxie','fenming'],['fullskin']], + sp_dongzhuo:['male','qun',5,['hengzheng'],['fullskin']], + jiangfei:['male','shu',3,['shengxi','shoucheng'],['fullskin']], + jiangqing:['male','wu',4,['shangyi'],['fullskin']], + hetaihou:['female','qun',3,['zhendu','qiluan'],['fullskin']], + kongrong:['male','qun',3,['lirang','mingshi'],['fullskin']], + dingfeng:['male','wu',4,['fenxun'],['fullskin']], + }, +}; diff --git a/character/jiange.js b/character/jiange.js new file mode 100644 index 000000000..3b472ac43 --- /dev/null +++ b/character/jiange.js @@ -0,0 +1,605 @@ +character.jiange={ + character:{ + jg_pangtong:['male','shu',3,['qiwu','tianyu'],['fullskin']], + jg_huangyueying:['female','shu',3,['zhinang','jingmiao'],['fullskin']], + jg_zhugeliang:['male','shu',3,['biantian','bazhen'],['fullskin']], + jg_liubei:['male','shu',4,['jizhen','lingfeng'],['fullskin']], + jg_xiahouyuan:['male','wei',4,['shensu','juechen'],['fullskin']], + jg_caozhen:['male','wei',4,['chiying','jingfan'],['fullskin']], + jg_zhanghe:['male','wei',4,['huodi','jueji'],['fullskin']], + jg_simayi:['male','wei',6,['xuanlei','sfanshi','konghun'],['fullskin']], + }, + skill:{ + sfanshi:{ + init:function(player){ + player.maxHp=Math.floor(game.players.length/2)+2; + player.hp=player.maxHp; + player.update(); + }, + trigger:{global:'dieAfter'}, + forced:true, + content:function(){ + player.maxHp=Math.floor(game.players.length/2)+2; + player.hp=Math.min(player.hp,player.maxHp); + player.update(); + }, + group:'sfanshi2', + ai:{ + mingzhi:false + } + }, + sfanshi2:{ + trigger:{player:'phaseEnd'}, + forced:true, + check:function(){ + return false; + }, + content:function(){ + player.loseHp(); + } + }, + konghun:{ + trigger:{player:'phaseUseBegin'}, + direct:true, + filter:function(event,player){ + return player.hp<=Math.floor(game.players.length/3); + }, + content:function(){ + "step 0" + player.chooseTarget('是否发动【控魂】?',function(card,player,target){ + return player!=target; + },[1,Math.floor(game.players.length/2)]).ai=function(target){ + return ai.get.damageEffect(target,player,player,'thunder')+1; + } + "step 1" + if(result.bool){ + event.targets=result.targets.slice(0); + player.logSkill('konghun',event.targets,'thunder'); + event.targets.sort(lib.sort.seat); + event.num=0; + } + else{ + event.finish(); + } + "step 2" + if(event.num0&&event.player!=player&&event.player.hp1||event.targets[0]!=player); + }, + silent:true, + forced:true, + popup:false, + content:function(){ + player.addTempSkill('huodi3','phaseAfter'); + } + }, + huodi3:{}, + jingfan:{ + trigger:{player:'phaseUseEnd'}, + unique:true, + direct:true, + content:function(){ + "step 0" + var num=get.cardCount(true,player)-player.num('h'); + event.num=num; + if(num>0){ + player.draw(num); + } + "step 1" + if(event.num>0){ + player.chooseTarget('选择至多'+get.cnNumber(event.num)+'名角色令其与其他角色的距离-1',[1,event.num],function(card,player,target){ + return player!=target; + }).ai=function(target){ + return ai.get.attitude(player,target); + } + } + else{ + event.finish(); + } + "step 2" + if(result.bool&&result.targets){ + player.logSkill('jingfan',result.targets); + for(var i=0;i0; + }, + filter:function(event,player){ + if(event.num<=1) return false; + return true; + }, + priority:-11, + content:function(){ + trigger.num=1; + if(trigger.source){ + trigger.source.addTempSkill('chiying2','damageAfter'); + } + } + }, + chiying2:{ + trigger:{source:'damageEnd'}, + forced:true, + popup:false, + content:function(){ + player.draw(); + } + }, + juechen:{ + trigger:{player:'useCard'}, + filter:function(event,player){ + return event.card.name=='sha'; + }, + direct:true, + content:function(){ + "step 0" + game.delay(0.5); + player.chooseTarget('是否发动【绝尘】?',function(card,player,target){ + return player!=target&&!trigger.targets.contains(target)&&target.num('he')>0; + }).ai=function(target){ + return -ai.get.attitude(player,target); + } + "step 1" + if(result.bool){ + player.logSkill('juechen',result.targets); + player.discardPlayerCard(true,result.targets[0],'he'); + } + } + }, + lingfeng:{ + trigger:{player:'phaseDrawBefore'}, + check:function(event,player){ + for(i=0;i0; + }).ai=function(target){ + return -ai.get.attitude(player,target); + } + } + "step 2" + if(result.bool&&result.targets&&result.targets.length){ + player.discardPlayerCard(result.targets[0],'he',true); + } + "step 3" + player.gain(event.cards); + player.$draw(event.cards); + game.delay(); + }, + ai:{ + threaten:1.1 + } + }, + biantian4:{ + trigger:{player:'dieBegin'}, + forced:true, + popup:false, + content:function(){ + for(var i=0;i0; + }, + content:function(){ + "step 0" + player.choosePlayerCard(trigger.player,'是否发动【精妙】弃置'+ + get.translation(trigger.player)+'一张牌?','he'); + "step 1" + if(result.bool){ + player.logSkill('jingmiao',trigger.player); + trigger.player.discard(result.links); + } + }, + ai:{ + expose:0.2 + } + }, + zhinang:{ + trigger:{player:'phaseBegin'}, + frequent:true, + content:function(){ + "step 0" + event.cards=get.cards(3); + event.cards2=[]; + for(var i=0;iplayer.hp){ + if(target==player) return Math.max(1,att-2); + } + if(target==player) return att+5; + return att; + } + if(!event.isMine()){ + dialog.style.display='none'; + } + } + "step 1" + if(result&&result.targets&&result.targets.length){ + event.target=result.targets[0]; + } + if(event.cards2.length){ + event.target.gain(event.cards2,'gain'); + } + }, + ai:{ + threaten:1.3 + } + }, + qiwu:{ + trigger:{player:'useCard'}, + forced:true, + filter:function(event,player){ + return get.suit(event.card)=='club'&&player.hp0){ + player.discardPlayerCard(target,'he',true); + } + else{ + event.finish(); + } + }, + ai:{ + order:4, + expose:0.2, + result:{ + target:-1, + player:function(player,target){ + if(target.num('h')==0) return 0; + if(target.num('h')==1) return -0.1; + if(player.hp<=2) return -2; + if(player.num('h','shan')==0) return -1; + return -0.5; + } + }, + threaten:1.1 + } + }, + zhiji:{ + unique:true, + trigger:{player:'phaseBegin'}, + forced:true, + filter:function(event,player){ + if(player.storage.zhiji) return false; + return player.num('h')==0; + }, + content:function(){ + "step 0" + player.chooseControl('zhiji_recover','zhiji_draw',function(event,player){ + if(player.hp>=2) return 'zhiji_draw'; + return 'zhiji_recover'; + }); + "step 1" + if(result.control=='zhiji_draw'){ + player.draw(2); + } + else{ + player.recover(); + } + "step 2" + if(lib.config.mode!='guozhan'||player.maxHp>=4){ + player.loseMaxHp(); + } + player.storage.zhiji=true; + if(player.hp>player.maxHp) player.hp=player.maxHp; + player.update(); + player.addSkill('guanxing') + } + }, + xiangle:{ + trigger:{target:'useCardToBefore'}, + forced:true, + filter:function(event,player){ + return event.card.name=='sha'; + }, + content:function(){ + "step 0" + trigger.player.chooseToDiscard(function(card){ + return get.type(card)=='basic'; + }).ai=function(card){ + return 10-ai.get.value(card); + }; + "step 1" + if(result.bool==false){ + trigger.finish(); + trigger.untrigger(); + } + }, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(card.name=='sha'){ + if(player.num('h',{type:'basic'})<2) return 0; + return [1,0,1,-0.5]; + } + } + } + } + }, + fangquan:{ + trigger:{player:'phaseUseBefore'}, + filter:function(event,player){ + return player.num('h')>0; + }, + direct:true, + content:function(){ + "step 0" + var fang=player.hp>=2&&player.num('h')<=player.hp+1; + player.chooseTarget('是否发动放权?',function(card,player,target){ + return target!=player; + }).ai=function(target){ + if(!fang) return -1; + return ai.get.attitude(player,target)-4; + }; + "step 1" + if(result.bool){ + player.logSkill('fangquan',result.targets); + trigger.untrigger(); + trigger.finish(); + player.addSkill('fangquan2'); + player.storage.fangquan=result.targets[0]; + } + } + }, + fangquan2:{ + trigger:{player:'phaseEnd'}, + forced:true, + popup:false, + content:function(){ + "step 0" + player.chooseToDiscard(true); + "step 1" + player.storage.fangquan.phase(); + player.removeSkill('fangquan2'); + } + }, + ruoyu:{ + unique:true, + trigger:{player:'phaseBegin'}, + forced:true, + filter:function(event,player){ + if(player!=game.zhu)return false; + if(player.storage.ruoyu) return false; + for(var i=0;i0; + }, + direct:true, + frequent:true, + content:function(){ + "step 0" + if(player.num('j')==0&&(!event.isMine()||!lib.config.autoskilllist.contains('qiaobian1'))){ + event.finish(); + } + else{ + player.chooseToDiscard('是否发动巧变路过判定阶段?').ai=ai.get.unuseful2; + } + "step 1" + if(result.bool){ + player.logSkill('qiaobian'); + trigger.untrigger(); + trigger.finish(); + } + } + }, + qiaobian2:{ + trigger:{player:'phaseDrawBefore'}, + filter:function(event,player){ + return player.num('h')>0; + }, + direct:true, + check:function(event,player){ + + }, + content:function(){ + "step 0" + var check,i,num=0,num2=0; + for(i=0;i=2&&num2>0); + + player.chooseCardTarget({ + ai1:function(card){ + if(!check) return 0; + return 6-ai.get.useful(card); + }, + ai2:function(target){ + if(!check) return 0; + return 1-ai.get.attitude(player,target); + }, + filterTarget:function(card,player,target){ + return target.num('h')>0; + }, + selectTarget:[0,2], + filterCard:true, + prompt:'是否发动巧变路过摸牌阶段?' + }); + "step 1" + if(result.bool){ + player.logSkill('qiaobian',result.targets); + player.discard(result.cards); + } + "step 2" + game.delay(); + "step 3" + if(result.bool){ + for(var i=0;i0; + }, + direct:true, + check:function(event,player){ + + }, + content:function(){ + "step 0" + var check; + for(var i=0;i0&&game.players[i].num('j')){ + check=true;break; + } + } + if(!check){ + if(player.num('h')>player.hp+1){ + check=false; + } + else if(player.num('h',{name:['wuzhong']})){ + check=false; + } + else{ + check=true; + } + } + + player.chooseCardTarget({ + ai1:function(card){ + if(!check) return 0; + return 7-ai.get.useful(card); + }, + ai2:function(target){ + if(!check) return 0; + if(ui.selected.targets.length==0){ + if(target.num('j')&&ai.get.attitude(player,target)>0) return 10; + if(ai.get.attitude(player,target)<0){ + for(var i=0;i0){ + if((target.get('e','1')&&!game.players[i].get('e','1'))|| + (target.get('e','2')&&!game.players[i].get('e','2'))|| + (target.get('e','3')&&!game.players[i].get('e','3'))|| + (target.get('e','4')&&!game.players[i].get('e','4'))|| + (target.get('e','5')&&!game.players[i].get('e','5'))) return -ai.get.attitude(player,target); + } + } + } + return 0; + } + return -ai.get.attitude(player,target)*ai.get.attitude(player,ui.selected.targets[0]); + }, + multitarget:true, + filterTarget:function(card,player,target){ + if(ui.selected.targets.length){ + var from=ui.selected.targets[0]; + var judges=from.get('j'); + for(var i=0;i0; + } + }, + selectTarget:2, + filterCard:true, + prompt:'是否发动巧变路过出牌阶段?', + targetprompt:['被移走','移动目标'] + }); + "step 1" + if(result.bool==false){ + event.finish(); + return; + } + trigger.untrigger(); + trigger.finish(); + player.discard(result.cards); + player.logSkill('qiaobian',result.targets,false); + player.line2(result.targets); + event.targets=result.targets; + "step 2" + game.delay(); + "step 3" + if(targets.length==2){ + player.choosePlayerCard('ej',function(button){ + if(ai.get.attitude(player,targets[0])>ai.get.attitude(player,targets[1])){ + return get.position(button.link)=='j'?10:0; + } + else{ + if(get.position(button.link)=='j') return -10; + return ai.get.equipValue(button.link); + } + },targets[0]); + } + else{ + event.finish(); + } + "step 4" + if(result.bool){ + if(get.position(result.buttons[0].link)=='e'){ + event.targets[1].equip(result.buttons[0].link); + } + else if(result.buttons[0].link.viewAs){ + event.targets[1].addJudge({name:result.buttons[0].link.viewAs},[result.buttons[0].link]); + } + else{ + event.targets[1].addJudge(result.buttons[0].link); + } + event.targets[0].$give(result.buttons[0].link,event.targets[1]) + game.delay(); + } + }, + ai:{ + expose:0.2 + } + }, + qiaobian4:{ + trigger:{player:'phaseDiscardBefore'}, + direct:true, + filter:function(event,player){ + return player.num('h')>0; + }, + content:function(){ + "step 0" + var discard=player.num('h')>player.hp; + player.chooseToDiscard('是否发动巧变路过弃牌阶段?').ai=function(card){ + if(discard){ + return 100-ai.get.useful(card); + } + else{ + return -1; + } + }; + "step 1" + if(result.bool){ + player.logSkill('qiaobian'); + trigger.untrigger(); + trigger.finish(); + } + } + }, + tuntian:{ + trigger:{player:'loseEnd'}, + frequent:true, + filter:function(event,player){ + if(player==_status.currentPhase) return false; + for(var i=0;i=0){ + hasfriend=true;break; + } + } + if(!hasfriend) return; + if(get.tag(card,'respondSha')||get.tag(card,'respondShan')){ + if(target.num('h')==0) return 2; + return [0.5,target.num('h','sha')+target.num('h','shan')]; + } + } + }, + threaten:function(player,target){ + if(target.num('h')==0) return 2; + return 0.5; + } + } + }, + zaoxian:{ + unique:true, + trigger:{player:'phaseBegin'}, + forced:true, + filter:function(event,player){ + if(player.storage.tuntian) return player.storage.tuntian.length>=3&&!player.storage.zaoxian; + }, + content:function(){ + if(lib.config.mode!='guozhan'||player.maxHp>=4){ + player.loseMaxHp(); + } + player.addSkill('jixi'); + player.storage.zaoxian=true; + } + }, + jixi:{ + enable:'phaseUse', + filter:function(event,player){ + return player.storage.tuntian.length>0; + }, + content:function(){ + "step 0" + player.chooseCardButton('急袭',player.storage.tuntian); + "step 1" + if(result.bool){ + var card=result.buttons[0].link; + event.card=card; + player.storage.tuntian.remove(card); + if(!player.storage.tuntian.length){ + player.unmarkSkill('tuntian'); + } + player.chooseTarget(function(noname,player,target){ + var temp=card.name; + card.name='shunshou'; + var result=player.canUse(card,target); + card.name=temp; + return result; + },true).ai=function(target){ + return -ai.get.attitude(player,target); + }; + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + player.useCard({name:'shunshou'},[event.card],result.targets[0]) + } + }, + ai:{ + order:10, + result:{ + player:function(player){ + return player.storage.tuntian.length-1; + } + } + } + }, + jiang:{ + trigger:{player:['shaBefore','juedouBefore'],target:['shaBefore','juedouBefore']}, + filter:function(event,player){ + if(event.card.name=='juedou') return true; + return get.color(event.card)=='red'; + }, + frequent:true, + content:function(){ + player.draw(); + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(card.name=='sha'&&get.color(card)=='red') return [1,0.6]; + }, + player:function(card,player,target){ + if(card.name=='sha'&&get.color(card)=='red') return [1,1]; + } + } + } + }, + hunzi:{ + unique:true, + trigger:{player:'phaseBegin'}, + filter:function(event,player){ + return player.hp==1; + }, + forced:true, + priority:3, + group:'hunzi2', + content:function(){ + if(lib.config.mode!='guozhan'||player.maxHp>=4){ + player.loseMaxHp(); + } + if(player.hp>player.maxHp) player.loseHp(); + player.addSkill('reyingzi'); + delete player.tempSkills.yinghun; + player.removeSkill('hunzi'); + }, + ai:{ + maixie:true, + effect:{ + target:function(card,player,target){ + var hasfriend=false; + for(var i=0;i=0){ + hasfriend=true;break; + } + } + if(!hasfriend) return; + if(get.tag(card,'damage')==1&&target.hp==2&&_status.currentPhase!=target) return [0.5,1]; + } + } + } + }, + hunzi2:{ + unique:true, + trigger:{player:'phaseBefore'}, + filter:function(event,player){ + return player.hp==1; + }, + forced:true, + popup:false, + content:function(){ + player.addTempSkill('yinghun','phaseAfter'); + }, + }, + zhiba:{ + unique:true, + global:'zhiba2', + }, + zhiba2:{ + enable:'phaseUse', + filter:function(event,player){ + if(!game.zhu) return false; + return (player!=game.zhu&&game.zhu.skills.contains('zhiba')&& + player.group=='wu'&&player.num('h')>0&&game.zhu.num('h')>0); + }, + filterTarget:function(card,player,target){ + return target==game.zhu; + }, + usable:1, + content:function(){ + "step 0" + player.chooseToCompare(target,function(card){ + var player=get.owner(card); + if(player!=game.zhu&&ai.get.attitude(player,game.zhu)>0){ + return -get.number(card); + } + return get.number(card); + }); + "step 1" + if(result.bool==false){ + target.gain([result.player,result.target]); + target.$gain2([result.player,result.target]); + } + }, + ai:{ + basic:{ + order:1 + }, + expose:0.2, + result:{ + target:function(player){ + var cards=player.get('h'); + for(var i=0;i0; + }, + filterCard:function(card){ + return get.type(card)=='equip'; + }, + check:function(card){ + var player=_status.currentPhase; + if(player.num('he',{subtype:get.subtype(card)})>1){ + return 11-ai.get.equipValue(card); + } + return 6-ai.get.value(card); + }, + filterTarget:function(card,player,target){ + return player!=target&&!target.get('e',get.subtype(card)[5]); + }, + content:function(){ + target.equip(cards[0]); + player.draw(); + }, + discard:false, + prepare:function(cards,player,targets){ + player.$give(cards,targets[0],false); + }, + ai:{ + basic:{ + order:10 + }, + result:{ + target:3, + }, + threaten:1.3 + } + }, + guzheng:{ + unique:true, + gainable:true, + trigger:{global:'phaseDiscardEnd'}, + filter:function(event,player){ + if(event.player!=player&&event.player.classList.contains('dead')==false&& + event.cards&&event.cards.length){ + for(var i=0;i0) return true; + var num=0; + for(var i=0;i2; + }, + direct:true, + content:function(){ + "step 0" + game.delay(); + "step 1" + event.cards=trigger.cards.slice(0); + for(var i=0;i0; + }, + content:function(){ + "step 0" + player.chooseToDiscard('he','是否发动悲歌?').ai=ai.get.unuseful2; + "step 1" + if(result.bool){ + player.logSkill('beige'); + trigger.player.judge(); + } + else{ + event.finish(); + } + "step 2" + switch(get.suit(result.card)){ + case 'heart':trigger.player.recover();break; + case 'diamond':trigger.player.draw(2);break; + case 'club':trigger.source.chooseToDiscard('he',2,true);break; + case 'spade':trigger.source.turnOver();break; + } + }, + ai:{ + expose:0.3 + } + }, + duanchang:{ + trigger:{player:'dieBegin'}, + forced:true, + filter:function(event){ + return event.source!=undefined; + }, + content:function(){ + trigger.source.clearSkills(); + }, + ai:{ + threaten:function(player,target){ + if(target.hp==1) return 0.2; + return 1.5; + }, + effect:{ + target:function(card,player,target,current){ + var hasfriend=false; + for(var i=0;i=0){ + hasfriend=true;break; + } + } + if(!hasfriend) return; + if(target.hp<=1&&get.tag(card,'damage')) return [1,0,0,-2]; + } + } + } + }, + // fushen:{ + // trigger:{player:'phaseBefore'}, + // content:function(){ + // "step 0" + // if(player.storage.fushen&&player.storage.fushen.classList.contains('dead')==false){ + // if(player==game.me) game.swapPlayer(player.storage.fushen); + // else if(player.storage.fushen==game.me) game.swapPlayer(player); + // delete player.storage.fushen; + // event.finish(); + // } + // else{ + // player.chooseTarget(function(card,player,target){ + // if(player==target) return false; + // return true; + // }).ai=function(){ + // return -1;//1+Math.random(); + // } + // } + // "step 1" + // if(result.bool){ + // player.storage.fushen=result.targets[0]; + // if(player==game.me){ + // game.swapPlayer(result.targets[0]); + // } + // else if(result.targets[0]==game.me){ + // game.swapPlayer(player); + // } + // } + // } + // }, + huashen:{ + unique:true, + forbid:['guozhan'], + init:function(player){ + player.storage.huashen={ + list:[], + owned:{}, + player:player, + get:function(num){ + if(typeof num!='number') num=1; + var player=this.player; + while(num--){ + var name=player.storage.huashen.unowned.shift(); + var skills=lib.character[name][3].slice(0); + for(var i=0;i0&&player!=target&&target.num('h')>=player.num('h'); + },function(target){ + return (1-ai.get.attitude(_status.event.player,target)); + }); + "step 1" + if(result.bool){ + player.logSkill('retuxi'); + for(var i=0;i0; + }, + content:function(){ + "step 0" + player.chooseCard('鬼才:请选择代替判定的牌','he').ai=function(card){ + var trigger=_status.event.parent._trigger; + var player=_status.event.player; + var result=trigger.judge(card)-trigger.judge(trigger.player.judging); + var attitude=ai.get.attitude(player,trigger.player); + if(attitude==0||result==0) return 0; + if(attitude>0){ + return result-ai.get.value(card)/2; + } + else{ + return -result-ai.get.value(card)/2; + } + }; + "step 1" + if(result.bool){ + player.respond(result.cards); + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + player.logSkill('guicai'); + if(trigger.player.judging.clone) trigger.player.judging.clone.delete(); + ui.discardPile.appendChild(trigger.player.judging); + trigger.player.judging=result.cards[0]; + game.delay(2); + } + }, + ai:{ + tag:{ + rejudge:1, + } + } + }, + refankui:{ + trigger:{player:'damageEnd'}, + direct:true, + filter:function(event,player){ + return (event.source&&event.source.num('he')); + }, + content:function(){ + "step 0" + event.num=trigger.num; + "step 1" + if(num==0||trigger.source.num('he')==0){ + event.finish(); + return; + } + event.num--; + player.choosePlayerCard(trigger.source,ai.get.buttonValue,'he'); + "step 2" + if(result.bool){ + player.logSkill('refankui',trigger.source); + player.gain(result.buttons[0].link); + trigger.source.$give(1,player); + event.goto(1); + } + }, + ai:{ + result:{ + target:function(card,player,target){ + if(player.num('he')>1&&get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-1.5]; + if(ai.get.attitude(target,player)<0) return [1,1]; + } + } + } + } + }, + reluoyi:{ + trigger:{player:'phaseDrawBegin'}, + check:function(event,player){ + if(player.num('h','sha')) return true; + return Math.random()<0.5; + }, + content:function(){ + "step 0" + player.addTempSkill('luoyi2',{player:'phaseBefore'}); + trigger.untrigger(); + trigger.finish(); + "step 1" + event.cards=get.cards(3); + event.dialog=ui.create.dialog('裸衣',event.cards); + game.delay(2); + "step 2" + event.dialog.close(); + for(var i=0;i=player.hp+3) return true; + if(player.num('h')>=player.hp+2&&game.players.length+game.dead.length>=7) return true; + return false; + }, + content:function(){ + if(lib.config.mode!='guozhan'||player.maxHp>=4){ + player.loseMaxHp(); + } + player.addSkill('gongxin'); + } + }, + qingjian:{ + unique:true, + trigger:{player:'gainAfter'}, + direct:true, + filter:function(event){ + if(event.parent.parent.name=='phaseDraw') return false; + return event.cards&&event.cards.length>0 + }, + content:function(){ + "step 0" + event.cards=trigger.cards.slice(0); + "step 1" + player.chooseCardTarget({ + filterCard:function(card){ + return _status.event.parent.cards.contains(card); + }, + selectCard:[1,event.cards.length], + filterTarget:function(card,player,target){ + return player!=target; + }, + ai1:function(card){ + if(ui.selected.cards.length>0) return -1; + return (_status.event.player.num('h')-_status.event.player.hp); + }, + ai2:function(target){ + if(target.num('h')>player.num('h')) return 0; + return ai.get.attitude(_status.event.player,target)-4; + }, + prompt:'请选择要送人的卡牌' + }); + "step 2" + if(result.bool){ + player.logSkill('qingjian',result.targets); + result.targets[0].gain(result.cards); + player.$give(result.cards.length,result.targets[0]); + for(var i=0;i0; + }, + filterTarget:function(card,player,target){ + return player!=target; + }, + filterCard:true, + check:function(card){ + return 8-ai.get.value(card); + }, + discard:false, + prepare:function(cards,player,targets){ + player.$give(1,targets[0]); + }, + content:function(){ + "step 0" + target.storage.refanjian=cards[0]; + target.gain(cards[0]); + "step 1" + target.chooseControl('refanjian_card','refanjian_hp').ai=function(event,player){ + var cards=target.get('he',{suit:get.suit(player.storage.refanjian)}); + if(cards.length==1) return 0; + if(cards.length==2){ + for(var i=0;i=8) return 1; + } + if(cards.length>2&&player.hp>2) return 1; + if(cards.length>3) return 1; + return 0; + } + "step 2" + if(result.control=='refanjian_card'){ + target.showHandcards(); + } + else{ + target.loseHp(); + event.finish(); + } + "step 3" + target.discard(target.get('he',{suit:get.suit(target.storage.refanjian)})) + }, + ai:{ + order:9, + result:{ + target:function(player,target){ + return -target.num('he'); + } + }, + threaten:2, + } + }, + reqianxun:{ + init:function(player){ + player.storage.reqianxun2=[]; + }, + trigger:{target:'useCardToBegin',player:'judgeAfter'}, + filter:function(event,player){ + if(player.num('h')==0) return false; + if(event.parent.name=='phaseJudge'){ + return event.result.judge!=0; + } + if(event.name=='judge') return false; + if(event.targets&&event.targets.length>1) return false; + if(event.card&&get.type(event.card)=='trick'&&event.player!=player) return true; + }, + content:function(){ + player.storage.reqianxun2=player.storage.reqianxun2.concat(player.get('h')); + player.lose(player.get('h'),ui.special); + player.addSkill('reqianxun2'); + }, + ai:{ + effect:function(card,player,target){ + if(get.type(card,'trick')=='trick'&&ui.selected.targets.length==0) return [1,1]; + }, + }, + }, + reqianxun2:{ + trigger:{global:'phaseAfter'}, + forced:true, + content:function(){ + player.gain(player.storage.reqianxun2); + player.removeSkill('reqianxun2'); + player.storage.reqianxun2=[]; + }, + mark:true, + intro:{ + content:'cardCount' + } + }, + relianying:{ + trigger:{player:'loseEnd'}, + direct:true, + filter:function(event,player){ + if(player.num('h')) return false; + for(var i=0;i0){ + return att+Math.max(0,5-target.num('h')); + } + return att; + } + } + else{ + player.chooseBool('是否弃置'+get.translation(event.card)+'?'); + event.disbool=true; + } + game.delay(2); + "step 1" + if(event.disbool){ + if(!result.bool){ + game.log(get.translation(player)+'展示了'+get.translation(event.card)); + ui.cardPile.insertBefore(event.card,ui.cardPile.firstChild); + } + else{ + game.log(get.translation(player)+'展示并弃掉了'+get.translation(event.card)); + ui.discardPile.appendChild(event.card); + } + } + else if(result.targets){ + result.targets[0].gain(event.card); + event.node.moveTo(result.targets[0]); + game.log(get.translation(result.targets[0])+'获得了'+get.translation(event.card)); + } + else{ + game.log(get.translation(player)+'展示并弃掉了'+get.translation(event.card)); + ui.discardPile.appendChild(event.card); + } + event.node.delete(); + }, + ai:{ + effect:{ + target:function(card,player){ + if(get.tag(card,'respond')&&player.num('h')>1) return [1,0.2]; + } + } + } + }, + rejianxiong:{ + trigger:{player:'damageEnd'}, + direct:true, + content:function(){ + "step 0" + if(get.itemtype(trigger.cards)=='cards'&&get.position(trigger.cards[0])=='d'){ + player.chooseControl('rejianxiong_mopai','rejianxiong_napai','cancel').ai=function(){ + if(trigger.cards.length==1&&trigger.cards[0].name=='sha') return 0; + return 1; + }; + } + else{ + player.chooseControl('rejianxiong_mopai','cancel'); + } + "step 1" + if(result.control=='rejianxiong_napai'){ + player.logSkill('rejianxiong'); + player.gain(trigger.cards); + player.$gain2(trigger.cards); + } + else if(result.control=='rejianxiong_mopai'){ + player.logSkill('rejianxiong'); + player.draw(); + } + }, + ai:{ + maixie:true, + effect:{ + target:function(card,player,target){ + if(player.skills.contains('jueqing')) return [1,-1]; + if(get.tag(card,'damage')&&player!=target) return [1,1]; + } + } + } + }, + reyiji:{ + trigger:{player:'damageEnd'}, + frequent:true, + filter:function(event){ + return (event.num>0) + }, + content:function(){ + "step 0" + event.num=1; + event.count=1; + "step 1" + player.gain(get.cards(2)); + player.$draw(2); + "step 2" + player.chooseCardTarget({ + filterCard:true, + selectCard:[1,2], + filterTarget:function(card,player,target){ + return player!=target&&target!=event.temp; + }, + ai1:function(card){ + if(ui.selected.cards.length>0) return -1; + return (_status.event.player.num('h')-_status.event.player.hp); + }, + ai2:function(target){ + return ai.get.attitude(_status.event.player,target)-4; + }, + prompt:'请选择要送人的卡牌' + }); + "step 3" + if(result.bool){ + player.lose(result.cards,ui.special); + if(result.targets[0].skills.contains('reyiji2')){ + result.targets[0].storage.reyiji2=result.targets[0].storage.reyiji2.concat(result.cards); + } + else{ + result.targets[0].addSkill('reyiji2'); + result.targets[0].storage.reyiji2=result.cards; + } + player.$give(result.cards.length,result.targets[0]); + if(num==1){ + event.temp=result.targets[0]; + event.num++; + event.goto(2); + } + else if(event.count=4) return [1,get.tag(card,damage)*2]; + if(target.hp==3) return [1,get.tag(card,damage)*1.5]; + if(target.hp==2) return [1,get.tag(card,damage)*0.5]; + } + } + }, + threaten:0.6 + } + }, + reyiji2:{ + trigger:{player:'phaseDrawBegin'}, + forced:true, + mark:true, + popup:'遗计拿牌', + content:function(){ + player.$draw(player.storage.reyiji2.length); + player.gain(player.storage.reyiji2); + delete player.storage.reyiji2; + player.removeSkill('reyiji2'); + game.delay(); + }, + intro:{ + content:'cardCount' + } + }, + yijue:{ + enable:'phaseUse', + usable:1, + filterTarget:function(card,player,target){ + return player!=target&&target.num('h'); + }, + filter:function(event,player){ + return player.num('h')>0; + }, + content:function(){ + "step 0" + player.chooseToCompare(target).small=true; + "step 1" + if(result.bool){ + if(target.skills.contains('yijue2')==false){ + target.disabledSkills.yijue=[]; + for(var i=0;i0; + }; + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + target.recover(); + } + }, + ai:{ + result:{ + target:function(player,target){ + if(target.num('h')>target.hp+1&&ai.get.recoverEffect(target)>0){ + return 1; + } + if(player.canUse('sha',target)&&(player.num('h','sha')||player.num('he',{color:'red'}))){ + return -2; + } + return -0.5; + } + }, + order:9, + } + }, + yijue2:{ + trigger:{global:'phaseAfter'}, + forced:true, + mark:true, + content:function(){ + delete player.disabledSkills.yijue; + player.removeSkill('yijue2'); + }, + mod:{ + cardEnabled:function(){ + return false; + }, + cardUsable:function(){ + return false; + }, + cardRespondable:function(){ + return false; + }, + cardSavable:function(){ + return false; + } + }, + intro:{ + content:function(st,player){ + var storage=player.disabledSkills.yijue; + if(storage&&storage.length){ + var str='失效技能:'; + for(var i=0;i1; + return 8-ai.get.value(card); + }; + "step 2" + if(!result.bool){ + trigger.directHit=true; + } + } + }, + retieji2:{ + trigger:{global:'phaseAfter'}, + forced:true, + content:function(){ + delete player.disabledSkills.retieji; + player.removeSkill('retieji2'); + }, + mark:true, + intro:{ + content:function(st,player){ + var storage=player.disabledSkills.retieji; + if(storage&&storage.length){ + var str='失效技能:'; + for(var i=0;i2) return current-1; + }, + globalTo:function(from,to,current){ + if(to.hp<=2) return current+1; + }, + }, + ai:{ + threaten:0.8 + } + }, + qiaomeng:{ + trigger:{source:'damageEnd'}, + direct:true, + filter:function(event){ + return event.card&&event.card.name=='sha'&&event.cards&& + get.color(event.cards)=='black'&&event.player.num('e'); + }, + content:function(){ + "step 0" + player.choosePlayerCard('e',trigger.player); + "step 1" + if(result.bool){ + player.logSkill('qiaomeng'); + trigger.player.discard(result.links[0]); + event.card=result.links[0]; + } + else{ + event.finish(); + } + "step 2" + if(get.position(card)=='d'){ + if(get.subtype(card)=='equip3'||get.subtype(card)=='equip4'){ + player.gain(card); + player.$gain2(card); + } + } + } + }, + rekurou:{ + enable:'phaseUse', + usable:1, + filterCard:true, + check:function(card){ + return 9-ai.get.value(card); + }, + position:'he', + content:function(){ + player.loseHp(); + }, + ai:{ + order:9, + result:{ + player:function(player){ + if(player.hp<=2) return 0; + if(player.num('h')+1=4){ + player.loseMaxHp(); + } + } + }, + jianyan:{ + enable:'phaseUse', + usable:1, + content:function(){ + "step 0" + player.chooseControl(['red','black'].concat(get.types())).ai=function(){ + if(player.num('shan')==0) return 'basic'; + if(player.num('e')<=1) return 'equip'; + if(player.num('h')>2) return 'trick'; + return 'red'; + }; + "step 1" + var num=20; + var card; + event.cards=[]; + while(num--){ + card=get.cards(0); + event.cards.push(card); + if(get.color(card)==result.control) break; + else if(get.type(card,'trick')==result.control) break; + } + event.card=card; + player.showCards(event.cards); + player.chooseTarget(true,'选择一名男性角色送出'+get.translation(event.card),function(card,player,target){ + return target.sex=='male'; + }); + "step 2" + result.targets[0].$gain(event.card); + for(var i=0;i0; + }, + prepare:function(cards,player,targets){ + player.$throw(cards); + }, + position:'he', + filterCard:{suit:'diamond'}, + filterTarget:function(card,player,target){ + if(player!=target) return lib.filter.targetEnabled({name:'lebu'},player,target); + return target.num('j','lebu'); + }, + check:function(card){ + return 7-ai.get.value(card); + }, + content:function(){ + if(target.num('j','lebu')){ + target.discard(target.get('j','lebu',0)); + } + else{ + target.addJudge('lebu',cards); + } + player.draw(); + }, + ai:{ + result:{ + target:function(player,target){ + if(target.num('j','lebu')) return -ai.get.effect(target,{name:'lebu'},player,target); + return ai.get.effect(target,{name:'lebu'},player,target); + } + }, + order:9, + } + }, + fenwei:{ + unique:true, + mark:true, + trigger:{global:'useCard'}, + priority:5, + filter:function(event,player){ + if(get.info(event.card).multitarget) return false; + if(event.targets.length<2) return false; + if(player.storage.fenwei) return false; + return true; + }, + init:function(player){ + player.storage.fenwei=false; + }, + direct:true, + content:function(){ + "step 0" + player.chooseTarget('选择令'+get.translation(trigger.card)+'无效的目标', + [1,trigger.targets.length],function(card,player,target){ + return trigger.targets.contains(target); + }).ai=function(target){ + if(game.phaseNumber>game.players.length*2&&trigger.targets.length>=game.players.length-1){ + return -ai.get.effect(target,trigger.card,trigger.player,player); + } + return -1; + }; + "step 1" + if(result.bool){ + player.unmarkSkill('fenwei'); + player.logSkill('fenwei',result.targets); + player.storage.fenwei=true; + for(var i=0;i0; + }, + filterCard:true, + position:'he', + selectTarget:[1,Infinity], + check:function(card){ + if(get.suit(card)=='spade') return 8-ai.get.value(card); + return 5-ai.get.value(card); + }, + content:function(){ + "step 0" + if(num==0&&get.suit(cards[0])=='spade') player.draw(); + player.choosePlayerCard(targets[num],'he',true); + "step 1" + if(result.bool){ + if(result.links.length) targets[num].discard(result.links[0]); + if(get.suit(result.links[0])=='spade') targets[num].draw(); + } + }, + ai:{ + result:{ + target:-1 + }, + threaten:1.2, + order:3 + } + }, + xunxun:{ + trigger:{player:'phaseDrawBefore'}, + frequent:true, + content:function(){ + "step 0" + event.cards=get.cards(4); + player.chooseCardButton(event.cards,2,true,'选择获得两张牌').ai=ai.get.buttonValue; + trigger.untrigger(); + trigger.finish(); + "step 1" + var choice=[]; + for(var i=0;i-3; + return ai.get.attitude(player,event.player)>-3; + }, + content:function(){ + "step 0" + game.asyncDraw([trigger.player,trigger.source],trigger.num); + "step 1" + game.delay(); + } + } + }, + translate:{ + re_zhangliao:'张辽', + re_huangyueying:'黄月英', + re_simayi:'司马懿', + re_xuzhu:'许褚', + re_xiahoudun:'夏侯惇', + re_lvmeng:'吕蒙', + re_zhouyu:'周瑜', + re_luxun:'陆逊', + re_zhaoyun:'赵云', + re_guanyu:'关羽', + re_zhangfei:'张飞', + re_machao:'马超', + re_caocao:'曹操', + re_guojia:'郭嘉', + re_lvbu:'吕布', + re_xushu:'徐庶', + re_huanggai:'黄盖', + re_gongsunzan:'公孙瓒', + re_daqiao:'大乔', + re_ganning:'甘宁', + re_huatuo:'华佗', + re_lidian:'李典', + qinxue:'勤学', + retuxi:'突袭·新', + reluoyi:'裸衣·新', + reluoyi2:'裸衣·新', + reganglie:'刚烈·新', + qingjian:'清俭', + reyingzi:'英姿·新', + refanjian:'反间·新', + refanjian_card:'弃牌', + refanjian_hp:'流失体力', + reqianxun:'谦逊·新', + reqianxun2:'谦逊·新', + relianying:'连营·新', + retishen:'替身', + retishen2:'替身', + reyajiao:'涯角', + rejianxiong:'奸雄·新', + rejianxiong_mopai:'摸牌', + rejianxiong_napai:'拿牌', + reyiji:'遗计·新', + reyiji2:'遗计·新', + yijue:'义绝', + yijue2:'义绝', + retieji:'铁骑·新', + retieji2:'铁骑·新', + refankui:'反馈·新', + reyicong:'义从', + qiaomeng:'趫猛', + rekurou:'苦肉·新', + zhaxiang:'诈降', + zhaxiang2:'诈降', + zhuhai:'诛害', + qianxin:'潜心', + jianyan:'荐言', + reguicai:'鬼才·新', + xunxun:'恂恂', + wangxi:'忘隙', + reguose:'国色·新', + fenwei:'奋威', + chulao:'除痨', + rejizhi:'集智', +// rejizhi_info:'当你使用一张装备牌或锦囊牌时,你可以展示牌堆顶牌,若该牌为基本牌,将之置入弃牌堆或用一张手牌与之交换;若不为基本牌,则将之收入手牌。', + rejizhi_info:'当你使用一张装备牌或锦囊牌时,你可以摸一张牌并展示之,若此牌是基本牌,你须弃置一张手牌', + xunxun_info:'摸牌阶段,你可以放弃摸牌,改为观看牌堆顶的四张牌,然后获得其中的两张牌,将其余的牌以任意顺序置于牌堆底。', + wangxi_info:'每当你对其他角色造成1点伤害后,或受到其他角色造成的1点伤害后,你可与该角色各摸一张牌。', + reguose_info:'出牌阶段限一次,你可以选择一项:将一张方片花色牌当做【乐不思蜀】使用;或弃置一张方片花色牌并弃置场上的一张【乐不思蜀】。选择完成后,你摸一张牌。', + fenwei_info:'当一名角色使用的锦囊牌指定了至少两名角色为目标时,你可以令此牌对其中任意名角色无效。', + chulao_info:'出牌阶段限一次,若你有牌,你可以选择任意名势力各不相同的其他角色,你弃置你和这些角色的各一张牌。然后以此法弃置黑桃牌的角色各摸一张牌。', + reguicai_info:'在任意角色的判定牌生效前,你可以打出一张牌代替之', + zhuhai_info:'一名其他角色的结束阶段开始时,若该角色本回合造成过伤害,你可以对其使用一张【杀】。', + qianxin_info:'觉醒技,当你造成一次伤害后,若你已受伤,你须减1点体力上限,并获得技能“荐言”。', + jianyan_info:'出牌阶段限一次,你可以声明一种牌的类别或颜色,然后连续亮出牌堆顶的牌,直到亮出符合你声明的牌为止,选择一名男性角色,该角色获得此牌,再将其余以此法亮出的牌置入弃牌堆。', + rekurou_info:'出牌阶段限一次,你可以弃置一张牌,然后失去1点体力。', + zhaxiang_info:'锁定技 每当你失去1点体力后,你摸三张牌。然后若此时是你的出牌阶段,则直到回合结束,你使用红色【杀】无距离限制且不能被【闪】响应,你可以额外使用一张【杀】。', + qiaomeng_info:'每当你使用黑色【杀】对一名角色造成伤害后,你可以弃置该角色装备区里的一张牌,若此牌是坐骑牌,你于此牌置入弃牌堆时获得之。', + reyicong_info:'锁定技,只要你的体力值大于2点,你计算与其他角色的距离时,始终-1;只要你的体力值为2点或更低,其他角色计算与你的距离时,始终+1。', + refankui_info:'每当你受到1点伤害后,你可以获得伤害来源的一张牌。', + retieji_info:'当你使用【杀】指定一名角色为目标后,你可以进行一次判定并令该角色的非锁定技失效直到回合结束,除非该角色弃置一张与判定结果花色相同的牌,否则不能使用【闪】抵消此【杀】。', + yijue_info:'出牌阶段限一次,你可以与一名其他角色拼点,若你赢,则直到回合结束,该角色不能使用或打出手牌且其非锁定技失效,若你没赢,你可令该角色回复一点体力。', + reyiji_info:'每当你受到1点伤害后,你可以摸两张牌。然后你可以在至多两名角色的武将牌旁边分别扣置至多两张手牌,这些角色的下个摸牌阶段开始时,该角色获得其武将牌旁的这些牌。', + rejianxiong_info:'每当你受到伤害后,你可以选择一项:摸一张牌,或获得对你造成伤害的牌。', + reyajiao_info:'每当你于回合外使用或打出一张手牌时,你可以亮出牌堆顶的一张牌,若此牌与你此次使用或打出的牌类别相同,你可以将之交给任意一名角色;若不同则你可以将之置入弃牌堆。', + retishen_info:'限定技,准备阶段开始时,你可以将体力回复至等同于你上回合结束时的体力值,然后你每以此法回复1点体力,便摸一张牌。', + reqianxun_info:'每当一张延时类锦囊牌或其他角色使用的非延时类锦囊牌生效时,若你是此牌的唯一目标,你可以将所有手牌置于你的武将牌上,若如此做,此回合结束时,你获得你武将牌上的所有牌。', + relianying_info:'当你失去最后的手牌时,你可以令至多X名角色各摸一张牌(X为你此次失去的手牌数)。', + reyingzi_info:'锁定技,摸牌阶段摸牌时,你额外摸一张牌;你的手牌上限不会因体力值的减少而减少。', + refanjian_info:'出牌阶段限一次,你可以展示一张手牌并将此牌交给一名其他角色。然后该角色选择一项:展示其手牌并弃置所有与此牌花色相同的牌,或是去一点体力。', + qingjian_info:'每当你于摸牌阶段外获得牌时,你可以将其中任意牌以任意顺序交给其他角色', + qinxue_info:'觉醒技,准备阶段开始时,若你的手牌数比体力值多3(人数不少于7时改为2)或更多,你须减一点体力上限并获得技能【攻心】', + retuxi_info:'摸牌阶段摸牌时,你可以少摸任意张牌,然后选择等量的手牌数大于或等于你的其他角色,获得这些角色的各一张手牌。', + reluoyi_info:'你可以跳过摸牌阶段,然后展示牌堆顶的三张牌,获得其中的基本牌、武器牌和【决斗】,若如此做,直到你的下回合开始,你为伤害来源的【杀】或【决斗】造成的伤害+1。', + reganglie_info:'每当你受到1点伤害后,可进行一次判定,若结果为红色,你对伤害来源造成1点伤害,若结果为黑色,你弃置其一张牌。' + }, +} diff --git a/character/sp.js b/character/sp.js new file mode 100644 index 000000000..8b0392394 --- /dev/null +++ b/character/sp.js @@ -0,0 +1,2755 @@ +character.sp={ + character:{ + yangxiu:['male','wei',3,['jilei','danlao'],['fullskin']], + chenlin:['male','wei',3,['bifa','songci'],['fullskin']], + caohong:['male','wei',4,['yuanhu'],['fullskin']], + xiahouba:['male','shu',4,['baobian'],['fullskin']], + gongsunzan:['male','qun',4,['yicong'],['fullskin']], + yuanshu:['male','qun',4,['yongsi'],['fullskin']], + sp_diaochan:['female','qun',3,['lihun','biyue'],['fullskin']], + sp_zhaoyun:['male','qun',3,['longdan','chongzhen'],['fullskin']], + jsp_zhaoyun:['male','qun',3,['chixin','yicong','suiren'],['fullskin']], + liuxie:['male','qun',3,['tianming','mizhao'],['fullskin']], + zhugejin:['male','wu',3,['hongyuan','huanshi','mingzhe'],['fullskin']], + zhugeke:['male','wu',3,['aocai','duwu'],['fullskin']], + guanyinping:['female','shu',3,['huxiao','xueji','wuji'],['fullskin']], + simalang:['male','wei',3,['junbing','quji'],['fullskin']], + zhangxingcai:['female','shu',3,['shenxian','qiangwu'],['fullskin']], + fuwan:['male','qun',4,['moukui'],['fullskin']], + sp_sunshangxiang:['female','shu',3,['liangzhu','xiaoji'],['fullskin']], + caoang:['male','wei',4,['kaikang'],['fullskin']], + re_yuanshu:['male','qun',4,['wangzun','tongji'],['fullskin']], + sp_caoren:['male','wei',4,['kuiwei','yanzheng'],['fullskin']], + zhangbao:['male','qun',3,['zhoufu','yingbin'],['fullskin']], + maliang:['male','shu',3,['xiemu','naman'],['fullskin']], + sp_pangtong:['male','qun',3,['manjuan','zuixiang'],['fullskin']], + zhugedan:['male','wei',4,['gongao','juyi'],['fullskin']], + sp_jiangwei:['male','shu',4,['kunfen','fengliang'],['fullskin']], + sp_machao:['male','qun',4,['zhuiji','cihuai'],['fullskin']], + sunhao:['male','wu',5,['canshi','chouhai'],['fullskin']], + }, + skill:{ + canshi:{ + trigger:{player:'phaseDrawBefore'}, + check:function(event,player){ + var num=0; + for(var i=0;i3) return true; + } + } + return false; + }, + prompt:function(){ + var num=0; + for(var i=0;i0){ + player.draw(num); + } + player.addTempSkill('canshi2','phaseAfter'); + } + }, + canshi2:{ + trigger:{player:'useCard'}, + forced:true, + filter:function(event,player){ + if(player.num('he')==0) return false; + var type=get.type(event.card,'trick'); + return type=='basic'||type=='trick'; + }, + content:function(){ + game.delay(0.5); + player.chooseToDiscard(true,'he'); + } + }, + chouhai:{ + trigger:{player:'damageBegin'}, + forced:true, + filter:function(event,player){ + return player.num('h')==0; + }, + content:function(){ + trigger.num++; + }, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(get.tag(card,'damage')&&target.num('h')==0) return [1,-2]; + } + } + } + }, + kunfen:{ + trigger:{player:'phaseEnd'}, + direct:true, + check:function(event,player){ + if(player.hp>2) return true; + if(player.hp==2&&player.num('h')==0) return true; + return false; + }, + content:function(){ + "step 0" + if(player.storage.kunfen){ + player.chooseBool('是否发动【困奋】?').ai=function(){ + if(player.hp>3) return true; + if(player.hp==3&&player.num('h')<3) return true; + if(player.hp==2&&player.num('h')==0) return true; + return false; + } + } + else{ + event.forced=true; + } + "step 1" + if(event.forced||result.bool){ + player.logSkill('kunfen'); + player.loseHp(); + } + else{ + event.finish(); + } + "step 2" + player.draw(2); + }, + ai:{ + threaten:1.5 + } + }, + fengliang:{ + unique:true, + trigger:{player:'dying'}, + priority:10, + forced:true, + filter:function(event,player){ + return !player.storage.kunfen; + }, + content:function(){ + "step 0" + player.loseMaxHp(); + "step 1" + if(player.hp<2){ + player.recover(2-player.hp); + } + "step 2" + player.addSkill('tiaoxin'); + player.storage.kunfen=true; + }, + }, + zhuiji:{ + mod:{ + globalFrom:function(from,to){ + if(from.hp>to.hp) return -Infinity; + } + } + }, + cihuai:{ + trigger:{player:'phaseUseBegin'}, + direct:true, + filter:function(event,player){ + return player.num('h','sha')==0; + }, + content:function(){ + "step 0" + player.chooseTarget('是否发动【刺槐】?',function(card,player,target){ + return player.canUse({name:'sha'},target); + }).ai=function(target){ + return ai.get.effect(target,{name:'sha'},player,player); + } + "step 1" + if(result.bool){ + player.logSkill('cihuai'); + player.showHandcards(); + player.useCard({name:'sha'},result.targets); + } + }, + ai:{ + expose:0.2, + } + }, + jilei:{ + trigger:{player:'damageEnd'}, + priority:9, + check:function(event,player){ + return ai.get.attitude(player,event.source)<0; + }, + filter:function(event){ + return event&&event.source; + }, + content:function(){ + trigger.source.addSkill('jilei2'); + }, + ai:{ + threaten:0.6 + } + }, + jilei2:{ + unique:true, + trigger:{global:'phaseAfter'}, + forced:true, + priority:10, + mod:{ + cardEnabled:function(){ + return false; + }, + cardUsable:function(){ + return false; + }, + cardRespondable:function(){ + return false; + }, + cardSavable:function(){ + return false; + } + }, + content:function(){ + player.removeSkill('jilei2') + }, + }, + danlao:{ + inherit:'mufeng' + }, + taichen:{ + enable:'phaseUse', + usable:1, + filterTarget:function(card,player,target){ + return player.canUse('sha',target); + }, + content:function(){ + "step 0" + player.loseHp(); + "step 1" + player.useCard({name:'sha'},target,false); + }, + ai:{ + order:1, + result:{ + target:function(player,target){ + if(player.hp>2&&player.hp>target.hp&&target.num('he')<4){ + return ai.get.effect(target,{name:'sha'},player,target); + } + return 0; + } + } + } + }, + manjuan:{ + trigger:{global:'discardAfter'}, + filter:function(event,player){ + if(event.player==player) return false; + if(!player.num('he')) return false; + for(var i=0;imaxval){ + maxval=tempval; + } + } + maxval+=cards.length-1; + player.chooseToDiscard('he',{suit:suits},dialog).ai=function(card){ + return maxval-ai.get.value(card); + }; + event.cards=cards; + } + "step 2" + if(result.bool){ + player.logSkill('manjuan'); + game.log(get.translation(player)+'获得了'+get.translation(event.cards)); + player.gain(event.cards,'gain2'); + } + }, + ai:{ + threaten:1.3 + } + }, + zuixiang:{ + unique:true, + mark:true, + trigger:{player:'phaseBegin'}, + priority:10, + filter:function(event,player){ + if(player.storage.zuixiang) return false; + return true; + }, + check:function(event,player){ + return player.num('h')0; + }, + direct:true, + content:function(){ + "step 0" + player.chooseToDiscard('协穆:是否弃置一张杀并摸两张牌?',{name:'sha'}).ai=function(card){ + return 9-ai.get.value(card); + }; + "step 1" + if(result.bool){ + player.logSkill('xiemu'); + player.draw(2); + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.color(card)=='black'&&target.num('h')>0){ + return [1,0.5]; + } + } + } + } + }, + spmengjin:{ + trigger:{player:'shaBegin'}, + filter:function(event,player){ + return event.target.num('he')>0; + }, + direct:true, + content:function(){ + "step 0" + var att=ai.get.attitude(player,trigger.target); + player.choosePlayerCard('是否发动【猛进】?','he',trigger.target).ai=function(button){ + var val=ai.get.buttonValue(button); + if(att>0) return -val; + return val; + }; + "step 1" + if(result.bool){ + trigger.target.discard(result.links); + player.logSkill('spmengjin',trigger.target); + trigger.target.addTempSkill('mengjin2','shaAfter'); + } + }, + ai:{ + expose:0.2 + } + }, + fenxun:{ + trigger:{player:'shaBefore'}, + direct:true, + filter:function(event,player){ + return event.targets.length==1; + }, + position:'he', + content:function(){ + "step 0" + player.chooseCardTarget({ + filterCard:true, + filterTarget:function(card,player,target){ + return lib.filter.targetEnabled(trigger.card,player,target)&&target!=trigger.targets[0]; + }, + ai1:function(card){ + return 6-ai.get.value(card); + }, + ai2:function(target){ + return ai.get.effect(target,trigger.card,player,player); + }, + prompt:'是否发动【奋迅】?' + }); + "step 1" + if(result.bool){ + player.discard(result.cards); + trigger.targets.push(result.targets[0]); + player.logSkill('fenxun',result.targets); + } + } + }, + zhoufu:{ + enable:'phaseUse', + usable:1, + filterCard:true, + filterTarget:function(card,player,target){ + return player!=target; + }, + content:function(){ + target.$gain2(cards); + target.storage.zhoufu2=cards[0]; + target.addSkill('zhoufu2'); + target.storage.zhoufu3=player; + ui.special.appendChild(cards[0]); + }, + check:function(card){return 3-ai.get.value(card)}, + ai:{ + order:1, + result:{ + player:1 + } + } + }, + zhoufu2:{ + trigger:{player:'judge'}, + forced:true, + priority:10, + mark:'card', + content:function(){ + "step 0" + ui.discardPile.appendChild(player.storage.zhoufu2); + player.$throw(player.storage.zhoufu2); + if(player.storage.zhoufu3.isAlive()&&player.storage.zhoufu3.skills.contains('yingbin')){ + player.storage.zhoufu3.draw(2); + } + "step 1" + player.judging=player.storage.zhoufu2; + trigger.position.appendChild(player.storage.zhoufu2); + // trigger.untrigger(); + game.log(get.translation(player)+'的判定牌改为'+get.translation(player.storage.zhoufu2)); + player.removeSkill('zhoufu2'); + delete player.storage.zhoufu2; + delete player.storage.zhoufu3; + }, + intro:{ + content:'card' + }, + group:'zhoufu3' + }, + zhoufu3:{ + trigger:{player:'phaseEnd'}, + forced:true, + content:function(){ + player.unmark(player.storage.zhoufu2); + if(player.storage.zhoufu3.isAlive()){ + player.storage.zhoufu3.gain(player.storage.zhoufu2); + player.$give(player.storage.zhoufu2,player.storage.zhoufu3); + player.removeSkill('zhoufu2'); + delete player.storage.zhoufu2; + delete player.storage.zhoufu3; + game.delay(); + } + + }, + }, + yingbin:{}, + kuiwei:{ + trigger:{player:'phaseEnd'}, + check:function(event,player){ + if(player.isTurnedOver()) return true; + var num=0; + for(var i=0;i1; + }, + content:function(){ + "step 0" + player.turnOver(); + "step 1" + var num=0; + for(var i=0;i=player.num('he')){ + player.discard(player.get('he')); + } + else if(num){ + player.chooseToDiscard(num,true); + } + player.removeSkill('kuiwei2'); + } + }, + yanzheng:{ + enable:'chooseToUse', + filter:function(event,player){ + return player.hp0; + }, + viewAsFilter:function(player){ + return player.hp0; + }, + filterCard:true, + position:'e', + viewAs:{name:'wuxie'}, + prompt:'将一张装备区内的牌当无懈可击使用', + check:function(card){return 8-ai.get.equipValue(card)}, + threaten:1.2 + }, + tongji:{ + global:'tongji2', + unique:true, + gainnable:true, + }, + tongji2:{ + mod:{ + targetEnabled:function(card,player,target){ + if(player.skills.contains('tongji')) return; + if(card.name=='sha'){ + if(target.skills.contains('tongji')) return; + for(var i=0;i=0; + }, + content:function(){ + "step 0" + player.draw(); + if(trigger.target!=player){ + player.chooseCard(true,'he','交给'+get.translation(trigger.target)+'一张牌').ai=function(card){ + if(card.name=='shan') return 1; + }; + } + else{ + event.finish(); + } + "step 1" + trigger.target.gain(result.cards); + player.$give(result.cards,trigger.target); + game.delay(); + event.card=result.cards[0]; + if(get.type(event.card)!='equip') event.finish(); + "step 2" + trigger.target.chooseBool('是否装备'+get.translation(event.card)+'?').ai=function(){ + var current=trigger.target.get('e',{subtype:get.subtype(event.card)}); + if(current&¤t.length){ + return ai.get.equipValue(event.card)>ai.get.equipValue(current[0]); + } + return true; + }; + "step 3" + if(result.bool){ + trigger.target.equip(event.card); + } + }, + ai:{ + threaten:1.1 + } + }, + liangzhu:{ + trigger:{global:'recoverAfter'}, + check:function(event,player){ + return ai.get.attitude(player,event.player)>=0; + }, + filter:function(event,player){ + return event.player!=player&&_status.currentPhase==event.player; + }, + content:function(){ + "step 0" + trigger.player.draw(); + "step 1" + player.draw(); + }, + ai:{ + expose:0.2 + } + }, + mingshi:{ + trigger:{player:'damageBegin'}, + direct:true, + filter:function(event,player){ + return event.source&&event.source.hp>player.hp; + }, + content:function(){ + "step 0" + player.chooseToDiscard('是否发动【名士】?',{color:'black'}).ai=function(card){ + return 9-ai.get.value(card); + } + "step 1" + if(result.bool){ + trigger.num--; + player.logSkill('mingshi'); + } + }, + ai:{ + threaten:0.8 + } + }, + lirang:{ + trigger:{player:'discardAfter'}, + filter:function(event,player){ + for(var i=0;i0; + }, + content:function(){ + trigger.target.discardPlayerCard(player,true); + } + }, + shenxian:{ + trigger:{global:'discardAfter'}, + filter:function(event,player){ + if(event.player==player||_status.currentPhase==player) return false; + // if(player.num('h')>=5) return false; + for(var i=0;iplayer.storage.qiangwu) return Infinity; + } + }, + group:'qiangwu2' + }, + qiangwu2:{ + trigger:{player:'phaseUseBegin'}, + forced:true, + popup:false, + content:function(){ + delete player.storage.qiangwu; + } + }, + zhendu:{ + trigger:{global:'phaseUseBegin'}, + filter:function(event,player){ + return event.player!=player&&player.num('h')>0; + }, + direct:true, + content:function(){ + "step 0" + var nono=(Math.abs(ai.get.attitude(player,trigger.player))<3); + player.chooseToDiscard('是否发动【鸩毒】?').ai=function(card){ + if(nono) return -1; + if(ai.get.damageEffect(trigger.player,player,player)>0){ + return 7-ai.get.useful(card); + } + return -1; + } + "step 1" + if(result.bool){ + player.logSkill('zhendu'); + trigger.player.damage(); + } + else{ + event.finish(); + } + "step 2" + trigger.player.useCard({name:'jiu'},trigger.player); + }, + ai:{ + threaten:2, + expose:0.3 + } + }, + qiluan:{ + trigger:{source:'dieAfter'}, + forced:true, + priority:-10, + content:function(){ + if(_status.currentPhase!=trigger.player){ + player.addSkill('qiluan2') + } + else{ + player.draw(3); + } + }, + }, + qiluan2:{ + trigger:{global:'phaseAfter'}, + forced:true, + content:function(){ + player.draw(3); + player.removeSkill('qiluan2'); + } + }, + shangyi:{ + enable:'phaseUse', + usable:1, + filterTarget:function(card,player,target){ + return player!=target&&target.num('h'); + }, + content:function(){ + "step 0" + player.chooseCardButton(target,target.get('h')).filterButton=function(button){ + return get.color(button.link)=='black'; + } + "step 1" + if(result.bool){ + target.discard(result.links[0]); + } + }, + ai:{ + order:11, + result:{ + target:function(player,target){ + return -target.num('h'); + } + }, + threaten:1.1 + }, + }, + shengxi:{ + trigger:{player:'phaseUseEnd'}, + frequent:true, + filter:function(event,player){ + return !player.getStat('damage'); + }, + content:function(){ + player.draw(2); + } + }, + shoucheng:{ + trigger:{global:'loseEnd'}, + check:function(event,player){ + return ai.get.attitude(player,event.player)>0; + }, + filter:function(event,player){ + if(event.player.num('h')) return false; + if(_status.currentPhase==event.player) return false; + if(event.player==player) return false; + for(var i=0;i0){ + num+=2; + } + if(num>1) return true; + } + return false; + }, + content:function(){ + "step 0" + var targets=game.players.slice(0); + targets.remove(player); + targets.sort(lib.sort.seat); + event.targets=targets; + event.num=0; + trigger.untrigger(); + trigger.finish(); + "step 1" + if(num1){ + if(game.phaseNumber2) return 0; + if(ai.get.attitude(player,target)<5) return 0; + } + if(ai.get.attitude(player,target)<5) return 0; + if(target.hp==1&&target.maxHp>2) return 0.2; + if(target==game.me) return 1.2; + return 1; + } + }, + expose:0.5, + threaten:1.5 + } + }, + fenming:{ + trigger:{player:'phaseEnd'}, + check:function(event,player){ + var num=0; + for(var i=0;i0; + }, + filter:function(event,player){ + return event.player!=player&&player.num('h',{type:'basic'}); + }, + direct:true, + content:function(){ + "step 0" + var nono=(Math.abs(ai.get.attitude(player,trigger.player))<3); + player.chooseToDiscard('是否发动【骁果】?',{type:'basic'}).ai=function(card){ + if(nono) return 0; + if(ai.get.damageEffect(trigger.player,player,player)>0){ + return 8-ai.get.useful(card); + } + return 0; + } + "step 1" + if(result.bool){ + player.logSkill('xiaoguo',trigger.player); + trigger.player.chooseToDiscard('he',{type:'equip'}).ai=function(card){ + if(trigger.player.hp==1) return 10-ai.get.value(card); + return 9-ai.get.value(card); + } + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + player.draw(); + } + else{ + trigger.player.damage(); + } + }, + ai:{ + expose:0.3, + threaten:1.3 + } + }, + suishi:{ + trigger:{global:'dying'}, + forced:true, + priority:6, + filter:function(event,player){ + return event.player!=player; + }, + content:function(){ + player.draw(); + }, + group:'suishi2' + }, + suishi2:{ + trigger:{global:'dieAfter'}, + forced:true, + check:function(){ + return false; + }, + filter:function(event,player){ + return event.player!=player; + }, + content:function(){ + player.loseHp(); + }, + }, + sijian:{ + trigger:{player:'loseEnd'}, + direct:true, + filter:function(event,player){ + if(player.num('h')) return false; + for(var i=0;i0; + }).ai=function(target){ + return -ai.get.attitude(player,target); + } + "step 1" + if(result.bool){ + player.logSkill('sijian'); + event.target=result.targets[0]; + player.discardPlayerCard(event.target,true); + } + else{ + event.finish(); + } + }, + ai:{ + expose:0.2, + } + }, + quji:{ + enable:'phaseUse', + usable:1, + position:'he', + filterCard:true, + selectCard:function(){ + var player=_status.event.player; + var num=0; + for(var i=0;i1) return false; + for(var i=0;i-1; + if(num==2) return att>0; + return att>1; + } + } + return false; + }, + content:function(){ + "step 0" + player.draw(); + for(var i=0;i=3&&num>=3) return -10; + if(lib.config.mode!='versus'){ + for(var i=0;i=2||target.hp>=target.maxHp-1) return 'draw_card'; + if(target.hp==2&&target.num('h')==0) return 'draw_card'; + return 'recover_hp'; + }); + } + } + else{ + event.finish(); + } + "step 2" + if(result.control=='draw_card'){ + target.draw(2); + } + else{ + target.recover(); + } + }, + ai:{ + expose:0.1 + } + }, + shenzhi:{ + trigger:{player:'phaseBegin'}, + check:function(event,player){ + if(player.hp>2) return false; + var cards=player.get('h'); + if(cards.length3) return false; + for(var i=0;i7||get.tag(cards[i],'recover')>=1) return false; + } + return true; + }, + content:function(){ + "step 0" + var cards=player.get('h'); + event.bool=cards.length>=player.hp; + player.discard(cards); + "step 1" + if(event.bool){ + player.recover(); + } + } + }, + wuji:{ + trigger:{player:'phaseEnd'}, + forced:true, + filter:function(event,player){ + return player.getStat('damage')>=3&&player.skills.contains('huxiao'); + }, + content:function(){ + "step 0" + player.removeSkill('huxiao'); + player.gainMaxHp(); + "step 1" + player.recover(); + } + }, + xueji:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.hp0; + }, + filterTarget:function(card,player,target){ + return player!=target&&get.distance(player,target,'attack')<=1; + }, + selectTarget:function(){ + return [1,_status.event.player.maxHp-_status.event.player.hp]; + }, + position:'he', + filterCard:function(card){ + return get.color(card)=='red'; + }, + check:function(card){ + return 8-ai.get.useful(card); + }, + content:function(){ + "step 0" + target.damage(); + "step 1" + target.draw(); + }, + ai:{ + order:7, + result:{ + target:function(player,target){ + return ai.get.damageEffect(target,player); + } + }, + threaten:function(player,target){ + if(target.hp==1) return 2; + if(target.hp==2) return 1.5; + return 0.5; + }, + maixie:true, + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(target.hp==target.maxHp) return [0,1]; + } + if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0]; + } + } + } + }, + huxiao:{ + trigger:{player:'shaMiss'}, + forced:true, + content:function(){ + player.storage.huxiao++; + }, + check:function(event,player){ + return player.num('h','sha')>0; + }, + mod:{ + cardUsable:function(card,player,num){ + if(card.name=='sha') return num+player.storage.huxiao; + } + }, + group:'huxiao2' + }, + huxiao2:{ + trigger:{player:'phaseUseBegin'}, + forced:true, + popup:false, + silent:true, + content:function(){ + player.storage.huxiao=0; + }, + }, + aocai:{ + trigger:{player:'chooseToRespondBegin'}, + frequent:true, + filter:function(event,player){ + if(event.responded) return false; + return _status.currentPhase!==player; + }, + content:function(){ + "step 0" + var cards=[]; + if(ui.cardPile.childNodes.length<2){ + var discardcards=get.cards(2); + for(var i=0;i1){ + num++; + } + } + } + check=(num>=2); + } + player.chooseTarget('是否发动【弘援】?',[1,2],function(card,player,target){ + return player!=target; + }, + function(target){ + if(!check) return 0; + return ai.get.attitude(_status.event.player,target); + }); + "step 1" + if(result.bool){ + player.logSkill('hongyuan',result.targets); + // for(var i=0;i0; + }, + check:function(event,player){ + if(ai.get.attitude(player,event.player)<=0) return false; + var cards=player.get('he'); + var judge=event.judge(event.player.judging); + for(var i=0;ijudge) return true; + } + return false; + }, + content:function(){ + "step 0" + var target=trigger.player; + var judge=trigger.judge(target.judging); + var attitude=ai.get.attitude(target,player); + target.choosePlayerCard('请选择代替判定的牌','he','visible',true,player).ai=function(button){ + var card=button.link; + var result=trigger.judge(card)-judge; + if(result>0){ + return 20+result; + } + if(result==0){ + if(_status.currentPhase==player) return 0; + if(attitude>=0){ + return get.color(card)=='red'?7:0-ai.get.value(card); + } + else{ + return get.color(card)=='black'?10:0+ai.get.value(card); + } + } + if(attitude>=0){ + return get.color(card)=='red'?0:-10+result; + } + else{ + return get.color(card)=='black'?0:-10+result; + } + }; + "step 1" + if(result.bool){ + event.card=result.buttons[0].link; + player.respond(event.card); + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + if(trigger.player.judging.clone) trigger.player.judging.clone.delete(); + ui.discardPile.appendChild(trigger.player.judging); + trigger.player.judging=event.card; + game.delay(2); + } + }, + ai:{ + tag:{ + rejudge:1, + } + } + }, + mingzhe:{ + trigger:{player:['useCardAfter','respondAfter','discardAfter']}, + frequent:true, + filter:function(event,player){ + if(player==_status.currentPhase) return false; + if(event.cards){ + for(var i=0;i1){ + event.finish(); + } + "step 1" + player.addSkill('duwu2'); + player.loseHp(); + }, + ai:{ + order:2, + result:{ + target:function(player,target){ + return ai.get.damageEffect(target,player); + } + }, + threaten:1.5, + expose:0.3 + } + }, + duwu2:{ + trigger:{player:'phaseBegin'}, + forced:true, + popup:false, + content:function(){ + player.removeSkill('duwu2'); + } + }, + yicong:{ + mod:{ + globalFrom:function(from,to,current){ + if(from.hp>2) return current-1; + }, + globalTo:function(from,to,current){ + if(to.hp<=2) return current+1; + }, + }, + ai:{ + threaten:0.8 + } + }, + yongsi:{ + group:['yongsi1','yongsi2'], + ai:{ + threaten:2.2 + } + }, + yongsi1:{ + trigger:{player:'phaseDrawBegin'}, + forced:true, + content:function(){ + var list=['wei','shu','wu','qun'],num=0; + for(var i=0;itarget.hp){ + target.chooseToDiscard(2,'he',true); + } + else{ + target.draw(2); + } + target.storage.songci=true; + target.mark('songci',{ + name:'颂词', + content:'已发动' + }); + }, + ai:{ + order:7, + threaten:1.5, + result:{ + target:function(player,target){ + if(target.num('h')target.hp){ + if(target.num('h')<=3) return -1; + } + } + } + } + }, + baobian:{ + trigger:{player:['phaseBefore','changeHp']}, + forced:true, + popup:false, + unique:true, + content:function(){ + if(!player.storage.baobian){ + player.storage.baobian=[]; + if(player.skills.contains('tiaoxin')){ + player.storage.baobian.push('tiaoxin'); + } + if(player.skills.contains('paoxiao')){ + player.storage.baobian.push('paoxiao'); + } + if(player.skills.contains('shensu')){ + player.storage.baobian.push('shensu'); + } + } + if(player.storage.baobian.contains('tiaoxin')==false){ + player.removeSkill('tiaoxin'); + } + if(player.storage.baobian.contains('paoxiao')==false){ + player.removeSkill('paoxiao'); + } + if(player.storage.baobian.contains('shensu')==false){ + player.removeSkill('shensu'); + } + if(player.hp<=3){ + player.addSkill('tiaoxin'); + } + if(player.hp<=2){ + player.addSkill('paoxiao'); + } + if(player.hp==1){ + player.addSkill('shensu'); + } + }, + ai:{ + maixie:true, + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(target.hp>=4) return [0,1]; + } + if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0]; + } + } + } + }, + chongzhen:{ + group:['chongzhen1','chongzhen2'], + ai:{ + mingzhi:false, + effect:{ + target:function(card,player,target,current){ + if(get.tag(card,'respondShan')||get.tag(card,'respondSha')){ + if(ai.get.attitude(target,player)<=0){ + if(current>0) return; + if(target.num('h')==0) return 1.6; + if(target.num('h')==1) return 1.2; + if(target.num('h')==2) return [0.8,0.5,0,-0.5]; + return [0.4,0.7,0,-0.7]; + } + } + }, + }, + } + }, + chongzhen1:{ + trigger:{player:'shaBefore'}, + filter:function(event,player){ + if(event.skill!='longdan1') return false; + return event.target.num('h')>0; + }, + content:function(){ + player.gain(trigger.target.get('h').randomGet()); + trigger.target.$give(1,player); + game.delay(); + } + }, + chongzhen2:{ + trigger:{player:'respond'}, + filter:function(event,player){ + if(event.skill!='longdan2'&&event.skill!='longdan1') return false; + return event.source&&event.source.num('h')>0; + }, + content:function(){ + player.gain(trigger.source.get('h').randomGet()); + trigger.source.$give(1,player); + game.delay(); + } + }, + lihun:{ + enable:'phaseUse', + usable:1, + filterTarget:function(card,player,target){ + return player!=target&&target.sex=='male'; + }, + filterCard:true, + position:'he', + content:function(){ + player.gain(target.get('h')); + target.$give(target.num('h'),player); + player.turnOver(); + player.addSkill('lihun2'); + player.storage.lihun=target; + }, + check:function(card){return 8-ai.get.value(card)}, + ai:{ + order:10, + result:{ + player:function(player){ + if(player.classList.contains('turnedover')) return 10; + return 0; + }, + target:function(player,target){ + if(target.num('h')>target.hp) return target.hp-target.num('h'); + return 0; + } + }, + threaten:1.5, + effect:{ + target:function(card){ + if(card.name=='guiyoujie') return [0,2]; + } + } + }, + }, + lihun2:{ + trigger:{player:'phaseUseEnd'}, + forced:true, + popup:false, + content:function(){ + "step 0" + player.removeSkill('lihun2'); + if(player.storage.lihun.classList.contains('dead')){ + event.finish(); + } + else{ + player.chooseCard('he',true,player.storage.lihun.hp); + } + "step 1" + player.storage.lihun.gain(result.cards); + player.$give(result.cards.length,player.storage.lihun); + } + }, + yuanhu:{ + trigger:{player:'phaseEnd'}, + direct:true, + filter:function(event,player){ + return player.num('he',{type:'equip'})>0; + }, + content:function(){ + "step 0" + player.chooseCardTarget({ + filterCard:function(card){ + return get.type(card)=='equip'; + }, + position:'he', + filterTarget:function(card,player,target){ + return !target.get('e',get.subtype(card)[5]); + }, + ai1:function(card){ + return 6-ai.get.value(card); + }, + ai2:function(target){ + return ai.get.attitude(player,target)-3; + }, + prompt:'是否发动援护?' + }); + "step 1" + if(result.bool){ + player.logSkill('yuanhu',result.targets); + var thisTarget=result.targets[0]; + var thisCard=result.cards[0]; + thisTarget.equip(thisCard); + event.target=thisTarget; + if(thisTarget!=player){ + player.$give(thisCard,thisTarget); + } + switch(get.subtype(thisCard)){ + case 'equip1': + for(var i=0;i0&&target.num('j')){ + return attitude; + } + return -attitude; + };return; + case 'equip2':thisTarget.draw();event.finish();return; + default:thisTarget.recover();event.finish();return; + } + } + else{ + event.finish(); + } + "step 2" + if(result.targets.length){ + player.discardPlayerCard(true,result.targets[0],'hej'); + } + }, + ai:{ + threaten:1.2 + } + }, + tianming:{ + trigger:{target:'shaBegin'}, + check:function(event,player){ + var cards=player.get('h'); + if(cards.length<=2){ + for(var i=0;iplayers[1].hp&&players[0]!=player){ + players[0].chooseBool('是否发动天命?'); + event.player=players[0]; + } + else{ + event.finish(); + } + "step 1" + if(result.bool){ + player.chooseToDiscard(2,true,'he'); + player.draw(2); + } + }, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(card.name=='sha') return [1,0.5]; + } + } + } + }, + mizhao:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.num('h')>0; + }, + filterCard:true, + selectCard:-1, + filterTarget:function(card,player,target){ + return player!=target; + }, + discard:false, + prepare:function(cards,player,targets){ + player.$give(cards.length,targets[0]); + }, + ai:{ + order:1, + result:{ + player:0, + target:function(player,target){ + if(player.num('h')>1){ + return 1; + } + return -2/(target.num('h')+1); + } + } + }, + content:function(){ + "step 0" + event.target1=targets[0]; + targets[0].gain(cards); + game.delay(2); + for(var i=0;igame.players.length&&player.hp0){ + player.draw(num); + } + player.addSkill('benghuai'); + player.addSkill('weizhong'); + player.storage.juyi=true; + } + }, + weizhong:{ + trigger:{player:['gainMaxHpEnd','loseMaxHpEnd']}, + forced:true, + content:function(){ + player.draw(); + } + }, + chixin:{ + group:['chixin1','chixin2'], + mod:{ + cardUsable:function(card,player,num){ + if(card.name=='sha'){ + return num+20; + } + }, + }, + trigger:{player:'shaBefore'}, + forced:true, + check:function(event,player){ + return player.num('h','sha')>0; + }, + filter:function(event,player){ + return _status.currentPhase==player; + }, + content:function(){ + var target=trigger.target; + if(target.skills.contains('chixin3')){ + target.storage.chixin++; + } + else{ + target.storage.chixin=1; + target.addTempSkill('chixin3','phaseUseEnd'); + } + } + }, + chixin1:{ + enable:['chooseToRespond','chooseToUse'], + filterCard:{suit:'diamond'}, + position:'he', + viewAs:{name:'sha'}, + prompt:'将一张♦牌当杀使用或打出', + check:function(card){return 5-ai.get.value(card)}, + ai:{ + respondSha:true, + } + }, + chixin2:{ + enable:['chooseToRespond'], + filterCard:{suit:'diamond'}, + viewAs:{name:'shan'}, + position:'he', + prompt:'将一张♦牌当闪打出', + check:function(card){return 5-ai.get.value(card)}, + ai:{ + respondShan:true, + effect:{ + target:function(card,player,target,current){ + if(get.tag(card,'respondShan')&¤t<0) return 0.8 + } + }, + } + }, + chixin3:{ + mod:{ + targetEnabled:function(card,player,target){ + if(card.name!='sha') return; + if(player==_status.currentPhase&&player.get('s').contains('chixin')){ + var num=game.checkMod(card,player,1,'cardUsable',player.get('s'))-20; + for(var i=0;i1; + } + } + } + }, + suiren:{ + trigger:{player:'phaseBegin'}, + check:function(event,player){ + return player.hp==1||(player.hp==2&&player.num('h')<=1); + }, + direct:true, + content:function(){ + "step 0" + var check=(player.hp==1||(player.hp==2&&player.num('h')<=1)); + player.chooseTarget('是否发动【随仁】?').ai=function(target){ + if(!check) return 0; + return ai.get.attitude(player,target); + } + "step 1" + if(result.bool){ + player.logSkill('suiren',result.targets); + player.removeSkill('yicong'); + player.gainMaxHp(); + player.recover(); + result.targets[0].draw(3); + } + } + } + }, + translate:{ + chenlin:'陈琳', + yuanshu:'袁术', + re_yuanshu:'袁术', + gongsunzan:'公孙瓒', + sp_diaochan:'貂蝉', + yangxiu:'杨修', + sp_zhaoyun:'赵云', + jsp_zhaoyun:'赵云', + caohong:'曹洪', + liuxie:'刘协', + xiahouba:'夏侯霸', + zhugejin:'诸葛谨', + zhugeke:'诸葛恪', + guanyinping:'关银屏', + ganfuren:'甘夫人', + sunhao:'孙皓', + chengyu:'程昱', + simalang:'司马朗', + tianfeng:'田丰', + sp_pangtong:'庞统', + maliang:'马良', + sp_caoren:'曹仁', + yuejin:'乐进', + mifuren:'糜夫人', + sp_dongzhuo:'董卓', + chendong:'陈武董袭', + jiangfei:'蒋琬费祎', + jiangqing:'蒋钦', + hetaihou:'何太后', + dingfeng:'丁奉', + zhangxingcai:'张星彩', + caoang:'曹昂', + kongrong:'孔融', + fuwan:'伏完', + sp_pangde:'庞德', + sp_sunshangxiang:'孙尚香', + zhugedan:'诸葛诞', + sp_machao:'马超', + sp_jiangwei:'姜维', + zhangbao:'张宝', + yangxiou:'杨修', + yicong:'义从', + mateng:'马腾', + yongsi:'庸肆', + yongsi1:'庸肆', + yongsi2:'庸肆', + bifa:'笔伐', + bifa2:'笔伐', + songci:'颂词', + baobian:'豹变', + lihun:'离魂', + chongzhen:'冲阵', + chongzhen1:'冲阵', + chongzhen2:'冲阵', + yuanhu:'援护', + tianming:'天命', + mizhao:'密诏', + duwu:'黩武', + mingzhe:'明哲', + huanshi:'缓释', + hongyuan:'弘援', + aocai:'傲才', + aocai2:'傲才', + aocai3:'傲才', + huxiao:'虎啸', + xueji:'血祭', + wuji:'武继', + shushen:'淑慎', + shenzhi:'神智', + xiongyi:'雄异', + shefu:'设伏', + junbing:'郡兵', + junbing2:'郡兵', + quji:'去疾', + sijian:'死谏', + suishi:'随势', + suishi2:'随势', + xiaoguo:'骁果', + duanxie:'断绁', + fenming:'奋命', + guixiu:'闺秀', + cunsi:'存嗣', + yongjue:'勇决', + hengzheng:'横征', + shengxi:'生息', + shoucheng:'守成', + shangyi:'尚义', + zhendu:'鸩毒', + qiluan:'戚乱', + qiluan2:'戚乱', + qiluan3:'戚乱', + shenxian:'甚贤', + qiangwu:'枪舞', + moukui:'谋溃', + moukui2:'谋溃', + lirang:'礼让', + mingshi:'名士', + liangzhu:'良助', + kaikang:'慷忾', + wangzun:'妄尊', + tongji:'同疾', + kuiwei:'溃围', + kuiwei2:'溃围', + yanzheng:'严整', + zhoufu:'咒缚', + zhoufu2:'咒缚', + zhoufu3:'咒缚', + yingbin:'影兵', + fenxun:'奋迅', + spmengjin:'猛进', + xiemu:'协穆', + naman:'纳蛮', + zuixiang:'醉乡', + manjuan:'漫卷', + taichen:'抬榇', + jilei:'鸡肋', + jilei2:'鸡肋', + jilei_info:'每当你受到一次伤害,可以令伤害来源不能使用或打出其手牌直到回合结束', + danlao:'啖酪', + gongao:'功獒', + zhuiji:'追击', + chouhai:'仇海', + chouhai_info:'锁定技,当你每次受到伤害时,若你没有手牌,此伤害+1。', + guiming:'归命', + guiming_info:'主公技,其他吴势力角色于你的回合内视为已受伤的角色。', + chixin:'赤心', + chixin1:'赤杀', + chixin2:'赤闪', + chixin_info:'你可以将♦牌当【杀】或【闪】使用或打出。出牌阶段,你对你攻击范围内的每名角色均可使用一张【杀】。', + suiren:'随仁', + suiren_info:'限定技,准备阶段开始时,你可以失去技能“义从”,然后加1点体力上限并回复1点体力,再令一名角色摸三张牌。', + canshi:'残蚀', + canshi2:'残蚀', + canshi_info:'摸牌阶段开始时,你可以放弃摸牌,改为摸x张牌(x为已受伤的角色数),若如此做,当你与此回合内使用基本牌或锦囊牌时,你弃置一张牌。', + zhuiji_info:'锁定技,你与体力值低于你的角色距离为1。', + kunfen:'困奋', + kunfen_info:'锁定技,回合结束阶段开始时,你失去1点体力,然后摸两张牌', + fengliang:'逢亮', + fengliang_info:'觉醒技,当你进入濒死状态时,你减1点体力上限并将体力值回复至2点,然后获得技能挑衅,将困奋改为非锁定技', + cihuai:'刺槐', + cihuai_info:'出牌阶段开始时,若你手牌中没有杀,你可以展示你的手牌,视为对一名角色使用一张杀', + gongao_info:'锁定技,每当一名角色死亡后,你增加一点体力上限,回复一点体力。', + juyi:'举义', + juyi_info:'觉醒技,准备阶段开始时,若你已受伤且体力上限大于存活角色数,你须将手牌摸至体力上限,然后获得技能“崩坏”和“威重”。', + weizhong:'威重', + weizhong_info:'锁定技,每当你的体力上限增加或减少时,你摸一张牌。', + taichen_info:'出牌阶段限一次,你可以自减一点体力,视为对一名角色使用一张杀(不计入回合内出杀限制)', + manjuan_info:'其他角色的卡牌因弃置而进入弃牌堆后,你可以弃置一张花色与之不同的牌,然后获得之', + zuixiang_info:'限定技,回合开始阶段开始时,你可以展示牌库顶的3张牌并置于你的武将牌上,你不可使用或打出与该些牌同类的牌,所有同类牌对你无效。之后每个你的回合开始阶段,你须重复展示一次,直至该些牌中任意两张点数相同时,将你武将牌上的全部牌置于你的手上。', + naman_info:'你可以获得其他角色打出的杀', + xiemu_info:'每当你成为其他角色的黑色牌的目标,可以弃置一张杀并摸两张牌', + spmengjin_info:'每当你使用一张杀,可以弃置目标一张牌', + fenxun_info:'每当你使用杀且仅指定了一个目标,你可以弃置一张牌并额外指定一个无视距离的目标', + yingbin_info:'受到“咒缚”技能影响的角色进行判定时,你可以摸两张牌。', + zhoufu_info:'出牌阶段限一次,你可以指定一名其他角色并将一张手牌移出游戏(将此牌置于该角色的武将牌旁)。若如此做,该角色进行判定时,改为将此牌作为判定牌。该角色的回合结束时,若此牌仍在该角色旁,你将此牌收入手牌。', + yanzheng_info:'若你的手牌数大于你的体力值,你可以将你装备区内的牌当【无懈可击】使用', + kuiwei_info:'回合结束阶段开始时,你可以摸2+X张牌,然后将你的武将牌翻面。在你的下个摸牌阶段开始时,你须弃置X张牌。(X等于当时场上装备区内的武器牌的数量)', + tongji_info:'锁定技。若你的手牌数大于你的体力值,则只要你在任一其他角色的攻击范围内,该角色使用【杀】时便不能指定你以外的角色为目标', + wangzun_info:'其他角色的回合开始时,你可以摸一张牌,然后令该角色此回合的手牌上限-1;直到你的回合开始,你不能再次发动此技', + kaikang_info:'每当你距离1以内的角色成为杀的目标后,你可以摸一张牌。若如此做,你交给其一张牌并展示之,若该牌为装备牌,该角色可以使用此牌。', + liangzhu_info:'其他角色在其回合内回复体力时,你可以与其各摸一张牌 ', + mingshi_info:'当你即将受到伤害时,若伤害来源的体力值大于你,你可以弃置一张黑色手牌令伤害-1 ', + lirang_info:'你可以将你弃置的卡牌交给一名其他角色 ', + moukui_info:'当你使用【杀】指定一名角色为目标后,你可以选择一项:摸一张牌,或弃置其一张牌。若如此做,此【杀】被【闪】抵消时,该角色弃置你的一张牌。 ', + qiangwu_info:'出牌阶段,你可以进行一次判定。若如此做,则直到回合结束,你使用点数小于判定牌的 【杀】时不受距离限制,且你使用点数大于判定牌的【杀】时不计入出牌阶段的使用次数。', + shenxian_info:'你的回合外,每当有其他角色因弃置而失去牌时,若其中有基本牌,你可以摸一张牌。', + qiluan_info:'每当你杀死一名角色后,可以在回合结束时摸三张牌。', + zhendu_info:'其他角色的出牌阶段开始时,你可以弃置一张手牌,视为该角色使用一张【酒】,然后你对其造成一点伤害。', + shangyi_info:'出牌阶段限一次,你可以观看一名其他角色的手牌,然后弃置其中的一张黑色牌', + shoucheng_info:'每当一名其他角色在其回合外失去最后的手牌时,你可令该角色摸一张牌。', + shengxi_info:'若你于出牌阶段未造成伤害,你可在此阶段结束时摸两张牌。', + hengzheng_info:'摸牌阶段开始时,若你的体力值为1或你没有手牌,你可以放弃摸牌,获得每名其他角色区域里的一张牌。', + yongjue_info:'每当其他角色于回合内使用一张杀,若目标不是你,你可以获得之(每回合最多能以此法获得一张杀)', + cunsi_info:'限定技,出牌阶段,你可以将所有手牌交给一名男性角色,令该角色获得技能【勇决】,然后翻面', + guixiu_info:'每当你成为杀的目标,若你的手牌数小于体力值,可以摸一张牌', + fenming_info:'结束阶段开始时,若你处于连环状态,你可以弃置处于连环状态的每名角色的一张牌。', + duanxie_info:'出牌阶段限一次,你可以令一名其他角色横置武将牌,若如此做,你横置武将牌。', + xiaoguo_info:'其他角色的结束阶段开始时,你可以弃置一张基本牌,令该角色选择一项:1.弃置一张装备牌并令你摸一张牌;2.受到你对其造成的1点伤害。', + sijian_info:'当你失去最后的手牌时,你可以弃置一名其他角色的一张牌。', + suishi_info:'锁定技。当一名其他角色进入濒死状态时,你摸一张牌;其他与你势力相同的角色死亡时,你失去1点体力。', + quji_info:'出牌阶段限一次,你可以弃置X张牌(X为你已损失的体力值),然后令至多X名已受伤的角色各回复1点体力。若你以此法弃置的牌中有黑色牌,你失去一点体力。', + junbing_info:'一名角色的结束阶段开始时,若其手牌数少于或者等于1,该角色可以摸一张牌。若如此做,该角色须将所有手牌交给你,然后你交给其等量的牌。', + shefu_info:'结束阶段开始时,你可以将一张手牌移出游戏,称为“伏兵”。然后为“伏兵”记录一个基本牌或锦囊牌名称(须与其他“伏兵”记录的名称均不同)。你的回合外,当有其他角色使用与你记录的“伏兵”牌名相同的牌时,你可以令此牌无效,然后将该“伏兵”置入弃牌堆。', + xiongyi_info:'限定技,出牌阶段,你可以令至多两名角色与你各摸3张牌,若你指定的角色数不超过1,你回复1点体力', + shenzhi_info:'回合开始阶段开始时,你可以弃置所有手牌,若你以此法弃置的牌的张数不小于X,你回复1点体力(X为你当前的体力值)。', + shushen_info:'当你回复1点体力时,你可以令一名其他角色回复1点体力或摸两张牌', + wuji_info:'觉醒技,回合结束阶段开始时,若你于此回合内已造成3点或更多伤害,你加1点体力上限,回复1点体力,然后失去技能“虎啸”。', + xueji_info:'出牌阶段,你可弃置一张红色牌并选择你攻击范围内的至多X名其他角色,对这些角色各造成1点伤害(X为你已损失的体力值),然后这些角色各摸一张牌。每阶段限一次。', + huxiao_info:'锁定技,你于出牌阶段内每使用一张【杀】被【闪】抵消,你于此阶段内可以额外使用一张【杀】。', + aocai_info:'当你于回合外需要使用或打出一张基本牌时,你可以观看牌堆顶的两张牌。若你观看的牌中有此牌,你可以使用打出之。', + hongyuan_info:'摸牌阶段摸牌时,你可以少摸一张牌,然后指定至多两名其他角色各摸一张牌。', + huanshi_info:'一名角色的判定牌生效前,你可令其观看你的手牌。若如此做,该角色选择你的一张牌,令你打出此牌代替之。', + mingzhe_info:'你的回合外,每当你因使用、打出或弃置而失去一张红色牌时,你可以摸一张牌。', + duwu_info:'出牌阶段,你可以弃置X张牌对你攻击范围内的一名其他角色造成1点伤害(X为该角色的体力值)。若你以此法令该角色进入濒死状态,则濒死状态结算后你失去1点体力,且本回合不能再发动黩武。', + tianming_info:'当你成为【杀】的目标时,你可以弃置两张牌(不足则全弃,无牌则不弃),然后摸两张牌;若此时全场体力值最多的角色仅有一名(且不是你),该角色也可以如此做。', + mizhao_info:'出牌阶段,你可以将所有手牌(至少一张)交给一名其他角色。若如此做,你令该角色与你指定的另一名有手牌的角色拼点。视为拼点赢的角色对没赢的角色使用一张【杀】。每阶段限一次。', + yuanhu_info:'回合结束阶段开始时,你可以将一张装备牌置于一名角色的装备区里,然后根据此装备牌的种类执行以下效果。武器牌:弃置与该角色距离为1的一名角色区域中的一张牌;防具牌:该角色摸一张牌;坐骑牌:该角色回复1点体力。', + lihun_info:'出牌阶段,你可以弃置一张牌并将你的武将牌翻面,若如此做,制定一名男性角色,获得其所有手牌。出牌阶段结束时,你需为该角色每一点体力分配给其一张牌。每回合限一次。', + chongzhen_info:'每当你发动“龙胆”使用或打出一张手牌时,你可以立即获得对方的一张手牌。', + bifa_info:'回合结束阶段开始时,你可以将一张手牌移出游戏并指定一名其他角色。该角色的回合开始时,其观看你移出游戏的牌并选择一项:交给你一张与此牌同类型的手牌并获得此牌;或将此牌置入弃牌堆,然后失去1点体力。', + songci_info:'出牌阶段,你可以选择一项:令一名手牌数小于其体力值的角色摸两张牌;或令一名手牌数大于其体力值的角色弃置两张牌。此技能对每名角色只能使用一次。', + yongsi_info:'锁定技,摸牌阶段,你额外摸X张牌,X为场上现存势力数。弃牌阶段,你至少须弃置等同于场上现存势力数的牌(不足则全弃)。', + yicong_info:'锁定技,只要你的体力值大于2点,你计算与其他角色的距离时,始终-1;只要你的体力值为2点或更低,其他角色计算与你的距离时,始终+1。', + baobian_info:'锁定技,若你的体力值为3或更少,你视为拥有技能“挑衅”;若你的体力值为2或更少;你视为拥有技能“咆哮”;若你的体力值为1,你视为拥有技能“神速”。', + }, +} diff --git a/character/standard.js b/character/standard.js new file mode 100644 index 000000000..a49ebb7ef --- /dev/null +++ b/character/standard.js @@ -0,0 +1,1426 @@ +character.standard={ + character:{ + caocao:['male','wei',4,['hujia','jianxiong'],['zhu','fullskin']], + simayi:['male','wei',3,['fankui','guicai'],['fullskin']], + xiahoudun:['male','wei',4,['ganglie'],['fullskin']], + zhangliao:['male','wei',4,['tuxi'],['fullskin']], + xuzhu:['male','wei',4,['luoyi'],['fullskin']], + guojia:['male','wei',3,['tiandu','yiji'],['fullskin']], + zhenji:['female','wei',3,['luoshen','qingguo'],['fullskin']], + liubei:['male','shu',4,['rende','jijiang'],['zhu','fullskin']], + guanyu:['male','shu',4,['wusheng'],['fullskin']], + zhangfei:['male','shu',4,['paoxiao'],['fullskin']], + zhugeliang:['male','shu',3,['guanxing','kongcheng'],['fullskin']], + zhaoyun:['male','shu',4,['longdan'],['fullskin']], + machao:['male','shu',4,['mashu','tieji'],['fullskin']], + huangyueying:['female','shu',3,['jizhi','qicai'],['fullskin']], + sunquan:['male','wu',4,['zhiheng','jiuyuan'],['zhu','fullskin']], + ganning:['male','wu',4,['qixi'],['fullskin']], + lvmeng:['male','wu',4,['keji'],['fullskin']], + huanggai:['male','wu',4,['kurou'],['fullskin']], + zhouyu:['male','wu',3,['yingzi','fanjian'],['fullskin']], + daqiao:['female','wu',3,['guose','liuli'],['fullskin']], + luxun:['male','wu',3,['qianxun','lianying'],['fullskin']], + sunshangxiang:['female','wu',3,['xiaoji','jieyin'],['fullskin']], + huatuo:['male','qun',3,['qingnang','jijiu'],['fullskin']], + lvbu:['male','qun',4,['wushuang'],['fullskin']], + diaochan:['female','qun',3,['lijian','biyue'],['fullskin']], + }, + skill:{ + hujia:{ + unique:true, + trigger:{player:'chooseToRespondBegin'}, + filter:function(event,player){ + if(player.identity!='zhu') return false; + if(event.filterCard({name:'shan'})==false) return false; + for(var i=0;i2)){ + var next=event.current.chooseToRespond('是否替'+get.translation(player)+'打出一张闪?',{name:'shan'}); + next.ai=function(){ + var event=_status.event; + return (ai.get.attitude(event.player,event.source)-2); + }; + next.autochoose=lib.filter.autoRespondShan; + next.source=player; + } + } + "step 1" + if(result.bool){ + event.finish(); + trigger.result=result; + trigger.responded=true; + trigger.animate=false; + if(typeof event.current.ai.shown=='number'&&event.current.ai.shown<0.95){ + event.current.ai.shown+=0.3; + if(event.current.ai.shown>0.95) event.current.ai.shown=0.95; + } + } + else{ + event.current=event.current.next; + event.goto(0); + } + }, + }, + jianxiong:{ + trigger:{player:'damageEnd'}, + filter:function(event,player){ + return get.itemtype(event.cards)=='cards'&&get.position(event.cards[0])=='d'; + }, + content:function(){ + player.gain(trigger.cards); + player.$gain2(trigger.cards); + }, + ai:{ + maixie:true, + effect:{ + target:function(card,player){ + if(player.skills.contains('jueqing')) return [1,-1]; + if(get.tag(card,'damage')) return [1,0.5]; + } + } + } + }, + fankui:{ + trigger:{player:'damageEnd'}, + direct:true, + filter:function(event,player){ + return (event.source&&event.source.num('he')); + }, + content:function(){ + "step 0" + player.choosePlayerCard(trigger.source,ai.get.buttonValue,'he'); + "step 1" + if(result.bool){ + player.logSkill('fankui',trigger.source); + player.gain(result.buttons[0].link); + trigger.source.$give(1,player); + } + }, + ai:{ + result:{ + target:function(card,player,target){ + if(player.num('he')>1&&get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-1.5]; + if(ai.get.attitude(target,player)<0) return [1,1]; + } + } + } + } + }, + guicai:{ + trigger:{global:'judge'}, + direct:true, + filter:function(event,player){ + return player.num('h')>0; + }, + content:function(){ + "step 0" + player.chooseCard('鬼才:请选择代替判定的牌').ai=function(card){ + var trigger=_status.event.parent._trigger; + var player=_status.event.player; + var result=trigger.judge(card)-trigger.judge(trigger.player.judging); + var attitude=ai.get.attitude(player,trigger.player); + if(attitude==0||result==0) return 0; + if(attitude>0){ + return result-ai.get.value(card)/2; + } + else{ + return -result-ai.get.value(card)/2; + } + }; + "step 1" + if(result.bool){ + player.respond(result.cards); + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + player.logSkill('guicai'); + if(trigger.player.judging.clone) trigger.player.judging.clone.delete(); + ui.discardPile.appendChild(trigger.player.judging); + trigger.player.judging=result.cards[0]; + trigger.position.appendChild(result.cards[0]); + game.log(get.translation(trigger.player)+'的判定牌改为'+get.translation(result.cards[0])); + game.delay(2); + } + }, + ai:{ + tag:{ + rejudge:1, + } + } + }, + ganglie:{ + trigger:{player:'damageEnd'}, + filter:function(event,player){ + return (event.source!=undefined); + }, + check:function(event,player){ + return (ai.get.attitude(player,event.source)<=0); + }, + content:function(){ + "step 0" + player.judge(function(card){ + if(get.suit(card)=='heart') return -2; + return 2; + }) + "step 1" + if(result.judge<2){ + event.finish();return; + } + trigger.source.chooseToDiscard(2).ai=function(card){ + return ai.get.unuseful(card)+2.5*(5-get.owner(card).hp); + }; + "step 2" + if(result.bool==false){ + trigger.source.damage(); + } + }, + ai:{ + result:{ + target:function(card,player,target){ + if(player.skills.contains('jueqing')) return [1,-1]; + if(get.tag(card,'damage')&&ai.get.damageEffect(target,player,player)>0) return [1,0,0,-1.5]; + } + } + } + }, + tuxi:{ + trigger:{player:'phaseDrawBefore'}, + direct:true, + content:function(){ + "step 0" + var check; + var i,num=0; + for(i=0;i=2); + player.chooseTarget('是否发动突袭?',[1,2],function(card,player,target){ + return target.num('h')>0&&player!=target; + }, + function(target){ + if(!check) return 0; + return (1-ai.get.attitude(_status.event.player,target)); + }); + "step 1" + if(result.bool){ + player.logSkill('tuxi',result.targets); + for(var i=0;i0) + }, + content:function(){ + "step 0" + event.cards=get.cards(2*trigger.num); + player.gain(event.cards); + player.$draw(event.cards.length); + "step 1" + player.chooseCardTarget({ + filterCard:function(card){ + return _status.event.parent.cards.contains(card); + }, + selectCard:[1,event.cards.length], + filterTarget:function(card,player,target){ + return player!=target; + }, + ai1:function(card){ + if(ui.selected.cards.length>0) return -1; + return (_status.event.player.num('h')-_status.event.player.hp); + }, + ai2:function(target){ + return ai.get.attitude(_status.event.player,target)-4; + }, + prompt:'请选择要送人的卡牌' + }); + "step 2" + if(result.bool){ + result.targets[0].gain(result.cards); + player.$give(result.cards.length,result.targets[0]); + for(var i=0;i=4) return [1,get.tag(card,'damage')*2]; + if(target.hp==3) return [1,get.tag(card,'damage')*1.5]; + if(target.hp==2) return [1,get.tag(card,'damage')*0.5]; + } + } + } + } + }, + luoshen:{ + trigger:{player:'phaseBegin'}, + frequent:true, + content:function(){ + "step 0" + if(event.cards==undefined) event.cards=[]; + player.judge(function(card){ + if(get.color(card)=='black') return 1.5; + return -1.5; + },ui.special); + "step 1" + if(result.judge>0){ + event.cards.push(result.card); + if(lib.config.auto_skill==false){ + player.chooseBool('是否再次发动?'); + } + else{ + event._result={bool:true}; + } + } + else{ + for(var i=0;i1) return 0; + var player=get.owner(card); + if(player.hp==player.maxHp||player.storage.rende<0||player.num('h')<=1){ + if(ui.selected.cards.length){ + return -1; + } + if(player.num('h')>player.hp) return 10-ai.get.value(card); + if(player.num('h')>2) return 6-ai.get.value(card); + return -1; + } + return 10-ai.get.value(card); + }, + content:function(){ + target.gain(cards); + game.delay(); + if(typeof player.storage.rende!='number'){ + player.storage.rende=0; + } + if(player.storage.rende>=0){ + player.storage.rende+=cards.length; + if(player.storage.rende>=2){ + player.recover(); + player.storage.rende=-1; + } + } + }, + ai:{ + order:10, + result:{ + target:function(player,target){ + var nh=target.num('h'); + var np=player.num('h'); + if(player.hp==player.maxHp||player.storage.rende<0||player.num('h')<=1){ + if(nh>=np-1&&np<=player.hp) return 0; + } + return Math.max(1,5-nh); + } + }, + effect:{ + target:function(card,player,target){ + if(player==target&&get.type(card)=='equip'){ + if(player.num('e',{subtype:get.subtype(card)})){ + for(var i=0;i0){ + return 0; + } + } + } + } + } + }, + threaten:0.8 + } + }, + rende1:{ + trigger:{player:'phaseUseBegin'}, + forced:true, + popup:false, + silent:true, + content:function(){ + player.storage.rende=0; + } + }, + jijiang:{ + unique:true, + group:['jijiang1','jijiang2'], + }, + jijiang1:{ + trigger:{player:'chooseToRespondBegin'}, + filter:function(event,player){ + if(player.identity!='zhu') return false; + if(event.filterCard({name:'sha'})==false) return false; + for(var i=0;i0.95) event.current.ai.shown=0.95; + } + } + else{ + event.current=event.current.next; + event.goto(0); + } + } + }, + jijiang2:{ + enable:'phaseUse', + filter:function(event,player){ + if(player!=game.zhu) return false; + if(player!=game.me&&player.skills.contains('jijiang3')) return false; + for(var i=0;i0.95) event.current.ai.shown=0.95; + } + } + else{ + event.current=event.current.next; + event.goto(0); + } + }, + ai:{ + result:{ + target:function(player,target){ + if(player.skills.contains('jijiang3')) return 0; + return ai.get.effect(target,{name:'sha'},player,target); + } + }, + order:function(){ + return lib.card.sha.ai.order-0.1; + }, + } + }, + jijiang3:{}, + wusheng:{ + enable:['chooseToRespond','chooseToUse'], + filterCard:function(card){ + return get.color(card)=='red'; + }, + position:'he', + viewAs:{name:'sha'}, + prompt:'将一张红色牌当杀使用或打出', + check:function(card){return 4-ai.get.value(card)}, + ai:{ + respondSha:true, + } + }, + paoxiao:{ + mod:{ + cardUsable:function(card,player,num){ + if(card.name=='sha') return Infinity; + } + }, + }, + guanxing:{ + trigger:{player:'phaseBegin'}, + frequent:true, + content:function(){ + "step 0" + if(player.underControl()){ + game.swapPlayer(player); + } + if(event.isMine()){ + ui.auto.hide(); + event.top=[]; + event.bottom=[]; + event.status=true; + event.dialog=ui.create.dialog('按顺序选择置于牌堆顶的牌(先选择的在上)',get.cards(Math.min(5,game.players.length))); + event.control=ui.create.control('ok','pileTop','pileBottom',function(link){ + var event=_status.event; + if(link=='ok'){ + var i; + for(i=0;i0) return false; + if(event.player.group!='wu') return false; + return true; + }, + content:function(){ + player.recover(); + } + }, + qixi:{ + enable:'chooseToUse', + filterCard:function(card){ + return get.color(card)=='black'; + }, + position:'he', + viewAs:{name:'guohe'}, + prompt:'将一张黑色牌当过河拆桥使用', + check:function(card){return 4-ai.get.value(card)} + }, + keji:{ + trigger:{player:'phaseDiscardBefore'}, + filter:function(event,player){ + return (get.cardCount({name:'sha'},player)==0); + }, + content:function(){ + trigger.untrigger(); + trigger.finish(); + } + }, + kurou:{ + enable:'phaseUse', + prompt:'流失1点体力并摸两张牌', + content:function(){ + "step 0" + player.loseHp(1); + "step 1" + player.draw(2); + }, + ai:{ + basic:{ + order:1 + }, + result:{ + player:function(player){ + if(player.num('h')>=player.hp-1) return -1; + if(player.hp<3) return -1; + return 1; + } + } + } + }, + yingzi:{ + trigger:{player:'phaseDrawBegin'}, + frequent:true, + content:function(){ + trigger.num++; + }, + ai:{ + threaten:1.3 + } + }, + fanjian:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.num('h')>0; + }, + filterTarget:function(card,player,target){ + return player!=target; + }, + content:function(){ + "step 0" + target.chooseControl('heart2','diamond2','club2','spade2').ai=function(event){ + //var player=event.parent.player; + //var list=[player.get('h',{suit:'heart'}), + //player.get('h',{suit:'diamond'}), + //player.get('h',{suit:'club'}), + //player.get('h',{suit:'spade'})]; + //for(var i=0;imax){ + // result=i; + // max=list[i]; + // } + //} + switch(Math.floor(Math.random()*6)){ + case 0:return 'heart2'; + case 1:case 4:case 5:return 'diamond2'; + case 2:return 'club2'; + case 3:return 'spade2'; + } + }; + "step 1" + event.choice=result.control; + target.popup(event.choice); + event.card=player.get('h').randomGet(); + target.gain(event.card); + player.$give(event.card,target); + game.delay(); + "step 2" + if(get.suit(event.card)+'2'!=event.choice) target.damage(); + }, + ai:{ + order:1, + result:{ + target:function(player,target){ + var eff=ai.get.damageEffect(target,player); + if(eff>=0) return 1+eff; + var value=0,i; + var cards=player.get('h'); + for(i=0;i0){ + return [0,0.1]; + } + } + } + return min; + } + } + } + }, + qianxun:{ + mod:{ + targetEnabled:function(card,player,target,now){ + if(card.name=='shunshou'||card.name=='lebu') return false; + } + }, + }, + lianying:{ + trigger:{player:'loseEnd'}, + frequent:true, + filter:function(event,player){ + if(player.num('h')) return false; + for(var i=0;iplayer.hp) + return 8-ai.get.value(card) + if(player.hp=target.maxHp) return false; + if(target==player) return false; + return true; + }, + content:function(){ + player.recover(); + target.recover(); + }, + ai:{ + order:7.5, + result:{ + player:function(player){ + if(player.hpplayer.hp) return 0 + return -1; + }, + target:4 + }, + threaten:2, + } + }, + qingnang:{ + enable:'phaseUse', + filterCard:true, + usable:1, + check:function(card){ + return 9-ai.get.value(card) + }, + filterTarget:function(card,player,target){ + if(target.hp>=target.maxHp) return false; + return true; + }, + content:function(){ + target.recover(); + }, + ai:{ + order:9, + result:{ + target:function(player,target){ + if(target.hp==5) return 5; + if(player==target&&player.num('h')>player.hp) return 5; + return 2; + } + }, + threaten:2 + } + }, + jijiu:{ + enable:'chooseToUse', + filter:function(event,player){ + return _status.currentPhase!=player; + }, + filterCard:function(card){ + return get.color(card)=='red'; + }, + position:'he', + viewAs:{name:'tao'}, + prompt:'将一张红色牌当桃使用', + check:function(card){return 15-ai.get.value(card)}, + ai:{ + threaten:1.5, + save:true, + } + }, + wushuang:{ + forced:true, + group:['wushuang1','wushuang2'] + }, + wushuang1:{ + trigger:{player:'shaBegin'}, + forced:true, + content:function(){ + "step 0" + var next=trigger.target.chooseToRespond({name:'shan'}); + next.autochoose=lib.filter.autoRespondShan; + next.ai=function(card){ + if(trigger.target.num('h','shan')>1){ + return ai.get.unuseful2(card); + } + return -1; + }; + "step 1" + if(result.bool==false){ + trigger.untrigger(); + trigger.directHit=true; + } + } + }, + wushuang2:{ + trigger:{player:'juedou',target:'juedou'}, + forced:true, + filter:function(event,player){ + return event.turn!=player; + }, + content:function(){ + "step 0" + var next=trigger.turn.chooseToRespond({name:'sha'}); + next.autochoose=lib.filter.autoRespondSha; + next.ai=function(card){ + if(ai.get.attitude(trigger.turn,player)<0&&trigger.turn.num('h','sha')>1){ + return ai.get.unuseful2(card); + } + return -1; + }; + "step 1" + if(result.bool==false){ + trigger.directHit=true; + } + }, + ai:{ + result:{ + target:function(card,player,target){ + if(card.name=='juedou'&&target.num('h')>0) return [1,0,0,-1]; + } + } + } + }, + lijian:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + var num=0; + for(var i=0;i1) + }, + check:function(card){return 10-ai.get.value(card)}, + filterCard:true, + position:'he', + filterTarget:function(card,player,target){ + if(player==target) return false; + if(target.sex!='male') return false; + if(ui.selected.targets.length==1){ + return target.canUse({name:'juedou'},ui.selected.targets[0]); + } + return true; + }, + targetprompt:['先出杀','后出杀'], + selectTarget:2, + multitarget:true, + content:function(){ + targets[1].useCard({name:'juedou'},targets[0]).animate=false; + game.delay(0.5); + }, + ai:{ + order:8, + result:{ + target:function(player,target){ + if(ui.selected.targets.length==0){ + return -3; + } + else{ + var num=ui.selected.targets[0].num('h'); + if(num==0) return 0; + if(num==1) return -0.1; + return -2; + } + } + }, + expose:0.4, + threaten:3, + } + }, + biyue:{ + trigger:{player:'phaseEnd'}, + frequent:true, + content:function(){ + player.draw(); + }, + }, + invincible:{ + trigger:{player:['damageBefore','loseHpBefore','loseMaxHpBefore']}, + forced:true, + popup:false, + content:function(){ + trigger.untrigger(); + trigger.finish(); + } + } + }, + translate:{ + caocao:'曹操', + simayi:'司马懿', + xiahoudun:'夏侯惇', + zhangliao:'张辽', + xuzhu:'许褚', + guojia:'郭嘉', + zhenji:'甄姬', + liubei:'刘备', + guanyu:'关羽', + zhangfei:'张飞', + zhugeliang:'诸葛亮', + zhaoyun:'赵云', + machao:'马超', + huangyueying:'黄月英', + sunquan:'孙权', + ganning:'甘宁', + lvmeng:'吕蒙', + huanggai:'黄盖', + zhouyu:'周瑜', + daqiao:'大乔', + luxun:'陆逊', + sunshangxiang:'孙尚香', + huatuo:'华佗', + lvbu:'吕布', + diaochan:'貂蝉', + + hujia:'护驾', + jianxiong:'奸雄', + fankui:'反馈', + guicai:'鬼才', + ganglie:'刚烈', + tuxi:'突袭', + luoyi:'裸衣', + luoyi2:'裸衣', + tiandu:'天妒', + yiji:'遗计', + luoshen:'洛神', + qingguo:'倾国', + rende:'仁德', + jijiang:'激将', + jijiang1:'激将', + jijiang2:'激将', + wusheng:'武圣', + paoxiao:'咆哮', + guanxing:'观星', + kongcheng:'空城', + longdan:'龙胆', + longdan1:'龙胆', + longdan2:'龙胆', + mashu:'马术', + feiying:'飞影', + tieji:'铁骑', + jizhi:'集智', + qicai:'奇才', + zhiheng:'制衡', + jiuyuan:'救援', + qixi:'奇袭', + keji:'克己', + kurou:'苦肉', + yingzi:'英姿', + fanjian:'反间', + guose:'国色', + liuli:'流离', + qianxun:'谦逊', + lianying:'连营', + xiaoji:'枭姬', + jieyin:'结姻', + qingnang:'青囊', + jijiu:'急救', + wushuang:'无双', + wushuang1:'无双', + wushuang2:'无双', + lijian:'离间', + biyue:'闭月', + pileTop:'牌堆顶', + pileBottom:'牌堆底', + hujia_info:'主公技,魏势力角色可以替你打出[闪]', + jianxiong_info:'你可以立即获得对你造成伤害的牌', + fankui_info:'当你受到伤害时,可以获得伤害来源的一张牌', + guicai_info:'在任意角色的判定牌生效前,你可以打出一张手牌代替之', + ganglie_info:'每当你受到一次伤害,可进行一次判定,若结果不为红桃,则伤害来源须弃置两张手牌若受到来自你的一点伤害', + tuxi_info:'摸牌阶段,你可以放弃摸牌,并从1~2名其他角色各抽取一张手牌', + luoyi_info:'摸牌阶段,你可以少摸一张牌,若如此做,你本回合内[杀]或[决斗]造成的伤害+1', + tiandu_info:'你可以立即获得你的判定牌', + yiji_info:'每当你受到一点伤害,可以观看牌堆顶的两张牌,并将其交给任意1~名角色', + luoshen_info:'回合开始阶段,你可以进行一定判定,若为黑色则可以继续判定,直到出现红色。然后你获得所有黑色的判定牌', + qingguo_info:'你可以将一张黑色手牌当[闪]使用或打出', + rende_info:'出牌阶段,你可以将任意手牌送给其他角色,若送出的手牌不少于两张,你回复一点体力', + jijiang_info:'蜀势力角色可以帮你使用或打出[杀]', + wusheng_info:'你可以将一张红色牌当[杀]使用', + paoxiao_info:'出牌阶段,你使用[杀]无数量限制', + guanxing_info:'回合开始阶段,你可以观看牌堆顶的x张牌,并将其以任意顺序置于牌堆项或牌堆底,x为存活角色个数且不超过5', + kongcheng_info:'锁定技,当你没有手牌时,不能成为[杀]或[决斗]的目标', + longdan_info:'你可以将[杀]当[闪],或[闪]当[杀]使用或打出', + mashu_info:'当计算你与其它角色的距离时,始终-1', + feiying_info:'当计算其它角色与你的距离时,始终+1', + tieji_info:'当你使用一张[杀]时,可进行一次判定,若为红色则此[杀]不可闪避', + jizhi_info:'每当你使用或打出一张非延时锦囊,可以摸一张牌', + qicai_info:'锁定技,你使用的锦囊牌无距离限制', + zhiheng_info:'出牌阶段,你可以弃置任意张牌并摸等量的牌,每阶段限1次', + jiuyuan_info:'锁定技,濒死阶段,吴势力角色对你使用的[桃]额外回复一点体力', + qixi_info:'你可以将一张黑色手牌当[过河拆桥]使用', + keji_info:'若你在出牌阶段没有使用[杀],则可跳过弃牌阶段', + kurou_info:'出牌阶段,你可以流失一点体力并摸两张牌', + yingzi_info:'摸牌阶段,你可以额外摸一张牌', + fanjian_info:'出牌阶段,你可以令一名角色选择一种花色并展示你的一张手牌,若选择的花色与展示的不同,该角色受到来自你的一点伤害。结算结束后该角色获得展示的牌。每阶段限1次', + guose_info:'你可以将一张方片花色的手牌当[乐不思蜀]使用', + liuli_info:'当你成为[杀]的目标时,可以弃置一张牌将其转移给攻击范围内的一名其他角色,此角色不能是[杀]的使用者', + qianxun_info:'锁定技,你不能成为[顺手牵羊]和[乐不思蜀]的目标', + lianying_info:'每当你失去最后一张手牌,可摸一张牌', + xiaoji_info:'每当你失去一张装备牌,可以摸两张牌', + jieyin_info:'出牌阶段,你可以弃置两张牌并选择1名已经受伤的男性角色,你与其各回复一点体力,每阶段限一次', + qingnang_info:'出牌阶段,你可以弃置一张手牌令一名角色回复一点体力,每阶段限一次', + jijiu_info:'回合外,你可以将一张红色牌当[桃]使用', + wushuang_info:'锁定技,你使用的[杀]或[决斗]需要两张[闪]或[杀]响应', + lijian_info:'出牌阶段,你可以弃一张牌,视为一名男性角色对另一名男性角色使用一张[决斗],每阶段限一次', + biyue_info:'回合结束阶段,你可以摸一张牌', + }, +} diff --git a/character/swd.js b/character/swd.js new file mode 100644 index 000000000..74882997f --- /dev/null +++ b/character/swd.js @@ -0,0 +1,7942 @@ +'use strict'; +character.swd={ + character:{ + swd_huzhongxian:['male','wu',3,['daofa','xielv','xiangu'],['fullskin']], + + swd_anka:['male','qun',3,['songci','anlianying'],['fullskin']], + swd_septem:['male','qun',4,['jiying','liaoyuan','yishan'],['fullskin']], + swd_kama:['female','qun',3,['yueren','shangshi'],['fullskin']], + swd_miles:['male','qun',4,['aojian','miles_xueyi','mohua2']], + swd_nicole:['female','wu',3,['minjing','lingwu','huanjian'],['fullskin']], + swd_wangsiyue:['female','wei',3,['duishi','guisi','biyue']], + swd_weida:['female','qun',3,['yueren','zhenlie']], + swd_xuanyuanjianxian:['male','qun',4,['fengmo','pozhou','huajian'],['fullskin']], + + swd_chenjingchou:['male','wu',3,['youyin','yihua'],['fullskin']], + swd_duguningke:['female','qun',3,['lianji','touxi'],['fullskin']], + swd_guyue:['male','wei',3,['tiandao','swdqinyin','wangchen'],['fullskin']], + swd_tuobayuer:['female','shu',4,['liuhong','poyue','niepan'],['fullskin']], + swd_yuwentuo:['male','qun',4,['wushuang','xielei','kunlunjing'],['fullskin']], + swd_yuxiaoxue:['female','wei',3,['huanhun','daixing','yinyue'],['fullskin']], + + swd_jiliang:['male','wu',3,['yunchou','gongxin','qimou'],['fullskin']], + swd_shuijing:['female','qun',4,['mojian','duoren','duanyue'],['fullskin']], + swd_cheyun:['female','wu',3,['shengong','xianjiang3','qiaoxie'],['fullskin']], + swd_huanyuanzhi:['male','qun',3,['lanzhi','mufeng','tianshu'],['fullskin']], + swd_murongshi:['female','shu',4,['duanyi','guxing'],['fullskin']], + swd_jipeng:['male','wu',3,['reyingzi','guozao'],['fullskin']], + swd_qi:['male','qun',3,['yaotong','heihuo','pojian'],['fullskin']], + + swd_luchengxuan:['male','wu',4,['ljifeng','lxianglong'],['fullskin']], + swd_xiarou:['female','shu',3,['xianghui','huiqi'],['fullskin']], + swd_moye:['female','wu',3,['rexue','liuli'],['fullskin']], + + swd_zhaoyun:['male','shu',4,['ningjian','pozhen','tanlin'],['fullskin']], + swd_hengai:['female','shu',3,['funiao','ningxian','lingbo'],['fullskin']], + swd_duanmeng:['female','shu',4,['jizhan','lieren'],['fullskin']], + swd_jiangwu:['male','shu',4,['yijue','dangping'],['fullskin']], + swd_tuwei:['male','shu',3,['zhanlu','susheng'],['fullskin']], + swd_yeyaxi:['female','shu',3,['rexue','huopu'],['fullskin']], + + swd_muyun:['male','wei',4,['ningjian','polang','jikong'],['fullskin']], + swd_lanyin:['female','wei',3,['xingdian','yulin','luomei'],['fullskin']], + swd_zhiyin:['female','wei',3,['xuehuang','ningshuang','zhuyu'],['fullskin']], + swd_qiner:['female','wei',3,['huanyin','tianhuo','xuanzhou'],['fullskin']], + swd_jiuyou:['male','wei',3,['lexue'],['fullskin']], + swd_duopeng:['male','wu',3,['luanji','reyingzi'],['fullskin']], + + swd_fengtianling:['male','shu',4,['guiyan','jiang'],['fullskin']], + swd_huyue:['female','wu',3,['yunshen','fengming'],['fullskin']], + swd_jialanduo:['male','qun',4,['xianyin','mailun'],['fullskin']], + swd_rongshuang:['female','wu',3,['suiyan','duanxing'],['fullskin']], + swd_zhuoshanzhu:['male','wu',4,['suiyan','wanjun'],['fullskin']], + swd_jiting:['female','wei',4,['guanhu','chuanyang'],['fullskin']], + + swd_sikongyu:['male','wu',4,['sliufeng','linyun','hutian'],['fullskin']], + swd_muyue:['female','wei',3,['xingzhui','lingxian','shouyin'],['fullskin']], + swd_ziqiao:['female','shu',3,['guaili','pingshen','fuyan'],['fullskin']], + swd_fengyu:['male','shu',4,['zhenwei','shangxi'],['fullskin']], + }, + skill:{ + miaobi:{ + enable:'phaseUse', + viewAs:{name:'wugu'}, + filterCard:{suit:'heart'}, + filter:function(event,player){ + return !player.getStat('skill').miaobi&&player.num('h',{suit:'heart'})>0; + }, + check:function(card){ + return 5-ai.get.value(card); + } + }, + huajing:{ + trigger:{source:'damageEnd'}, + filter:function(event,player){ + return event.card&&get.type(event.card,'trick')=='trick'&&player.hp=0) return 0; + if(get.population('fan')<3) return 0; + return -1; + } + case 'zhong':{ + if(get.population('fan')<3) return 0; + return -1; + } + case 'nei':return 0; + case 'fan':{ + if(get.population('fan')==0) return 0; + if(get.population('zhong')<2) return 0; + return -1; + } + } + } + case 'guozhan':{ + if(player.identity=='unknown') return 0; + return get.population(player.identity)>=3?-1:0; + } + case 'versus':{ + return -1; + } + default:{ + return 0; + } + } + }, + } + } + }, + bingfeng2:{ + mod:{ + cardEnabled:function(){ + return false; + }, + cardUsable:function(){ + return false; + }, + cardRespondable:function(){ + return false; + }, + cardSavable:function(){ + return false; + } + }, + trigger:{player:'turnOverAfter'}, + forced:true, + filter:function(event,player){ + return !player.isTurnedOver(); + }, + content:function(){ + player.removeSkill('bingfeng2'); + } + }, + yudun:{ + mod:{ + cardEnabled:function(card,player){ + if(get.type(card,'trick')=='trick') return false; + }, + cardRespondable:function(card,player){ + if(get.type(card,'trick')=='trick') return false; + }, + cardSavable:function(card,player){ + if(get.type(card,'trick')=='trick') return false; + }, + cardUsable:function(card,player){ + if(get.type(card,'trick')=='trick') return false; + if(card.name=='sha') return Infinity; + } + }, + enable:['chooseToUse','chooseToRespond'], + filterCard:function(card){ + return get.type(card,'trick')=='trick'; + }, + viewAs:{name:'sha'}, + check:function(){return 1}, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(get.tag(card,'respondSha')&¤t<0) return 0.6 + } + }, + respondSha:true, + order:4, + useful:-1, + value:-1 + } + }, + guozao:{ + trigger:{global:'damageEnd'}, + forced:true, + check:function(event,player){ + for(var i=0;i2&&game.players[i].num('h')==1){ + return true; + } + } + return false; + }, + filter:function(event,player){ + if(event.source==player) return false; + if(get.distance(player,event.player)>1) return false; + for(var i=0;i0; + }).ai=function(target){ + var att=ai.get.attitude(player,target); + var hs=target.get('h'); + var num=hs.length; + if(num<=1) return att*2; + if(num==2){ + for(var i=0;i6,target,'raw') return att; + } + if(target==player){ + for(var i=0;i<2;i++){ + if(ai.get.value(cards[i])>6,target,'raw') return -1; + } + } + return att/2; + } + if(num==3){ + if(target==player){ + var num2=0; + for(var i=0;i<3;i++){ + num2+=ai.get.value(cards[i],player,'raw'); + num2-=ai.get.value(hs[i],player,'raw'); + } + if(num2>0) return 0.5; + if(num2<0) return -0.5; + } + return 0; + } + return -att/2; + }; + "step 1" + if(result.bool){ + var target=result.targets[0]; + player.logSkill('guozao',target); + var cards=target.get('h'); + target.lose(cards)._triggered=null; + game.log(get.translation(target)+'弃置了'+get.translation(cards)+',并获得三张牌'); + // target.$draw(3); + target.$throw(cards); + target.gain(event.cards,'draw')._triggered=null; + } + else{ + event.finish(); + } + }, + ai:{ + expose:0.1 + } + }, + heihuo:{ + enable:'phaseUse', + filter:function(event,player){ + return player.num('h')>0&&player.num('he',{type:'equip'})>0&&!player.skills.contains('heihuo2'); + }, + filterCard:function(card){ + return get.type(card)=='equip'; + }, + position:'he', + check:function(card){ + var player=_status.currentPhase; + var nh=player.num('h'); + var pos=get.position(card); + if(nh<2) return 0; + if(nh>5) return 0; + if(nh==5&&pos=='e') return 0; + if(player.num('he',{subtype:get.subtype(card)})>1){ + return 11-ai.get.equipValue(card)+(pos=='e'?0.4:0); + } + // if(nh==6||(nh==5&&pos=='e')) return 8-ai.get.value(card); + return 5.5-ai.get.value(card)+(pos=='e'?0.4:0); + }, + content:function(){ + "step 0" + player.draw(player.num('h')); + "step 1" + if(player.num('h')>=10){ + player.damage(3,'fire'); + player.addTempSkill('heihuo2','phaseAfter'); + } + }, + ai:{ + order:10, + threaten:1.4, + result:{ + player:1 + } + } + }, + heihuo2:{}, + yaotong:{ + group:['yaotong1','yaotong2','yaotong3'], + ai:{ + respondSha:true, + respondShan:true + }, + threaten:1.3 + }, + yaotong1:{ + enable:['chooseToRespond','chooseToUse'], + filterCard:true, + viewAs:{name:'sha'}, + filter:function(event,player){ + var num=player.num('h'); + if(num==0) return false; + return num%2==1; + }, + prompt:'将一张手牌当作杀打出', + check:function(card){return 6-ai.get.value(card)} + }, + yaotong2:{ + enable:['chooseToRespond','chooseToUse'], + filterCard:true, + viewAs:{name:'shan'}, + filter:function(event,player){ + var num=player.num('h'); + if(num==0) return false; + return num%2==1; + }, + prompt:'将一张手牌当作闪打出', + check:function(card){return 6-ai.get.value(card)} + }, + yaotong3:{ + enable:'chooseToUse', + filterCard:true, + viewAs:{name:'wuxie'}, + filter:function(event,player){ + var num=player.num('h'); + if(num==0) return false; + return num%2==0; + }, + viewAsFilter:function(player){ + var num=player.num('h'); + if(num==0) return false; + return num%2==0; + }, + prompt:'将一张手牌当作无懈可击使用', + check:function(card){return 7-ai.get.value(card)}, + }, + yaotong4:{ + enable:'chooseToUse', + filterCard:true, + viewAs:{name:'tao'}, + filter:function(event,player){ + var num=player.num('h'); + if(num==0) return false; + return num%2==0; + }, + viewAsFilter:function(player){ + var num=player.num('h'); + if(num==0) return false; + return num%2==0; + }, + prompt:'将一张手牌当作桃使用', + check:function(card){return 9-ai.get.value(card)}, + }, + pojian:{ + trigger:{player:'loseEnd'}, + filter:function(event,player){ + if(player.num('h')) return false; + for(var i=0;i0; + }, + filterCard:true, + position:'he', + content:function(){ + player.addSkill('huajin2'); + }, + check:function(card){ + return 5-ai.get.value(card); + }, + ai:{ + order:10, + result:{ + player:function(player){ + if(player.num('h','juedou')) return 1; + if(player.num('h','sha')==0) return 0; + for(var i=0;i0){ + return 1; + } + } + return 0; + } + } + } + }, + huajin2:{ + trigger:{source:'damageBegin'}, + forced:true, + content:function(){ + trigger.num++; + }, + group:'huajin3' + }, + huajin3:{ + trigger:{player:'phaseBegin'}, + forced:true, + popup:false, + content:function(){ + player.removeSkill('huajin2'); + } + }, + yuchen:{ + trigger:{player:['useCard','respondAfter']}, + direct:true, + filter:function(event,player){ + if(player==_status.currentPhase) return false; + if(event.cards){ + for(var i=0;i0; + }).ai=function(target){ + return -ai.get.attitude(player,target); + }; + "step 1" + if(result.bool){ + player.logSkill('yuchen',result.targets); + player.discardPlayerCard(result.targets[0],true); + } + }, + ai:{ + threaten:0.7 + } + }, + bingjian:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.num('he',{color:'black',name:'sha'})>0; + }, + filterCard:function(card){ + return card.name=='sha'&&get.color(card)=='black'; + }, + filterTarget:function(card,player,target){ + return player!=target&&target.num('h')>0; + }, + line:'thunder', + content:function(){ + "step 0" + target.showHandcards(); + "step 1" + var cards=target.get('h','shan'); + if(cards.length){ + target.discard(cards); + } + else{ + target.damage('thunder'); + } + }, + ai:{ + order:5, + result:{ + target:function(player,target){ + return ai.get.damageEffect(target,player,target,'thunder'); + } + }, + expose:0.2 + } + }, + rumeng:{ + trigger:{global:'phaseUseBefore'}, + direct:true, + filter:function(event,player){ + return event.player!=player&&player.num('he',{type:'basic'})2; + player.chooseToDiscard(function(card){ + return get.type(card)!='basic'; + },'是否对'+get.translation(trigger.player)+'发动【入梦】?','he').ai=function(card){ + if(yep){ + return 6-ai.get.value(card); + } + return 0; + } + "step 1" + if(result.bool){ + player.logSkill('rumeng',trigger.player); + trigger.player.chooseToDiscard({type:'basic'},'入梦:弃置一张基本牌或路过出牌及弃牌阶段').ai=function(card){ + return 5-ai.get.value(card); + } + } + else{ + event.finish(); + } + "step 2" + if(!result.bool){ + trigger.untrigger(); + trigger.finish(); + trigger.player.skip('phaseDiscard'); + } + }, + ai:{ + expose:0.1 + } + }, + lianda:{ + trigger:{player:'shaAfter'}, + direct:true, + filter:function(event,player){ + return event.target.isAlive()&&player.num('he')>0&&!player.skills.contains('lianda2'); + }, + content:function(){ + "step 0" + player.chooseToDiscard('he','是否发动【连打】?').ai=function(card){ + if(ai.get.effect(trigger.target,{name:'sha'},player,player)>0){ + return 7-ai.get.value(card); + } + } + "step 1" + if(result.bool){ + player.logSkill('lianda'); + player.addTempSkill('lianda2','phaseAfter'); + player.useCard({name:'sha'},trigger.target); + } + } + }, + lianda2:{}, + huiqi:{ + trigger:{player:'changeHp'}, + direct:true, + filter:function(event,player){ + return event.num<0&&player.hp3){ + return att+Math.max(0,5-target.num('h')); + } + return att/4; + } + if(att>3){ + return att+Math.max(0,5-target.num('h')); + } + return att; + } + "step 1" + if(result.bool){ + player.logSkill('huiqi',result.targets); + result.targets[0].draw(Math.min(3,player.maxHp-player.hp)); + } + }, + ai:{ + expose:0.2, + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + return [1,0.5]; + } + } + } + } + }, + xianghui:{ + enable:'phaseUse', + usable:1, + filterCard:{color:'red'}, + filter:function(){ + var min=game.players[0].hp; + for(var i=0;i2){ + if(player.num('h','shan')||player.num('e','2')|| + trigger.target.hp==1||player.hp>trigger.target.hp+1){ + if(!trigger.target.num('h','shan')||trigger.target.num('h')1) return false; + if(event.player==player) return false; + if(event.cards){ + for(var i=0;i3){ + return 100-target.num('h'); + } + return att; + } + "step 1" + if(result.bool){ + player.logSkill('zhenwei'); + game.log(get.translation(result.targets[0])+'获得了'+get.translation(event.cards)); + result.targets[0].gain(event.cards,'gain2'); + } + }, + ai:{ + expose:0.1, + threaten:1.6 + } + }, + shangxi:{ + trigger:{player:'phaseUseBegin'}, + direct:true, + filter:function(event,player){ + if(player.num('he')==0) return false; + for(var i=0;i0; + }, + content:function(){ + "step 0" + player.draw(); + "step 1" + if(player.num('he')){ + player.chooseCardTarget({ + position:'he', + prompt:'选择一张牌作为“岩”', + ai1:function(card){ + return 8-ai.get.value(card); + }, + ai2:function(target){ + var eff=-ai.get.damageEffect(target,target,player); + return eff+(player==target?2:0); + }, + filterCard:true, + filterTarget:function(card,player,target){ + return !target.skills.contains('fuyan2'); + } + }); + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + player.line(result.targets); + player.lose(result.cards,ui.special); + var target=result.targets[0]; + target.storage.fuyan2=result.cards[0]; + target.addSkill('fuyan2'); + player.$give(result.cards,target); + game.log(get.translation(player)+'将'+get.translation(result.cards)+'置于'+get.translation(target)+'的武将牌上'); + } + }, + ai:{ + effect:{ + target:function(card,player){ + if(get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-2]; + return 0.7; + } + } + }, + expose:0.2 + } + }, + fuyan2:{ + trigger:{player:'damageBegin'}, + filter:function(event,player){ + return event.num>0; + }, + forced:true, + mark:'card', + content:function(){ + trigger.num--; + player.removeSkill('fuyan2'); + ui.discardPile.appendChild(player.storage.fuyan2); + delete player.storage.fuyan2; + }, + intro:{ + content:'card' + } + }, + pingshen:{ + trigger:{source:'damageBegin'}, + forced:true, + popup:false, + unique:true, + silent:true, + content:function(){ + trigger.player.addSkill('pingshen2'); + trigger.player.storage.pingshen=player; + } + }, + pingshen2:{ + enable:'phaseUse', + unique:true, + mark:true, + init:function(player){ + player.storage.pingshen2=false; + }, + filter:function(event,player){ + return !player.storage.pingshen2; + }, + filterCard:true, + filterTarget:function(card,player,target){ + return target==player.storage.pingshen; + }, + selectTarget:-1, + position:'he', + content:function(){ + player.storage.pingshen2=true; + player.unmarkSkill('pingshen2'); + player.gain(target.get('h')); + target.$give(target.num('h'),player); + player.turnOver(); + player.addSkill('pingshen3'); + }, + check:function(card){return 8-ai.get.value(card);}, + intro:{ + content:'limited' + }, + ai:{ + order:10, + result:{ + player:function(player){ + if(player.classList.contains('turnedover')) return 10; + if(ai.get.attitude(player,player.storage.pingshen)>=0){ + return 0; + } + if(player.storage.pingshen.num('h')>player.storage.pingshen.hp) return 1; + return 0; + } + }, + effect:{ + target:function(card,player,target){ + if(!target.storage.pingshen2){ + if(card.name=='guiyoujie') return [0,1]; + } + } + } + }, + }, + pingshen3:{ + trigger:{player:'phaseUseEnd'}, + forced:true, + popup:false, + content:function(){ + "step 0" + player.removeSkill('pingshen3'); + if(player.storage.pingshen.classList.contains('dead')){ + event.finish(); + } + else{ + player.chooseCard('he',true,player.storage.pingshen.hp); + } + "step 1" + player.storage.pingshen.gain(result.cards); + player.$give(result.cards.length,player.storage.pingshen); + } + }, + guaili:{ + trigger:{source:'damageBegin'}, + filter:function(event){ + return event.card&&event.card.name=='sha'; + }, + forced:true, + content:function(){ + trigger.num++; + }, + ai:{ + threaten:1.2 + } + }, + xingzhui:{ + enable:'phaseUse', + usable:1, + filterCard:true, + position:'he', + filterTarget:function(card,player,target){ + return player!=target&&target.num('he')>0; + }, + check:function(card){ + if(get.type(card)=='equip'){ + var distance=get.info(card).distance; + if(distance){ + if(distance.attackFrom<0||distance.globalFrom<0) return 10; + } + } + return 7-ai.get.value(card); + }, + content:function(){ + "step 0" + if(!target.num('he')){ + event.finish(); + } + else{ + event.type=get.type(cards[0],'trick'); + var dme=ai.get.damageEffect(target,player,target); + target.chooseToDiscard('he',true,'星坠:请弃置一张牌(若不是'+get.translation(event.type)+'牌则受到1点伤害)').ai=function(card){ + var val=ai.get.value(card); + if(get.type(card,'trick')==event.type){ + return -dme-ai.get.value(card); + } + return -ai.get.value(card); + } + } + "step 1" + if(result.bool){ + if(get.type(result.cards[0],'trick')!=event.type){ + target.damage(); + } + } + }, + ai:{ + order:9, + result:{ + target:function(player,target){ + return ai.get.damageEffect(target,player)-0.1; + } + }, + threaten:2, + expose:0.2 + } + }, + lingxian:{ + trigger:{player:['respond','useCard']}, + direct:true, + filter:function(event,player){ + if(player==_status.currentPhase) return false; + if(get.itemtype(event.cards)!='cards') return false; + for(var i=0;i1&&player!=game.players[i]){ + return true; + } + } + return false; + }, + content:function(){ + "step 0" + player.chooseTarget('是否发动【凌仙】?',function(card,player,target){ + return get.distance(player,target,'attack')>1&&player!=target; + }).ai=function(target){ + var att=ai.get.attitude(player,target); + if(att<=-0.5) return 0; + if(att<=3) return att+0.5; + return att+Math.min(0.5,5-target.num('h')); + } + "step 1" + if(result.bool){ + game.asyncDraw([player,result.targets[0]]); + player.logSkill('lingxian',result.targets); + } + }, + ai:{ + mingzhi:false, + effect:{ + target:function(card,player,target){ + if(get.type(card)=='equip'&&player==target){ + var distance=get.info(card).distance; + if(distance){ + if(distance.attackFrom<0||distance.globalFrom<0) return 0; + } + } + else{ + var hs=target.num('h'); + if(get.tag(card,'respondShan')){ + var shans=target.num('h','shan'); + if(shans>1) return [0,1]; + if(shans&&hs>2) return [0,1]; + if(shans) return [0,0]; + if(hs>2) return [0,0]; + if(hs>1) return [1,0.5]; + return [1.5,0]; + } + if(get.tag(card,'respondSha')){ + var shas=target.num('h','sha'); + if(shas>1) return [0,1]; + if(shas&&hs>2) return [0,1]; + if(shas) return [0,0]; + if(hs>2) return [0,0]; + if(hs>1) return [1,0.5]; + return [1.5,0]; + } + } + } + }, + threaten:0.8, + expose:0.1 + } + }, + shouyin:{ + unique:true, + enable:'chooseToUse', + init:function(player){ + player.storage.shouyin=false; + }, + mark:true, + filter:function(event,player){ + if(event.type!='dying') return false; + if(player.storage.shouyin) return false; + if(player.isTurnedOver()) return false; + return true; + }, + content:function(){ + "step 0" + player.unmarkSkill('shouyin'); + player.storage.shouyin=true; + player.turnOver(); + "step 1" + event.targets=game.players.slice(0); + event.targets.sort(lib.sort.seat); + "step 2" + if(event.targets.length){ + var target=event.targets.shift(); + if(target.hp0){ + num+=del; + } + else if(att<0){ + num-=del; + } + } + return num; + } + } + }, + intro:{ + content:'limited' + } + }, + sliufeng:{ + mod:{ + targetInRange:function(card,player,target){ + if(card.name=='sha'&&player.hp>=target.hp){ + return true; + } + } + }, + }, + linyun:{ + enable:'chooseToUse', + filterCard:true, + selectCard:2, + position:'he', + viewAs:{name:'sha'}, + prompt:'将两张牌当杀使用', + check:function(card){ + if(_status.event.player.num('h')<4) return 6-ai.get.useful(card); + return 7-ai.get.useful(card); + }, + ai:{ + order:function(){ + return lib.card.sha.ai.order+0.1; + } + }, + group:['linyun2','linyun3'] + }, + linyun2:{ + trigger:{player:'shaBegin'}, + filter:function(event){ + return event.skill=='linyun' + }, + forced:true, + popup:false, + content:function(){ + "step 0" + var next=trigger.target.chooseToRespond({name:'shan'}); + next.autochoose=lib.filter.autoRespondShan; + next.ai=function(card){ + if(trigger.target.num('h','shan')>1){ + return ai.get.unuseful2(card); + } + return -1; + }; + "step 1" + if(result.bool==false){ + trigger.untrigger(); + trigger.directHit=true; + } + }, + ai:{ + threaten:1.3 + } + }, + linyun3:{ + trigger:{source:'damageAfter'}, + forced:true, + popup:false, + filter:function(event,player){ + return event.parent.skill=='linyun'&&!player.skills.contains('linyun4'); + }, + content:function(){ + player.draw(); + player.addTempSkill('linyun4','shaAfter') + } + }, + linyun4:[], + bofeng:{ + mod:{ + targetInRange:function(card,player,target){ + if(card.name=='sha'&&player.hp>=target.hp){ + return true; + } + } + }, + trigger:{player:'shaBegin'}, + check:function(event,player){ + return ai.get.attitude(player,event.target)<0; + }, + content:function(){ + "step 0" + trigger.target.chooseToRespond({name:'shan'}); + "step 1" + if(result.bool==false){ + trigger.untrigger(); + trigger.directHit=true; + player.addTempSkill('bofeng2','shaEnd'); + } + }, + ai:{ + threaten:1.3 + } + }, + bofeng2:{ + trigger:{source:'damageBegin'}, + filter:function(event){ + return (event.card&&(event.card.name=='sha')&&event.parent.name!='_lianhuan'&&event.parent.name!='_lianhuan2'); + }, + forced:true, + popup:false, + content:function(){ + trigger.num++; + }, + }, + hutian:{ + trigger:{player:'phaseEnd'}, + direct:true, + filter:function(event,player){ + return player.num('h')>0&&!player.storage.hutian; + }, + content:function(){ + "step 0" + var next=player.chooseCardTarget({ + filterTarget:function(card,player,target){ + return target.maxHp>=ui.selected.cards.length; + }, + filterCard:true, + selectCard:[1,Infinity], + ai1:function(card){ + if(ui.selected.cards.length==0&&player.hp==1) return 11-ai.get.value(card); + if(ui.selected.cards.length>1) return 0; + return 7-ai.get.useful(card); + }, + ai2:function(target){ + if(target.hp>ui.selected.cards.length){ + return 0; + } + return ai.get.attitude(player,target); + }, + prompt:'是否发动【护天】?' + }); + "step 1" + if(result.bool){ + var target=result.targets[0]; + event.target=target; + player.$give(result.cards,target); + player.lose(result.cards,ui.special); + player.storage.hutian=target; + player.logSkill('hutian',result.targets); + player.addTempSkill('hutian4','phaseAfter'); + target.addSkill('hutian2'); + target.storage.hutian2=result.cards; + } + else{ + event.finish(); + } + "step 2" + var target=event.target; + if(target.storage.hutian2&&target.hp0; + }, + filter:function(event,player){ + return event.source&&event.card&&event.card.name=='sha'&&event.source!=player; + }, + content:function(){ + trigger.source.draw(); + }, + ai:{ + expose:0.1, + threaten:1.2 + } + }, + huanxing:{ + trigger:{player:'phaseBegin'}, + group:'huanxing2', + direct:true, + filter:function(event,player){ + return player.num('he')>0; + }, + content:function(){ + "step 0" + player.unmark(player.storage.huanxing+'_charactermark'); + delete player.storage.huanxing; + delete player.additionalSkills.huanxing; + player.checkMarks(); + player.chooseCardTarget({ + prompt:'是否发动【幻形】?', + filterCard:true, + position:'he', + filterTarget:function(card,player,target){ + if(target==player) return false; + if(target.sex!='male') return false; + var name=target.name.indexOf('unknown')==0?target.name2:target.name; + + var info=lib.character[name]; + if(info){ + var skills=info[3]; + for(var j=0;j_status.event.player.hp){ + return 5-ai.get.value(card) + } + return 0; + }, + }, + suiyan:{ + trigger:{source:'damageEnd'}, + // group:'unequip', + check:function(event,player){ + return ai.get.attitude(player,event.player)<0; + }, + direct:true, + filter:function(event,player){ + return event.player.num('e'); + }, + content:function(){ + "step 0" + var att=ai.get.attitude(player,trigger.player); + player.chooseToDiscard('he','是否发动【碎岩】?').ai=function(card){ + if(att<0) return 7-ai.get.value(card); + return -1; + } + "step 1" + if(result.bool){ + player.logSkill('suiyan',trigger.player); + trigger.player.discard(trigger.player.get('e')); + } + }, + ai:{ + expose:0.3 + }, + }, + ningxian:{ + trigger:{player:'damageEnd'}, + direct:true, + filter:function(event,player){ + return player.num('he',{color:'black'})>0; + }, + content:function(){ + "step 0" + var enemy=0; + for(var i=0;i0){ + enemy++; + } + } + var next=player.chooseCardTarget({ + position:'he', + filterTarget:function(card,player,target){ + return player!=target; + }, + selectCard:[1,player.num('he',{color:'black'})], + selectTarget:function(){ + if(ui.selected.targets.length>ui.selected.cards.length){ + game.uncheck('target'); + } + return ui.selected.cards.length; + }, + filterCard:{color:'black'}, + ai1:function(card){ + if(ui.selected.cards.length>=enemy) return 0; + return 9-ai.get.value(card); + }, + ai2:function(target){ + return ai.get.damageEffect(target,player,player); + }, + prompt:'是否发动【凝霰】?' + }); + "step 1" + if(result.bool){ + player.discard(result.cards); + player.logSkill('ningxian',result.targets); + event.targets=result.targets; + event.targets.sort(lib.sort.seat); + } + else{ + event.finish(); + } + "step 2" + if(event.targets.length){ + event.targets.shift().damage(); + event.redo(); + } + }, + ai:{ + maixie:true, + effect:function(card,player,target){ + if(get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-0.5]; + if(player.num('h')>2||player.num('e',{color:'black'})){ + return [1,0,0,-1]; + } + return [1,-0.5]; + } + }, + } + }, + xuanyuan:{}, + jilve:{ + enable:'phaseUse', + group:'jilve6', + direct:true, + // usable:3, + delay:0, + content:function(){ + "step 0" + player.getStat('skill').jilve--; + var cards=[]; + var max=Math.min(2,ui.cardPile.childNodes.length); + for(var i=0;i=4) return [1,1.5]; + if(target.hp==3) return [1,1]; + if(target.hp==2) return [1,0.5]; + } + } + } + } + }, + pozhou2:{ + trigger:{global:'phaseBegin'}, + priority:-5, + check:function(event,player){ + return ai.get.attitude(player,event.player)<-3; + }, + filter:function(event,player){ + return player.storage.pozhou>0&&player!=event.player; + }, + prompt:function(event,player){ + return '是否弃置一枚破咒标记令'+get.translation(event.player)+ + '的非锁定技失效?(剩余'+player.storage.pozhou+'枚)'; + }, + content:function(){ + player.storage.pozhou--; + if(!player.storage.pozhou){ + player.unmarkSkill('pozhou'); + } + var target=trigger.player; + target.disabledSkills.pozhou=[]; + for(var i=0;i=1; + }, + filterTarget:function(card,player,target){ + return player!=target&&!target.isTurnedOver(); + }, + content:function(){ + "step 0" + event.targets=[]; + event.num=0; + for(var i=0;i1){ + return 12-ai.get.equipValue(card); + } + return 8-ai.get.equipValue(card); + }, + filter:function(event,player){ + return player.num('he',{type:'equip'}); + }, + filterTarget:function(card,player,target){ + return player!=target; + }, + content:function(){ + "step 0" + target.damage(); + "step 1" + if(target.isAlive()){ + var cards=target.get('h'); + event.num=cards.length; + target.discard(cards); + } + else{ + event.finish(); + } + "step 2" + if(event.num>2){ + player.loseHp(); + } + }, + ai:{ + order:9, + expose:0.2, + result:{ + target:function(player,target){ + if(ai.get.damageEffect(target,player)<0){ + return -target.num('h')-(target.hp==1?1:0); + } + } + } + } + }, + mojian:{ + trigger:{player:'shaBegin'}, + check:function(event,player){ + if(ai.get.attitude(player,event.target)>0) return true; + return player.hp0){ + player.stat[player.stat.length-1].card.sha--; + } + }, + group:'poyue2' + }, + poyue2:{ + trigger:{player:'shaBegin'}, + forced:true, + popup:false, + filter:function(event,player){ + return event.card&&get.color(event.card)=='red'; + }, + content:function(){ + trigger.directHit=true; + } + }, + jianji:{ + enable:'phaseUse', + filter:function(event,player){ + return player.num('he',{type:'equip'})>0&&lib.filter.cardEnabled({name:'sha'},player); + }, + usable:1, + filterCard:{type:'equip'}, + position:'he', + check:function(card){ + var player=_status.currentPhase; + if(player.num('he',{subtype:get.subtype(card)})>1){ + return 11-ai.get.equipValue(card); + } + return 6-ai.get.equipValue(card); + }, + discard:false, + prepare:function(cards,player){ + player.$throw(cards); + }, + delay:false, + filterTarget:function(card,player,target){ + return lib.filter.targetEnabled({name:'sha'},player,target); + }, + content:function(){ + "step 0" + if(!player.skills.contains('unequip')){ + event.added=true + player.skills.push('unequip'); + } + player.draw(); + player.useCard({name:'sha'},cards,targets,'jianji',false).animate=false; + "step 1" + if(event.added){ + player.skills.remove('unequip'); + } + }, + ai:{ + order:function(){ + return lib.card.sha.ai.order+0.1; + }, + result:{ + target:function(player,target){ + var added=false; + if(!player.skills.contains('unequip')){ + added=true; + player.skills.push('unequip'); + } + var eff=ai.get.effect(target,{name:'sha'},player,target); + if(added){ + player.skills.remove('unequip'); + } + return eff; + } + }, + effect:{ + player:function(card,player){ + if(_status.currentPhase!=player) return; + if(get.type(card)=='equip'&& + player.num('e',{subtype:get.subtype(card)})&& + lib.filter.filterCard({name:'sha'},player)){ + return 0; + } + } + }, + threaten:1.3 + } + }, + huangyu:{ + enable:'phaseUse', + filter:function(event,player){ + return !player.getStat('skill').huangyu&&player.num('he',{color:'red'})>1; + }, + filterCard:{color:'red'}, + selectCard:2, + position:'he', + viewAs:{name:'chiyuxi',nature:'fire'}, + check:function(card){ + var player=_status.event.player; + if(player.skills.contains('jianji')&&get.type(card)=='equip'&& + lib.filter.filterCard({name:'sha'},player)){ + return 0; + } + return 6-ai.get.value(card) + }, + ai:{ + order:8, + expose:0.2, + threaten:1.2 + } + }, + gongshen:{ + trigger:{global:'useCard'}, + priority:15, + filter:function(event,player){ + var type=get.type(event.card,'trick'); + if(type!='basic'&&type!='trick') return false; + return event.player!=player&&player.num('he',{type:'equip'})>0&& + event.targets&&event.targets.length>0; + }, + direct:true, + content:function(){ + "step 0" + var effect=0; + for(var i=0;itrigger.targets[0].hp) return val; + if(nme=='sha'&&trigger.targets[0].hp==1&&!trigger.targets[0].num('h','shan')) return val; + if(nme=='jiedao'&&trigger.targets[0]==player) return val; + if(nme=='yihuajiemu'&&trigger.targets[0]==player) return val; + if(nme=='shuiyanqijun'&&trigger.targets.contains(player)) return val; + return 0; + } + return -1; + } + "step 1" + if(result.bool){ + game.delay(); + trigger.untrigger(); + trigger.finish(); + player.logSkill('gongshen'); + } + }, + ai:{ + effect:{ + player:function(card,player,target){ + if(player!=target) return; + if(get.type(card)=='equip'&&player.num('h')<=player.hp){ + return [0,0,0,0]; + } + } + }, + threaten:2, + expose:0.3 + } + }, + xiaozhan:{ + trigger:{global:'useCard'}, + priority:15, + filter:function(event,player){ + return event.card.name=='sha'&&event.player!=player&& + player.num('h','sha')>0&&event.targets.contains(player)==false; + }, + direct:true, + content:function(){ + "step 0" + var effect=0; + for(var i=0;i0; + }, + selectCard:2, + filterCard:true, + discard:false, + prepare:function(cards,player,targets){ + player.$throw(cards); + }, + filterTarget:function(card,player,target){ + return lib.filter.targetEnabled({name:'juedou'},player,target); + }, + check:function(card){ + return Math.max(7-ai.get.value(card),7-ai.get.useful(card)); + }, + content:function(){ + player.useCard({name:'juedou'},targets,cards).animate=false; + }, + ai:{ + result:{ + target:function(player,target){ + return ai.get.effect(target,{name:'juedou'},player,target); + } + }, + order:8, + } + }, + yiesheng:{ + enable:'phaseUse', + filterCard:{color:'black'}, + filter:function(event,player){ + return player.num('h',{color:'black'})>0; + }, + selectCard:[1,Infinity], + prompt:'弃置任意张黑色手牌并摸等量的牌', + check:function(card){return 5-ai.get.value(card)}, + content:function(){ + player.draw(cards.length); + }, + ai:{ + order:1, + result:{ + player:1 + }, + }, + }, + dangping:{ + trigger:{source:'damageAfter'}, + direct:true, + filter:function(event,player){ + return event.parent.name!='dangping'&&!player.skills.contains('dangping2'); + }, + content:function(){ + "step 0" + var next=player.chooseCardTarget({ + position:'he', + filterTarget:function(card,player,target){ + return player!=target&&trigger.player!=target&&get.distance(trigger.player,target)<=1; + }, + filterCard:true, + ai1:function(card){ + return ai.get.unuseful(card)+9; + }, + ai2:function(target){ + return ai.get.damageEffect(target,player,player); + }, + prompt:'是否发动【荡平】?' + }); + "step 1" + if(result.bool){ + player.discard(result.cards); + player.logSkill('dangping',result.targets); + player.addTempSkill('dangping2','phaseAfter'); + } + "step 2" + if(result.bool){ + result.targets[0].damage(); + } + } + }, + dangping2:{}, + duishi:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.num('h')>0 + }, + filterTarget:function(card,player,target){ + return player!=target&&target.num('he'); + }, + filterCard:true, + check:function(card){return 8-ai.get.value(card)}, + content:function(){ + "step 0" + var suit=get.suit(cards[0]); + target.chooseToDiscard({suit:suit},'弃置一张'+get.translation(suit)+ + '牌,或令'+get.translation(player)+'获得你的一张牌').ai=function(card){ + if(ai.get.attitude(target,player)>0){ + return -1; + } + return 11-ai.get.value(card); + } + + "step 1" + if(!result.bool){ + if(target.num('he')){ + player.gainPlayerCard(target,'he',true,ai.get.buttonValue); + } + } + }, + ai:{ + order:9, + threaten:1.5, + result:{ + target:-2, + player:0.5 + }, + expose:0.2 + } + }, + guisi:{ + trigger:{target:'shaBefore'}, + popup:false, + direct:true, + filter:function(event,player){ + return player.num('h'); + }, + content:function(){ + "step 0" + player.chooseCard('是否交给'+get.translation(trigger.player)+'一张牌并取消此杀?').ai=function(card){ + if(ai.get.attitude(player,trigger.player)>0){ + return 9-ai.get.value(card); + } + if(player.num('h',{name:'shan'})) return -1; + return 7-ai.get.value(card); + } + "step 1" + if(result.bool){ + player.logSkill('guisi'); + trigger.player.gain(result.cards); + player.$give(result.cards,trigger.player); + trigger.untrigger(); + trigger.finish(); + } + }, + }, + lianwu:{ + mod:{ + selectTarget:function(card,player,range){ + if(card.name=='sha'&&range[1]!=-1) range[1]++; + }, + }, + trigger:{player:'shaBegin'}, + forced:true, + filter:function(event,player){ + return event.card&&get.color(event.card)=='red'; + }, + content:function(){ + trigger.directHit=true; + } + }, + mingfu:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.num('he',{suit:'club'})>0; + }, + position:'he', + filterCard:{suit:'club'}, + discard:false, + prepare:function(cards,player,targets){ + player.$throw(cards); + }, + filterTarget:function(card,player,target){ + return lib.filter.targetEnabled({name:'guiyoujie'},player,target); + }, + check:function(card){ + return Math.max(7-ai.get.value(card),7-ai.get.useful(card)); + }, + content:function(){ + target.addJudge('guiyoujie',cards); + }, + ai:{ + result:{ + target:function(player,target){ + return ai.get.effect(target,{name:'guiyoujie'},player,target); + } + }, + order:8, + } + }, + mufeng:{ + priority:9, + // mod:{ + // globalTo:function(from,to,distance){ + // return distance+1; + // } + // }, + filter:function(event,player){ + return event.player!=player&&event.targets&&event.targets.length>1; + }, + check:function(event,player){ + return get.tag(event.card,'multineg')||ai.get.effect(player,event.card,event.player,player)<=0; + }, + trigger:{target:'useCardToBefore'}, + content:function(){ + trigger.untrigger(); + trigger.finish(); + player.draw(); + }, + ai:{ + effect:{ + target:function(card){ + if(card.name=='tiesuo') return [0,0]; + if(card.name=='yihuajiemu') return [0,1]; + if(get.tag(card,'multineg')) return [0,2]; + } + } + } + }, + jiying:{ + // trigger:{player:'respond'}, + // filter:function(event,player){ + // return event.card.name=='shan'&& + // player.num('h','sha')>0&&_status.currentPhase!=player; + // }, + // direct:true, + // content:function(){ + // player.chooseToUse('是否发动【疾鹰】?',{name:'sha'}); + // }, + mod:{ + targetInRange:function(card){ + if(card.name=='sha') return true; + } + }, + // ai:{ + // effect:{ + // target:function(card,player,target,current){ + // if(get.tag(card,'respondShan')&&target.num('h')) return 0.8; + // } + // } + // } + }, + minjing:{ + trigger:{player:'damageBegin'}, + forced:true, + filter:function(event,player){ + if(player.get('e','2')) return false; + if(event.source&&event.source.num('s','unequip')) return; + if(Math.random()>1/3) return false; + return true; + }, + content:function(){ + trigger.num--; + }, + ai:{ + threaten:0.8 + } + }, + touxi:{ + trigger:{global:'phaseEnd'}, + check:function(event,player){ + return ai.get.damageEffect(event.player,player,player,'thunder')>0; + }, + filter:function(event,player){ + return event.player!=player&&!player.skills.contains('touxi2'); + }, + content:function(){ + "step 0" + player.line(trigger.player,'thunder'); + player.judge(function(card){ + if(get.color(card)=='black') return 1; + return -1; + }); + "step 1" + if(result.bool){ + trigger.player.damage('thunder'); + player.draw(); + player.addSkill('touxi2'); + event.finish(); + } + else{ + if(player.num('he')){ + trigger.player.discardPlayerCard(player,'he',true,ai.get.buttonValue); + } + } + }, + ai:{ + expose:0.3, + threaten:1.2 + } + }, + touxi2:{ + trigger:{player:'phaseBegin'}, + forced:true, + popup:false, + content:function(){ + player.removeSkill('touxi2'); + } + }, + lianji:{ + enable:'phaseUse', + usable:1, + filterTarget:function(card,player,target){ + if(player==target) return false; + return target.num('h')>0; + }, + selectTarget:2, + multitarget:true, + multiline:true, + prepare:function(cards,player,targets){ + player.$throw(cards); + player.line(targets); + }, + discard:false, + filterCard:true, + check:function(card){ + return 6-ai.get.value(card); + }, + content:function(){ + "step 0" + if(!player.storage.lianji){ + player.storage.lianji=[]; + } + if(targets[0].num('h')&&targets[1].num('h')){ + targets[0].chooseToCompare(targets[1]); + player.storage.lianji.add(targets[0]); + player.storage.lianji.add(targets[1]); + } + else{ + event.finish(); + } + "step 1" + if(result.bool){ + targets[0].gain(cards); + targets[0].$gain2(cards); + targets[1].damage(targets[0]); + } + else{ + targets[1].gain(cards); + targets[1].$gain2(cards); + targets[0].damage(targets[1]); + } + if(!player.skills.contains('yinmo')){ + event.finish(); + } + "step 2" + for(var i=0;i=player.maxHp-1) return [0,0]; + } + } + } + }, + moyan:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.hp0; + }, + filterTarget:function(card,player,target){ + return player!=target;//&&get.distance(player,target,'attack')<=1; + }, + selectTarget:function(){ + return ui.selected.cards.length; + }, + selectCard:function(){ + var player=_status.currentPhase; + return [1,Math.min(game.players.length-1,player.maxHp-player.hp)]; + }, + filterCard:function(card){ + return get.color(card)=='red'; + }, + check:function(card){ + if(ui.selected.cards.length==0){ + return 8-ai.get.value(card); + } + return 6-ai.get.value(card); + }, + line:'fire', + content:function(){ + "step 0" + target.damage('fire'); + "step 1" + // target.draw(); + }, + ai:{ + order:9, + result:{ + target:function(player,target){ + return ai.get.damageEffect(target,player,target,'fire'); + } + }, + threaten:function(player,target){ + if(target.hp==1) return 2; + if(target.hp==2) return 1.5; + return 0.5; + }, + maixie:true, + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(target.hp==target.maxHp) return [0,1]; + } + if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0]; + } + } + } + }, + shejie:{ + trigger:{player:'damageEnd'}, + priority:9, + check:function(event,player){ + return ai.get.attitude(player,event.source)<0; + }, + filter:function(event){ + return event&&event.source; + }, + content:function(){ + trigger.source.addSkill('shejie2'); + }, + ai:{ + threaten:0.4 + } + }, + shejie2:{ + unique:true, + trigger:{player:'phaseBegin'}, + forced:true, + priority:10, + mod:{ + cardEnabled:function(){ + return false; + }, + cardUsable:function(){ + return false; + }, + cardRespondable:function(){ + return false; + }, + cardSavable:function(){ + return false; + } + }, + content:function(){ + player.removeSkill('shejie2') + }, + }, + guiyin:{ + trigger:{player:'phaseDiscardEnd'}, + frequent:true, + filter:function(event,player){ + return event.cards&&event.cards.length>1 + }, + content:function(){ + player.draw(2); + }, + }, + swdqinyin:{ + trigger:{player:'phaseEnd'}, + direct:true, + filter:function(event,player){ + return !player.getStat('damage'); + }, + content:function(){ + "step 0" + var recover=0,lose=0; + for(var i=0;i0){ + if(game.players[i].hp<2){ + lose--; + recover+=0.5; + } + lose--; + recover++; + } + else if(ai.get.attitude(player,game.players[i])<0){ + if(game.players[i].hp<2){ + lose++; + recover-=0.5; + } + lose++; + recover--; + } + } + else{ + if(ai.get.attitude(player,game.players[i])>0){ + lose--; + } + else if(ai.get.attitude(player,game.players[i])<0){ + lose++; + } + } + } + } + player.chooseControl('失去体力','回复体力','cancel').ai=function(){ + // console.log(lose,recover); + if(lose>recover&&lose>0) return 0; + if(lose0) return 1; + return 2; + } + "step 1" + if(result.bool==false||result.control=='cancel'){ + event.finish(); + } + else{ + player.logSkill('swdqinyin'); + event.bool=(result.control=='回复体力'); + event.num=0; + event.players=game.players.slice(0); + } + "step 2" + if(event.num0; + }, + content:function(){ + "step 0" + player.chooseCard('请选择替换判定的牌','he').ai=function(card){ + var trigger=_status.event.parent._trigger; + var player=_status.event.player; + var result=trigger.judge(card)-trigger.judge(trigger.player.judging); + var attitude=ai.get.attitude(player,trigger.player); + if(attitude==0||result==0) return 0; + if(attitude>0){ + return result; + } + else{ + return -result; + } + }; + "step 1" + if(result.bool){ + player.respond(result.cards); + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + player.logSkill('tiandao'); + player.$gain2(trigger.player.judging); + player.gain(trigger.player.judging); + trigger.player.judging=result.cards[0]; + trigger.position.appendChild(result.cards[0]); + game.log(get.translation(trigger.player)+'的判定牌改为'+get.translation(result.cards[0])); + } + "step 3" + game.delay(2); + }, + ai:{ + tag:{ + rejudge:1 + }, + threaten:1.5 + } + }, + yihua:{ + trigger:{target:'useCardToBefore'}, + popup:false, + direct:true, + filter:function(event,player){ + // return event.card&&get.color(event.card)=='red'&&event.player!=player; + return event.targets.length==1&&event.player!=player&&player.num('h')>=2; + }, + content:function(){ + "step 0" + player.chooseToDiscard('是否弃置两张手牌将'+get.translation(trigger.card)+'反弹?',2).ai=function(card){ + if(ai.get.effect(player,trigger.card)<0) return 4-ai.get.value(card); + return 0; + } + "step 1" + if(result.bool){ + // player.discard(result.cards); + player.logSkill('yihua'); + trigger.target=trigger.player; + trigger.player=player; + trigger.untrigger(); + trigger.trigger('useCardToBefore'); + } + // "step 2" + // if(result.bool){ + // trigger.target=result.targets[0]; + // trigger.untrigger; + // trigger.trigger('shaBefore'); + // game.delay(); + // } + }, + ai:{ + threaten:function(player,target){ + if(target.num('h')<=2){ + return 2; + } + return 2/(target.num('h')-1); + } + } + }, + youyin:{ + trigger:{global:'discardAfter'}, + filter:function(event,player){ + if(event.player==player) return false; + if(player.num('h')>=5) return false; + for(var i=0;i=target.maxHp) return false; + return true; + }, + selectTarget:[1,3], + content:function(){ + target.recover(); + }, + ai:{ + order:10, + result:{ + target:function(player,target){ + if(player==target&&player.num('h')>player.hp) return 20; + return ai.get.recoverEffect(target,player,target); + } + }, + threaten:2 + } + }, + huopu:{ + enable:'phaseUse', + filterCard:function(card){ + return get.suit(card)=='heart'; + }, + viewAs:{name:'liuxinghuoyu'}, + prompt:'将一张红桃手牌当作流星火羽使用', + check:function(card){return 6-ai.get.value(card)}, + ai:{ + threaten:1.4 + } + }, + rexue:{ + trigger:{global:'phaseBegin'}, + direct:true, + filter:function(event,player){ + return lib.filter.targetEnabled({name:'sha'},player,event.player)&&!lib.filter.autoRespondSha.call({player:player}); + }, + content:function(){ + "step 0" + player.chooseToUse({name:'sha'},'是否对'+get.translation(trigger.player)+'使用一张杀',trigger.player); + "step 1" + if(result.bool){ + player.logSkill('rexue'); + player.draw(); + } + } + }, + shengshou:{ + enable:'phaseUse', + filterCard:function(card){ + return get.color(card)=='black'; + }, + viewAs:{name:'caoyao'}, + prompt:'将一张黑色手牌当作草药使用', + check:function(card){return 6-ai.get.value(card)}, + ai:{ + threaten:1.6 + } + }, + huanjian:{ + enable:'phaseUse', + filterCard:function(card){ + return get.color(card)=='black'; + }, + viewAs:{name:'dujian'}, + prompt:'将一张黑色手牌当作毒箭使用', + check:function(card){return 5-ai.get.value(card)}, + ai:{ + threaten:1.6 + } + }, + benlei:{ + enable:'phaseUse', + viewAs:{name:'jingleishan',nature:'thunder'}, + filterCard:function(card,player){ + return true; + }, + selectCard:3, + position:'he', + prompt:'将三张牌当作惊雷闪使用', + check:function(card){ + return 4-ai.get.value(card); + }, + group:'benlei2', + ai:{ + basic:{ + order:10 + } + } + }, + benlei2:{ + trigger:{source:'damageAfter'}, + filter:function(event,player){ + return event.nature=='thunder'&&player.hp3; + }, + filter:function(event,player){ + return player.num('h')>0; + }, + content:function(){ + "step 0" + player.chooseToDiscard('是否发动苏生?').ai=ai.get.unuseful2; + "step 1" + if(result.bool){ + // player.chooseToDiscard('h',true); + trigger.untrigger(); + trigger.finish(); + trigger.player.hp=1; + if(trigger.player.maxHp<1) trigger.player.maxHp=1; + trigger.player.update(); + player.logSkill('susheng'); + } + + }, + ai:{ + threaten:2 + } + }, + kunlunjing:{ + unique:true, + group:['kunlunjing1','kunlunjing2'], + intro:{ + content:function(storage,player){ + return player.storage.kunlunjing3; + + for(var i=0;i0){ + num+=num2; + } + else if(att<0){ + num-=num2; + } + } + } + return num>Math.min(3,game.players.length); + }, + content:function(){ + "step 0" + event.player.storage.kunlunjing2=true; + ui.arena.classList.add('zoomout3'); + ui.arena.delete(); + ui.arena.hide(); + game.delay(0,500); + "step 1" + var storage=event.player.storage.kunlunjing; + var player,frag; + var i,j; + for(i=0;i0 + }, + filterTarget:function(card,player,target){ + return player!=target + }, + filterCard:function(card,player){ + if(ui.selected.cards.length){ + return get.suit(card)==get.suit(ui.selected.cards[0]); + } + var cards=player.get('h'); + for(var i=0;i0 + }, + filterTarget:function(card,player,target){ + return player!=target + }, + filterCard:function(card,player){ + if(ui.selected.cards.length){ + return get.suit(card)==get.suit(ui.selected.cards[0]); + } + var cards=player.get('h'); + for(var i=0;i0; + }, + filterTarget:function(card,player,target){ + return player!=target&&target.num('he')>0; + }, + filterCard:function(card){ + var suit=get.suit(card); + for(var i=0;ilength) return -1.5+eff; + return -1+eff; + } + }, + expose:0.2 + } + }, + liaoyuan:{ + trigger:{player:'shaAfter'}, + direct:true, + filter:function(event,player){ + if(get.itemtype(event.cards)!='cards') return false; + if(player.num('he',{suit:get.suit(event.cards)})>0){ + for(var i=0;i0){ + return 7-ai.get.value(card); + } + } + "step 1" + if(result.bool){ + player.logSkill('liaoyuan'); + if(result.cards[0].name=='sha'){ + player.useCard(result.cards,trigger.targets); + } + else{ + player.useCard({name:'sha'},result.cards,trigger.targets); + } + } + } + }, + + dunxing:{ + mod:{ + targetEnabled:function(card,player,target){ + if(_status.currentPhase==player&&target.hp0; + }).ai=function(target){ + return -ai.get.attitude(player,target); + }; + "step 1" + if(result.bool){ + player.logSkill('xuanfeng2',result.targets); + player.discardPlayerCard(result.targets[0],'he',true); + } + }, + }, + meihuo:{ + trigger:{player:['loseEnd']}, + direct:true, + filter:function(event,player){ + if(player.equiping) return false; + if(player.num('e')) return false; + for(var i=0;i0; + }).ai=function(target){ + var att=ai.get.attitude(player,target); + if(att<=0){ + return 1-att+(target.num('e')?2:0); + } + return 0; + }; + "step 1" + if(result.bool){ + event.target=result.targets[0]; + player.logSkill('meihuo',event.target); + player.choosePlayerCard(event.target,'he',true).ai=function(button){ + var card=button.link; + if(get.position(card)=='e') return ai.get.equipValue(card); + return 5; + }; + } + "step 2" + if(result.bool){ + if(get.position(result.buttons[0].link)=='e'){ + player.equip(result.buttons[0].link); + } + else{ + player.gain(result.buttons[0].link); + } + event.target.$give(1,player); + game.delay(); + } + }, + }, + yuhuo:{ + enable:'chooseToUse', + filter:function(event,player){ + if(event.type!='dying') return false; + if(player!=_status.dying) return false; + if(player.storage.yuhuo) return false; + }, + content:function(){ + player.maxHp--; + player.hp=player.maxHp; + player.discard(player.get('hej')); + if(player.classList.contains('linked')) player.link(); + if(player.classList.contains('turnedover')) player.turnOver(); + player.storage.yuhuo=true; + // player.addSkill('guanhong'); + // player.addSkill('yishan2'); + player.update(); + }, + ai:{ + result:{ + player:10 + }, + threaten:function(player,target){ + if(!target.storage.yuhuo) return 0.8; + } + }, + init:function(player){ + player.storage.yuhuo=false; + }, + intro:{ + content:'limited' + } + }, + yishan:{ + group:'yishan2', + trigger:{player:'damageEnd'}, + filter:function(event,player){ + var content=player.storage.yishan; + for(var i=0;i最近失去的牌'); + var cards=[]; + for(var i=0;i=4) break; + } + } + if(cards.length){ + dialog.add(cards); + } + else{ + dialog.add('(无)'); + } + }, + content:function(content,player){ + var str='最近失去的牌:'; + var cards=[]; + for(var i=0;i=4) break; + } + } + if(cards.length){ + str+=get.translation(cards); + } + else{ + str+='无'; + } + return str; + } + } + }, + yishan2:{ + trigger:{player:'loseEnd'}, + forced:true, + popup:false, + silent:true, + content:function(){ + for(var i=0;i1; + }, + content:function(){ + trigger.directHit=true; + } + }, + // poxing:{ + // trigger:{player:'shaEnd'}, + // frequent:true, + // filter:function(trigger,player){ + // // if(trigger.targets&&trigger.target!=trigger.targets[trigger.targets.length-1])return false; + // if(trigger.card&&trigger.card.skill=='poxing') return false; + // if(trigger.targets.length>1) return false; + // if(player.hp>trigger.target.hp) return false; + // if(trigger.target.classList.contains('dead')) return false; + // return true; + // // return (get.itemtype(trigger.card)=='card'&&player.hp<=trigger.target.hp&&trigger.target.classList.contains('dead')==false); + // }, + // content:function(){ + // player.useCard({ + // name:'sha', + // nature:trigger.card.nature, + // number:trigger.card.number, + // suit:trigger.card.suit, + // skill:'poxing' + // },trigger.targets); + // } + // }, + poxing:{ + trigger:{source:'damageBegin'}, + filter:function(trigger,player){ + return trigger.player.hp>player.hp; + }, + forced:true, + content:function(){ + trigger.num++; + } + }, + luomu:{ + trigger:{source:'damageEnd'}, + forced:true, + filter:function(event,player){ + return event.player.num('hej'); + }, + content:function(){ + trigger.player.discard(trigger.player.get('hej').randomGet()); + } + }, + huanhun:{ + trigger:{global:'dying'}, + priority:6, + filter:function(event,player){ + return event.player.hp<=0&&player.num('he')>0; + }, + direct:true, + content:function(){ + "step 0" + player.chooseToDiscard('he','是否发动【唤魂】?').ai=function(card){ + if(ai.get.attitude(player,trigger.player)>0){ + return 8-ai.get.value(card); + } + return 0; + }; + "step 1" + if(result.bool){ + player.logSkill('huanhun',trigger.player); + trigger.player.judge(function(card){ + return get.color(card)=='red'?1:-1; + }); + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + trigger.player.recover(); + } + }, + ai:{ + threaten:1.6, + expose:0.2 + } + }, + huanhun_old:{ + enable:'phaseUse', + forbid:['versus'], + filter:function(){ + return game.dead.length>0 + }, + usable:1, + filterCard:function(card){ + return get.suit(card)=='heart'; + }, + check:function(card){ + return 10-ai.get.value(card); + }, + direct:true, + content:function(){ + "step 0" + var list=[]; + for(var i=0;i2) return 3; + } + return 0; + } + }, + threaten:2, + } + }, + yinyue:{ + trigger:{global:'recoverAfter'}, + check:function(event,player){ + return ai.get.attitude(player,event.player)>0; + }, + prompt:function(event){ + return '是否对'+get.translation(event.player)+'发动【引月】?' + }, + content:function(){ + "step 0" + trigger.player.draw(); + "step 1" + if(player.num('h')=2) return 0; + if(ui.selected.cards.length==1){ + if(player.num('h')>player.hp){ + return 3-ai.get.value(card); + } + return 0; + } + return 6-ai.get.value(card); + }; + "step 1" + if(result.bool){ + player.logSkill('daixing'); + player.storage.daixing=result.cards.length; + player.markSkill('daixing'); + } + else{ + player.storage.daixing=0; + player.unmarkSkill('daixing'); + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return; + if(target.storage.daixing>1) return 0.1; + if(target.storage.daixing==1) return 0.5; + } + return 1.5; + } + } + }, + intro:{ + content:'mark' + } + }, + daixing2:{ + trigger:{player:'damageBegin'}, + filter:function(event,player){ + return player.storage.daixing>0; + }, + priority:-20, + popup:false, + forced:true, + content:function(){ + if(trigger.num>=player.storage.daixing){ + trigger.num-=player.storage.daixing; + player.storage.daixing=0; + player.unmarkSkill('daixing'); + } + else{ + player.storage.daixing-=trigger.num; + trigger.num=0; + } + player.popup('daixing'); + } + }, + swd_wuxie:{ + mod:{ + targetEnabled:function(card,player,target){ + if(get.type(card)=='delay'&&player!=target){ + return false; + } + } + } + }, + qingcheng:{ + trigger:{player:'phaseBegin'}, + frequent:true, + content:function(){ + "step 0" + if(event.cards==undefined) event.cards=[]; + player.judge(function(card){ + if(get.color(card)=='red') return 1.5; + return -1.5; + },ui.special); + "step 1" + if(result.judge>0){ + event.cards.push(result.card); + // if(event.cards.length==2){ + // player.gain(event.cards); + // event.finish(); + // } + // else + if(lib.config.auto_skill==false){ + player.chooseBool('是否再次发动?'); + } + else{ + event._result={bool:true}; + } + } + else{ + player.gain(event.cards); + event.finish(); + } + "step 2" + if(result.bool){ + event.goto(0); + } + else{ + player.gain(event.cards); + } + }, + ai:{ + threaten:1.4 + } + }, + lingxin:{ + trigger:{player:'phaseEnd'}, + frequent:true, + content:function(){ + "step 0" + event.cards=get.cards(Math.max(3,get.cardCount(true,player)+1)); + player.showCards(event.cards); + "step 1" + for(var i=0;i=3;; + }, + content:function(){ + player.phase(); + }, + ai:{ + order:-10, + result:{ + target:2 + } + } + }, + xianjiang:{ + enable:'phaseUse', + position:'he', + usable:1, + filterCard:function(card,player){ + if(player.storage.xianjiang&&player.storage.xianjiang.contains(card)) return false; + return get.type(card)=='equip'; + }, + init:function(player){ + player.storage.xianjiang=[]; + }, + check:function(card){ + return 10-ai.get.value(card); + }, + prompt:'将一张装备牌永久转化为任意一张装备牌', + content:function(){ + "step 0" + var list=[]; + var suit=get.suit(cards[0]); + var number=get.number(cards[0]); + for(var i in lib.card){ + if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; + if(lib.card[i].type=='equip'&&cards[0].name!=i){ + if(ai.get.equipValue({name:i})<10) list.push([suit,number,i]); + } + } + var dialog=ui.create.dialog([list,'vcard']); + player.chooseButton(dialog,true,function(button){ + return ai.get.value({name:button.link[2]},player); + }); + "step 1" + cards[0].init(result.buttons[0].link); + player.gain(cards[0]); + player.$gain(cards[0]); + game.delay(); + player.storage.xianjiang.add(cards[0]); + }, + ai:{ + order:9, + result:{ + player:1 + }, + threaten:2, + } + }, + xianjiang2:{ + trigger:{player:'phaseUseBegin'}, + forced:true, + popup:false, + filter:function(event,player){ + return player.skills.contains('xianjiang'); + }, + content:function(){ + player.storage.xianjiang=[]; + } + }, + xianjiang3:{ + enable:'phaseUse', + filterCard:function(card){ + return get.type(card,'trick')=='trick'; + }, + usable:1, + filter:function(event,player){return player.num('e')==0}, + selectCard:1, + check:function(card){ + return 8-ai.get.value(card); + }, + content:function(){ + for(var i=0;i0) return 0.6/player.num('he'); + return; + } + } + } + if(get.tag(card,'respondSha')){ + for(var i=0;i0) return 0.6/player.num('he'); + return; + } + } + } + } + } + }, + }, + huajian:{ + trigger:{player:'phaseUseEnd'}, + direct:true, + filter:function(event,player){ + return player.num('he')>0; + }, + content:function(){ + "step 0" + var next=player.chooseCardTarget({ + position:'he', + filterTarget:function(card,player,target){ + return lib.filter.targetEnabled({name:'sha'},player,target); + }, + filterCard:true, + ai1:function(card){ + return ai.get.unuseful(card)+9; + }, + ai2:function(target){ + return ai.get.effect(target,{name:'sha'},player); + }, + prompt:'是否发动【化剑】?' + }); + "step 1" + if(result.bool){ + player.logSkill('huajian'); + player.useCard({name:'sha'},result.cards,result.targets,false); + } + }, + ai:{ + expose:0.2, + } + }, + polang:{ + trigger:{source:'damageEnd'}, + // group:'unequip', + check:function(event,player){ + return ai.get.attitude(player,event.player)<0; + }, + filter:function(event,player){ + return event.player.num('e'); + }, + content:function(){ + trigger.player.discard(trigger.player.get('e')); + }, + ai:{ + expose:0.3 + }, + // mod:{ + // targetInRange:function(){ + // return true; + // } + // } + // group:'polang2' + }, + jikong:{ + trigger:{player:'loseEnd'}, + direct:true, + filter:function(event,player){ + if(player.num('h')) return false; + for(var i=0;iplayer.num('h'); + // }, + // content:function(){ + // player.draw(trigger.source.num('h')-player.num('h')); + // }, + // ai:{ + // effect:{ + // target:function(card,player,target){ + // if(get.tag(card,'damage')){ + // var num=player.num('h')-target.num('h'); + // if(num>0){ + // if(player.hp>=4) return [1,num]; + // if(target.hp==3) return [1,num*0.5]; + // if(target.hp==2) return [1,num*0.2]; + // } + // } + // } + // } + // } + // }, + jikong2:{ + trigger:{player:'phaseBegin'}, + direct:true, + // filter:function(event,player){ + // return player.num('he')>0; + // }, + content:function(){ + "step 0" + player.chooseTarget('是否发动【亟空】?',function(card,player,target){ + return lib.filter.targetEnabled({name:'sha',nature:'thunder'},player,target); + }).ai=function(target){ + return ai.get.effect(target,{name:'sha',nature:'thunder'},player); + } + "step 1" + if(result.bool){ + player.logSkill('jikong'); + player.useCard({name:'sha',nature:'thunder'},result.targets,false); + } + }, + ai:{ + expose:0.2, + } + }, + xielei:{ + trigger:{player:['useCard','respondAfter']}, + direct:true, + filter:function(event){ + return game.players.length>2&&event.card&&event.card.name=='sha'; + }, + content:function(){ + "step 0" + game.delay(0.5); + player.chooseTarget('是否发动【挟雷】?',function(card,player,target){ + if(player==target) return false; + if(trigger.name=='respond'){ + return trigger.source!=target; + } + else{ + return !trigger.targets.contains(target); + } + }).ai=function(target){ + return ai.get.damageEffect(target,player,player,'thunder'); + } + "step 1" + if(result.bool){ + player.logSkill('xielei',result.targets,'thunder'); + result.targets[0].damage('thunder'); + } + }, + ai:{ + expose:0.3, + threaten:1.6 + } + }, + ningjian:{ + group:['ningjian1','ningjian2'], + ai:{ + effect:{ + target:function(card,player,target){ + if(target.num('he')&&(get.tag(card,'respondShan')||get.tag(card,'respondSha'))) return 0.6 + } + }, + respondSha:true, + respondShan:true, + } + }, + ningjian1:{ + enable:['chooseToRespond','chooseToUse'], + filterCard:{color:'black'}, + viewAs:{name:'sha'}, + position:'he', + prompt:'将一张黑色牌当杀打出', + check:function(card){return 6-ai.get.value(card)} + }, + ningjian2:{ + enable:['chooseToRespond','chooseToUse'], + filterCard:{color:'red'}, + viewAs:{name:'shan'}, + position:'he', + prompt:'将一张红色牌当闪打出', + check:function(card){return 6-ai.get.value(card)} + }, + duoren:{ + trigger:{target:'shaMiss'}, + filter:function(event){ + return event.player.get('e','1')!=undefined; + }, + check:function(event,player){ + return ai.get.attitude(player,event.player)<0; + }, + priority:5, + content:function(){ + trigger.player.$give(trigger.player.get('e','1'),player); + player.gain(trigger.player.get('e','1')); + }, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(card.name=='sha'&&target.num('h')>1&&player.get('e','1')){ + return [1,0.5,0,-0.5]; + } + } + } + } + // filter:function(event){ + // return event.player.num('e')>0; + // }, + // content:function(){ + // "step 0" + // player.choosePlayerCard('是否获得'+get.translation(trigger.player)+'的一张装备牌?', + // 'e',trigger.player).ai=ai.get.buttonValue; + // "step 1" + // if(result.bool){ + // var card=result.buttons[0].link; + // trigger.player.$give(card,player); + // player.gain(card); + // } + // }, + }, + taixu:{ + enable:'phaseUse', + filter:function(event,player){ + return (!player.storage.taixu)&&player.num('hej'); + }, + filterTarget:function(card,player,target){ + return player!=target&&target.hp>1; + }, + content:function(){ + player.discard(player.get('hej')); + player.storage.taixu=true; + target.damage(player.maxHp-player.hp); + }, + ai:{ + basic:{ + order:1, + }, + result:{ + target:function(player,target){ + if(player.maxHp-player.hp<2) return 0; + return -2; + }, + player:function(player,target){ + return -0.5*player.num('he'); + } + } + } + }, + pozhen:{ + trigger:{player:'damageEnd'}, + filter:function(event,player){ + return event.source&&event.source.num('h')!=player.num('h'); + }, + // check:function(event,player){ + // return ai.get.attitude(player,event.source)<0; + // }, + direct:true, + content:function(){ + "step 0" + var num=player.num('h')-trigger.source.num('h'); + event.num=num; + if(num>0){ + player.chooseToDiscard(num,'是否弃置'+num+'张手牌,并对'+get.translation(trigger.source)+'造成一点伤害?').ai=function(card){ + if(ai.get.damageEffect(trigger.source,player,player)>0&&num<=2){ + return 6-ai.get.value(card); + } + return -1; + } + } + else if(num<0){ + player.chooseBool('是否弃置'+get.translation(trigger.source)+(-num)+'张手牌?').ai=function(){ + return ai.get.attitude(player,trigger.source)<0; + } + } + else{ + event.finish(); + } + "step 1" + if(result.bool){ + player.logSkill('pozhen',trigger.source); + if(event.num>0){ + trigger.source.damage(); + } + else{ + var cards=trigger.source.get('h'); + cards.sort(lib.sort.random); + trigger.source.discard(cards.slice(0,-event.num)); + } + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-1]; + var num=player.num('h')-target.num('h'); + if(num>0){ + return [1,0,0,-num/2]; + } + if(num<0){ + return [1,0,0,-0.5]; + } + } + } + } + } + }, + tanlin_defence:{ + trigger:{player:'damageEnd'}, + filter:function(event,player){ + return player.num('h')&&event.source&&event.source.num('h'); + }, + direct:true, + content:function(){ + "step 0" + player.chooseToDiscard([1,trigger.source.num('h')],'弃置任意张手牌并令伤害来源弃置等量手牌').ai=function(card){ + if(ui.selected.cards.length>=trigger.source.num('h')) return -1; + if(ui.selected.cards.length==0) return 8-ai.get.value(card); + return 4-ai.get.value(card); + } + "step 1" + if(result.bool){ + player.logSkill('tanlin'); + trigger.source.discard(trigger.source.get('h',lib.sort.random,result.cards.length)); + } + else{ + event.finish(); + } + "step 2" + player.draw(); + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')&&target.num('h')&&target.hp>1&&player!=target) return [1,0.2,0,-0.2]; + } + } + } + }, + tanlin:{ + enable:'phaseUse', + usable:1, + group:'tanlin4', + filterTarget:function(card,player,target){ + return player!=target&&target.num('h'); + }, + filter:function(event,player){ + return player.num('h')>0; + }, + content:function(){ + "step 0" + player.chooseToCompare(target); + "step 1" + if(result.bool){ + if(target.skills.contains('tanlin2')==false){ + target.addSkill('tanlin2'); + player.addSkill('tanlin3'); + player.gain([result.player,result.target]); + player.$gain2([result.player,result.target]); + } + } + else{ + player.damage(target); + } + }, + ai:{ + result:{ + target:function(player,target){ + var cards=player.get('h'); + var num=target.num('h'); + if(num>cards.length+3&&player.hp>1) return -2; + if(num>cards.length+1&&player.hp>1) return -1; + if(num==cards.length-1&&player.hp>1) return -1; + for(var i=0;i9) return num==1?-1:-0.5; + } + return 0; + } + }, + order:9, + } + }, + tanlin2:{ + trigger:{global:'phaseAfter'}, + forced:true, + content:function(){ + player.removeSkill('tanlin2'); + }, + // mod:{ + // cardEnabled:function(){ + // return false; + // }, + // cardUsable:function(){ + // return false; + // }, + // cardRespondable:function(){ + // return false; + // }, + // cardSavable:function(){ + // return false; + // } + // }, + }, + tanlin3:{ + trigger:{global:'phaseAfter'}, + forced:true, + popup:false, + content:function(){ + player.removeSkill('tanlin3'); + }, + mod:{ + cardUsable:function(card,player,num){ + if(card.name=='sha') return num+1; + } + }, + }, + tanlin4:{ + mod:{ + targetInRange:function(card,player,target,now){ + if(target.skills.contains('tanlin2')) return true; + }, + }, + }, + yunchou:{ + enable:'phaseUse', + usable:1, + filterTarget:function(card,player,target){ + return player!=target&&target.num('h'); + }, + filterCard:true, + selectCard:[1,Infinity], + content:function(){ + "step 0" + var card=target.get('h').randomGet(); + target.discard(card); + var color=get.color(card); + var suit=get.suit(card); + var num1=0,num2=0; + for(var i=0;i0; + }, + filterTarget:function(card,player,target){ + var names=[]; + if(target.name&&!target.classList.contains('unseen')) names.add(target.name); + if(target.name1&&!target.classList.contains('unseen')) names.add(target.name1); + if(target.name2&&!target.classList.contains('unseen2')) names.add(target.name2); + var pss=player.get('s'); + for(var i=0;i
【'+ + translation+'】
'+lib.translate[list[i]+'_info']+'
'); + item.addEventListener('click',clickItem); + item.link=list[i]; + } + } + dialog.add(ui.create.div('.placeholder')); + return dialog; + }, + content:function(){ + "step 0" + ui.auto.hide(); + event.dialog=lib.skill.tianshu.createDialog(player,target); + game.pause(); + "step 1" + if(player.storage.tianshu){ + player.unmark(player.storage.tianshu+'_charactermark'); + } + ui.auto.show(); + event.dialog.close(); + var link=result; + player.addSkill(link); + player.skills.remove(link); + player.additionalSkills.tianshu=link; + player.popup(link); + player.markCharacter(target.name,{ + name:get.translation(link), + content:lib.translate[link+'_info'] + }); + player.storage.tianshu=target.name; + player.checkMarks(); + }, + }, + tianshu2:{ + trigger:{player:'phaseBegin'}, + direct:true, + priority:-9, + content:function(){ + "step 0" + player.chooseTarget('是否发动【天书】?',lib.skill.tianshu.filterTarget).ai=function(target){ + if(target.maxHp<5) return Math.random()*(5-target.maxHp); + return -1; + }; + "step 1" + if(result.bool){ + player.logSkill('tianshu',result.targets); + event.target=result.targets[0]; + if(event.isMine()){ + ui.auto.hide(); + event.dialog=lib.skill.tianshu.createDialog(player,result.targets[0]); + game.pause(); + } + else{ + var target=result.targets[0]; + var names=[]; + var list=[]; + if(target.name&&!target.classList.contains('unseen')) names.add(target.name); + if(target.name1&&!target.classList.contains('unseen')) names.add(target.name1); + if(target.name2&&!target.classList.contains('unseen2')) names.add(target.name2); + var pss=player.get('s'); + for(var i=0;i0; + }, + filterTarget:function(card,player,target){ + return player!=target&&target.num('he')>0; + }, + check:function(card){ + return 7-ai.get.value(card); + }, + selectTarget:[1,2], + content:function(){ + target.chooseToDiscard(true,'he'); + }, + ai:{ + order:9, + result:{ + target:function(player,target){ + if(target.num('he')==1) return -1.5; + return -1; + } + // player:function(player){ + // var num=0; + // for(var i=0;i0) num--; + // else num++; + // } + // } + // return num; + // } + }, + } + }, + yulin:{ + trigger:{player:'damageBefore'}, + priority:-10, + filter:function(event,player){ + return player.num('he',{type:'equip'}); + }, + direct:true, + content:function(){ + "step 0" + player.chooseToDiscard('he','是否弃置一张装备牌抵消伤害?',function(card,player){ + return get.type(card)=='equip'; + }).ai=function(card){ + if(player.hp==1||trigger.num>1){ + return 9-ai.get.value(card); + } + if(player.hp==2){ + return 8-ai.get.value(card); + } + return 7-ai.get.value(card); + }; + "step 1" + if(result.bool){ + player.logSkill('yulin'); + game.delay(); + trigger.untrigger(); + trigger.finish(); + } + } + }, + funiao:{ + enable:'phaseUse', + discard:false, + prepare:function(cards,player,targets){ + player.$give(1,targets[0]); + }, + filterTarget:function(card,player,target){ + if(player==target) return false; + if(player.num('h')==0) return false; + if(target.storage.funiao) return false; + return true; + }, + filterCard:true, + check:function(card){ + if(get.owner(card).num('h')1) return [0,1]; + if(shans&&hs>2) return [0,1]; + if(shans) return [0,0]; + if(hs>2) return [0,0]; + if(hs>1) return [1,0.5]; + return [1.5,0]; + } + } + }, + threaten:0.8 + } + }, + yunshen:{ + trigger:{player:'respond'}, + filter:function(event,player){ + return event.card.name=='shan'; + }, + frequent:true, + init:function(player){ + player.storage.yunshen=0; + }, + content:function(){ + player.storage.yunshen++; + player.markSkill('yunshen'); + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'respondShan')){ + var shans=target.num('h','shan'); + var hs=target.num('h'); + if(shans>1) return [1,1]; + if(shans&&hs>2) return [1,1]; + if(shans) return [1,0.5]; + if(hs>2) return [1,0.3]; + if(hs>1) return [1,0.2]; + return [1.2,0]; + } + } + }, + threaten:0.8 + }, + intro:{ + content:'mark' + }, + group:'yunshen2' + }, + yunshen2:{ + trigger:{player:'phaseBegin'}, + forced:true, + filter:function(event,player){ + return player.storage.yunshen>0; + }, + content:function(){ + player.draw(player.storage.yunshen); + player.storage.yunshen=0; + player.unmarkSkill('yunshen'); + }, + mod:{ + globalTo:function(from,to,distance){ + if(typeof to.storage.yunshen=='number') return distance+to.storage.yunshen; + } + } + }, + xuehuang:{ + enable:'phaseUse', + usable:1, + filterCard:{color:'red'}, + nodelay:true, + check:function(card){return 6-ai.get.value(card);}, + filterTarget:function(card,player,target){ + return get.distance(player,target)<=1||player==target; + }, + filter:function(event,player){ + return player.num('h',{color:'red'})>0; + }, + selectTarget:-1, + content:function(){ + target.damage('fire'); + }, + line:'fire', + ai:{ + order:1, + result:{ + target:function(player,target){ + return ai.get.damageEffect(target,player,target,'fire'); + } + } + } + }, + zhuyu:{ + trigger:{global:'damageBegin'}, + filter:function(event,player){ + if(event.player.classList.contains('linked')==false) return false; + if(event.nature=='fire') return false; + if(player.num('h',{color:'red'})) return true; + return false; + }, + direct:true, + content:function(){ + "step 0" + player.chooseToDiscard('朱羽:是否弃置一张红色手牌使其受到一点火焰伤害?',function(card){ + return get.color(card)=='red'; + }).ai=function(card){ + if(trigger.player.hasSkillTag('nofire')) return 0; + if(ai.get.damageEffect(trigger.player,player,player,'fire')>0){ + return 9-ai.get.value(card); + } + return 0; + }; + "step 1" + if(result.bool){ + player.logSkill('zhuyu',trigger.player,'fire'); + trigger.player.damage('fire'); + } + } + }, + ningshuang:{ + trigger:{target:'useCardToBegin'}, + filter:function(event,player){ + if(get.color(event.card)!='black') return false; + if(!event.player) return false; + if(event.player==player) return false; + if(event.player.classList.contains('linked')&& + event.player.classList.contains('turnedover')) return false; + if(player.num('h',{color:'black'})) return true; + return false; + }, + direct:true, + content:function(){ + "step 0" + player.chooseToDiscard('是否弃置一张黑色手牌使其横置或翻面?',function(card){ + return get.color(card)=='black'; + }).ai=function(card){ + if(ai.get.attitude(player,trigger.player)<0){ + return 9-ai.get.value(card); + } + return 0; + }; + "step 1" + if(result.bool){ + player.logSkill('ningshuang'); + if(trigger.player.classList.contains('turnedover')){ + trigger.player.loseHp(); + } + if(trigger.player.classList.contains('linked')){ + trigger.player.turnOver(); + } + else{ + trigger.player.link(); + player.draw(); + } + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.color(card)=='black'&&ai.get.attitude(target,player)<0&&target.num('h')>0){ + return [1,0.1,0,-target.num('h')/4]; + } + } + } + } + }, + zaowu:{ + enable:'phaseUse', + usable:1, + position:'he', + filterCard:function(card,player,target){ + if(ui.selected.cards.length==0) return true; + for(var i=0;i=10) continue; + if(i!='list') list.push([suit,number,i]); + } + var dialog=ui.create.dialog([list,'vcard']); + player.chooseButton(dialog,2,true,function(button){ + return ai.get.value({name:button.link[2]},player); + }); + "step 1" + var cards=[ui.create.card(),ui.create.card()]; + cards[0].init(result.buttons[0].link); + cards[1].init(result.buttons[1].link); + player.gain(cards); + player.$gain(cards); + game.delay(); + }, + ai:{ + order:8, + result:{ + player:1 + }, + threaten:1.6 + } + }, + xielv:{ + trigger:{player:'phaseDiscardEnd'}, + filter:function(event,player){ + var cards=player.get('h'); + if(cards.length<2) return false; + var color=get.color(cards[0]); + for(var i=1;i0){ + ainum-=cards.length; + } + else if(att<0){ + ainum+=cards.length; + } + todiscard=todiscard.concat(cards); + + cards=game.players[i].get('j',filter); + if(att>0){ + ainum+=cards.length; + } + else if(att<0){ + ainum-=cards.length; + } + todiscard=todiscard.concat(cards); + } + var choice=[]; + if(player.hp1){ + if(event.isMine()){ + event.dialog=ui.create.dialog('是否发动【谐率】?'); + } + player.chooseControl(choice).ai=function(){ + if(choice.contains('recover_hp')) return 'recover_hp'; + else if(ainum>0) return 'discard_card'; + else return 'cancel'; + } + event.todiscard=todiscard; + event.filter=filter; + } + else{ + event.finish(); + } + "step 1" + if(event.dialog) event.dialog.close(); + event.control=result.control; + if(event.control!='recover_hp'&&event.control!='discard_card'){ + event.finish(); + } + else{ + player.showHandcards(); + player.logSkill('xielv'); + } + "step 2" + if(event.control=='recover_hp'){ + player.recover(); + event.finish(); + } + else if(event.control=='discard_card'){ + event.targets=game.players.slice(0); + event.targets.sort(lib.sort.seat); + } + else{ + event.finish(); + } + "step 3" + if(event.targets&&event.targets.length){ + var target=event.targets.shift(); + target.discard(target.get('ej',event.filter)); + event.redo(); + } + }, + ai:{ + expose:0.1, + } + }, + xiaomoyu:{ + trigger:{source:'damageEnd'}, + priority:1, + forced:true, + content:function(){ + "step 0" + if(player.hp=player.hp) return 'recover_hp'; + return 'draw_card'; + }); + } + else{ + player.draw(); + event.finish(); + } + "step 1" + if(result.control=='draw_card'){ + player.draw(); + } + else{ + player.recover(); + } + }, + ai:{ + maixie:true, + effect:{ + target:function(card,player,target,current){ + if(card.name=='sha'&&(get.color(card)=='red')){ + return [1,-2]; + } + } + } + } + }, + xielv_old:{ + trigger:{player:'phaseDiscardEnd'}, + filter:function(event,player){ + var cards=player.get('h'); + if(cards.length<2) return false; + var color=get.color(cards[0]); + for(var i=1;i0; + }, + usable:1, + selectTarget:-1, + filter:function(){ + for(var i=0;i=0) return eff+1; + var judges=target.get('j'); + if(!judges.length) return 0; + if(target.hp==1||judges.length>1) return -judges.length; + var name=judges[0].viewAs||judges[0].name; + if(name=='shandian'||name=='huoshan'||name=='hongshui') return -judges.length; + return 0; + } + } + } + }, + huanyin:{ + trigger:{target:'useCardToBefore'}, + forced:true, + priority:5.9, + filter:function(event,player){ + return event.player!=player; + }, + content:function(){ + "step 0" + var effect=ai.get.effect(player,trigger.card,trigger.player,player); + player.judge(function(card){ + switch(get.suit(card)){ + case 'spade':return -effect; + case 'heart':return 1; + default:return 0; + } + }); + "step 1" + switch(result.suit){ + case 'spade':{ + trigger.untrigger(); + trigger.finish(); + break; + } + case 'heart':{ + player.draw(); + break; + } + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + return 0.7 + } + }, + threaten:0.8 + } + }, + xuanzhou:{ + enable:'phaseUse', + usable:1, + discard:false, + filter:function(event,player){ + return player.num('he',{type:'trick'})>0; + }, + prepare:function(cards,player,targets){ + player.$throw(cards); + }, + position:'he', + filterCard:{type:'trick'}, + filterTarget:function(card,player,target){ + return player!=target; + }, + check:function(card){ + return 7-ai.get.value(card); + }, + content:function(){ + "step 0" + var list=[]; + for(var i in lib.card){ + if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; + if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]); + } + var dialog=ui.create.dialog([list,'vcard']); + var bing=target.num('h')<=1; + player.chooseButton(dialog,true,function(button){ + if(bing&&button.link[2]=='bingliang'){ + return 2; + } + if(button.link[2]=='lebu'){ + return 1; + } + if(button.link[2]=='guiyoujie'){ + return 0.5; + } + return 0.2; + }).filterButton=function(button){ + return !target.hasJudge(button.link[2]); + }; + "step 1" + // console.log(result.links[0][2]); + target.addJudge(result.links[0][2],cards); + }, + ai:{ + result:{ + target:-1 + }, + order:9.5, + } + }, + tianlun:{ + unique:true, + trigger:{global:'judge'}, + direct:true, + filter:function(event){ + if(event.card) return true; + for(var i=0;i0){ + return result+1; + } + else{ + return -result+1; + } + }); + "step 1" + if(result.bool){ + event.card=result.buttons[0].link; + if(get.owner(event.card)) get.owner(event.card).discard(event.card); + else trigger.player.$throw(event.card,1000); + } + "step 2" + if(event.card){ + player.logSkill('tianlun'); + if(trigger.player.judging.clone) trigger.player.judging.clone.moveTo(player).delete(); + else player.$draw(); + player.gain(trigger.player.judging); + trigger.player.judging=event.card; + trigger.position.appendChild(event.card); + game.log(get.translation(trigger.player)+'的判定牌改为'+get.translation(event.card)); + event.card.expired=true; + game.delay(2); + } + }, + ai:{ + tag:{ + rejudge:0.6 + } + } + }, + longyin:{ + enable:'phaseUse', + usable:1, + filterCard:function(card,player){ + if(get.number(card)%game.players.length==0) return false; + for(var i=0;i1) return ai.get.attitude(player,event.player)>=0; + return ai.get.attitude(player,event.player)>=-2; + } + else{ + if(player.hp==1||event.num>1) return true; + if(player.hp==2) return ai.get.attitude(player,event.player)>=-2; + return ai.get.attitude(player,event.player)>=0; + } + }, + content:function(){ + trigger.untrigger(); + trigger.finish(); + trigger.source.draw(2); + player.addTempSkill('lanzhi2','phaseBegin'); + }, + }, + lanzhi2:{}, + duanyi:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.num('h','sha')>1; + }, + filterCard:{name:'sha'}, + selectCard:2, + filterTarget:function(card,player,target){ + return player!=target; + }, + check:function(card){ + return 10-ai.get.value(card); + }, + content:function(){ + "step 0" + target.damage(); + "step 1" + if(target.isAlive()){ + target.turnOver(); + } + else{ + event.finish(); + } + "step 2" + target.draw(target.maxHp-target.hp); + }, + ai:{ + expose:0.3, + result:{ + target:function(player,target){ + var eff=ai.get.damageEffect(target,player); + if(target.hp==1) return eff; + return target.maxHp-target.hp-2+eff; + } + }, + order:5 + } + }, + swd_xiuluo:{ + trigger:{player:'phaseBegin'}, + direct:true, + filter:function(event,player){ + return player.num('j')>0; + }, + content:function(){ + "step 0" + player.chooseToDiscard(2,'hj',function(card){ + if(ui.selected.cards.length==0) return true; + if(get.position(ui.selected.cards[0])=='h'){ + if(get.position(card)!='j') return false; + } + if(get.position(ui.selected.cards[0])=='j'){ + if(get.position(card)!='h') return false; + } + return get.suit(card)==get.suit(ui.selected.cards[0]) + },'是否一张手牌来弃置一张花色相同的判定牌?').ai=function(card){ + if(get.position(card)=='h'){ + return 11-ai.get.value(card); + } + if(card.name=='lebu') return 5; + if(card.name=='bingliang') return 4; + if(card.name=='guiyoujie') return 3; + return 2; + } + "step 1" + if(result.bool){ + player.logSkill('swd_xiuluo'); + } + } + }, + guxing:{ + group:['guxing1','guxing3'] + }, + guxing1:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + var min=Math.max(1,player.maxHp-player.hp); + return player.num('h')<=min&&player.num('h')>0&& + lib.filter.filterCard({name:'sha'},player); + }, + filterCard:true, + selectCard:-1, + // viewAs:{name:'sha'}, + discard:false, + prepare:function(cards,player,targets){ + player.$throw(cards); + player.line(targets); + }, + filterTarget:function(card,player,target){ + return lib.filter.targetEnabled({name:'sha'},player,target); + }, + content:function(){ + "step 0" + delete player.storage.guxing; + targets.sort(lib.sort.seat); + player.useCard({name:'sha'},cards,targets,'guxing').animate=false; + "step 1" + if(player.storage.guxing){ + player.draw(player.storage.guxing); + delete player.storage.guxing; + } + }, + multitarget:true, + selectTarget:[1,3], + ai:{ + order:function(){ + if(_status.event.player.num('h')==1) return 10; + return lib.card.sha.ai.order+0.1; + }, + result:{ + target:function(player,target){ + return ai.get.effect(target,{name:'sha'},player,target); + } + }, + threaten:function(player,target){ + if(target.hp=player.maxHp-1) return [0,0]; + } + } + } + }, + jifeng:{ + mod:{ + selectTarget:function(card,player,range){ + if(range[0]!=1||range[1]!=1) return; + var range2=get.select(get.info(card).selectTarget); + if(range2[0]!=1&&range2[1]!=1) return; + if(card.name=='sha'||get.type(card)=='trick') range[1]=Infinity; + }, + }, + trigger:{player:'useCardToBefore'}, + priority:6, + forced:true, + popup:false, + filter:function(event,player){ + if(event.targets.length<=1) return false; + if(event.card.name=='sha') return true; + else if(get.type(event.card)=='trick'){ + var range=get.select(get.info(event.card).selectTarget); + if(range[0]==1&&range[1]==1) return true; + } + return false; + }, + content:function(){ + if(Math.random()>(1.3+trigger.targets.length/5)/trigger.targets.length){ + trigger.target.popup('失误'); + trigger.untrigger(); + trigger.finish(); + } + } + }, + mohua2:{ + unique:true, + trigger:{player:'dying'}, + priority:10, + forced:true, + content:function(){ + "step 0" + player.removeSkill('miles_xueyi'); + player.removeSkill('aojian'); + player.removeSkill('mohua2'); + player.addSkill('moyan'); + player.addSkill('miedao'); + player.addSkill('jifeng'); + player.addSkill('swd_xiuluo'); + + lib.character.swd_satan=['','qun',4,['moyan','miedao','jifeng','swd_xiuluo'],['temp']]; + if(player.name=='swd_miles') player.name='swd_satan'; + if(player.name1=='swd_miles') player.name1='swd_satan'; + if(player.name2=='swd_miles'){ + player.name2='swd_satan'; + player.node.avatar2.setBackground('swd_satan','character'); + } + else{ + player.node.avatar.setBackground('swd_satan','character'); + } + + "step 1" + player.recover(2); + "step 2" + player.draw(2); + }, + }, + liexin:{ + trigger:{source:'damageBegin'}, + direct:true, + content:function(){ + "step 0" + player.chooseToDiscard('是否弃置一张牌使伤害+1?','he').ai=function(card){ + if(ai.get.attitude(player,trigger.player)<0){ + return 7-ai.get.value(card); + } + } + "step 1" + if(result.bool){ + player.logSkill('liexin'); + trigger.num++; + } + }, + ai:{ + threaten:1.8 + } + }, + mohua:{ + trigger:{player:'dying'}, + priority:10, + forced:true, + mode:['identity'], + content:function(){ + "step 0" + var skills=['wuying','xiehun','jumo']; + if(lib.config.mode_choice.double_character){ + skills.push('swd_xiuluo'); + } + lib.character.swd_satan=['','qun',6,skills,['temp']]; + if(!_status.ai.customAttitude) _status.ai.customAttitude=[]; + _status.ai.customAttitude.push(function(from,to){ + if(from.storage.xiehun){ + if(to==game.zhu) return 10; + return -10; + } + if(to.storage.xiehun){ + return 0; + } + }); + player.uninit(); + player.init('swd_satan'); + player.hp=game.players.length; + player.update(); + game.zhu=player; + player.identity='zhu'; + player.setIdentity('魔'); + player.identityShown=true; + var players=get.players(false,true); + for(var i=0;i0){ + player.draw(num); + } + }, + }, + duijue:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return !player.storage.duijue; + }, + filterTarget:function(card,player,target){ + return player!=target&&target!=game.zhu; + }, + content:function(){ + var players=game.players.concat(game.dead); + players.remove(player); + players.remove(target); + for(var i=0;i0&&ai.get.attitude(player,trigger.source)<0; + player.chooseToDiscard('是否将伤害来源('+get.translation(trigger.source)+ + ')和目标('+get.translation(trigger.player)+')对调?','he').ai=function(card){ + if(go){ + return 10-ai.get.value(card); + } + return 0; + }; + "step 1" + if(result.bool){ + player.logSkill('yinguo'); + var target=trigger.player; + trigger.player=trigger.source; + trigger.source=target; + trigger.trigger('damageBefore'); + player.addTempSkill('yinguo2',['damageAfter','damageCancelled']); + } + }, + ai:{ + threaten:10, + expose:0.5, + }, + global:'yinguo3' + }, + yinguo2:{}, + yinguo3:{ + ai:{ + effect:{ + target:function(card,player,target){ + if(!get.tag(card,'damage')) return; + if(target.skills.contains('yinguo')) return; + var source=null; + for(var i=0;i=0&& + ai.get.attitude(game.players[i],player)>=0){ + num++; + } + else{ + num--; + } + } + } + return num; + } + } + } + }, + mailun:{ + unique:true, + trigger:{player:'phaseBegin'}, + direct:true, + intro:{ + content:function(storage){ + if(!storage) return '无'; + return lib.skill.mailun.effects[storage-1]; + } + }, + effects:[ + '减少一点体力并增加一点体力上限', + '增加一点体力并减少一点体力上限', + '令你即将造成和即将受到的首次伤害-1', + '令你即将造成和即将受到的首次伤害+1', + '少摸一张牌并令手牌上限+1', + '多摸一张牌并令手牌上限-1', + '进攻距离+1,防御距离-1', + '进攻距离-1,防御距离+1' + ], + content:function(){ + "step 0" + player.removeSkill('mailun31'); + player.removeSkill('mailun32'); + player.removeSkill('mailun41'); + player.removeSkill('mailun42'); + player.removeSkill('mailun5'); + player.removeSkill('mailun6'); + player.removeSkill('mailun7'); + player.removeSkill('mailun8'); + if(event.isMine()){ + ui.auto.hide(); + event.dialog=ui.create.dialog('选择一个效果'); + var effects=lib.skill.mailun.effects; + var clickItem=function(){ + event.choice=this.link; + game.resume(); + } + for(var i=0;i<8;i++){ + if(i==0&&player.maxHp==6) continue; + var item=event.dialog.add(''); + item.addEventListener('click',clickItem); + item.link=i+1; + + } + event.control=ui.create.control('取消',function(){ + event.choice=0; + game.resume(); + }); + event.dialog.add(ui.create.div('.placeholder')); + event.dialog.add(ui.create.div('.placeholder')); + event.dialog.add(ui.create.div('.placeholder')); + game.pause(); + } + else{ + var ctrl; + if(player.hp<=1){ + if(player.maxHp>3){ + ctrl=2; + } + else{ + ctrl=3; + } + } + else if(player.hp==2){ + if(player.maxHp>4){ + ctrl=2; + } + else if(player.num('h')==0){ + ctrl=6; + } + else{ + ctrl=3; + } + } + else if(player.num('h')player.hp+1){ + ctrl=5; + } + event.choice=ctrl; + } + "step 1" + ui.auto.show(); + player.storage.mailun=event.choice; + if(event.choice){ + player.logSkill('mailun'); + player.markSkill('mailun'); + switch(event.choice){ + case 1:{ + player.loseHp(); + player.gainMaxHp(); + break; + } + case 2:{ + player.recover(); + player.loseMaxHp(); + break; + } + case 3:{ + player.addSkill('mailun31'); + player.addSkill('mailun32'); + break; + } + case 4:{ + player.addSkill('mailun41'); + player.addSkill('mailun42'); + break; + } + case 5:{ + player.addSkill('mailun5'); + break; + } + case 6:{ + player.addSkill('mailun6'); + break; + } + case 7:{ + player.addSkill('mailun7'); + break; + } + case 8:{ + player.addSkill('mailun8'); + break; + } + } + } + else{ + player.unmarkSkill('mailun'); + } + + if(event.dialog){ + event.dialog.close(); + } + if(event.control){ + event.control.close(); + } + } + }, + mailun31:{ + trigger:{source:'damageBegin'}, + forced:true, + content:function(){ + trigger.num--; + player.removeSkill('mailun31'); + } + }, + mailun32:{ + trigger:{player:'damageBegin'}, + forced:true, + content:function(){ + trigger.num--; + player.removeSkill('mailun32'); + } + }, + mailun41:{ + trigger:{source:'damageBegin'}, + forced:true, + content:function(){ + trigger.num++; + player.removeSkill('mailun41'); + } + }, + mailun42:{ + trigger:{player:'damageBegin'}, + forced:true, + content:function(){ + trigger.num++; + player.removeSkill('mailun42'); + } + }, + mailun5:{ + trigger:{player:'phaseDrawBegin'}, + forced:true, + popup:false, + content:function(){ + trigger.num--; + }, + mod:{ + maxHandcard:function(player,num){ + return num+1; + } + } + }, + mailun6:{ + trigger:{player:'phaseDrawBegin'}, + forced:true, + popup:false, + content:function(){ + trigger.num++; + }, + mod:{ + maxHandcard:function(player,num){ + return num-1; + } + } + }, + mailun7:{ + mod:{ + globalFrom:function(from,to,distance){ + return distance-1; + }, + globalTo:function(from,to,distance){ + return distance-1; + } + } + }, + mailun8:{ + mod:{ + globalFrom:function(from,to,distance){ + return distance+1; + }, + globalTo:function(from,to,distance){ + return distance+1; + } + } + }, + fengming:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.num('he',{type:'equip'})>0; + }, + filterCard:{type:'equip'}, + position:'he', + filterTarget:true, + content:function(){ + "step 0" + target.recover(); + "step 1" + target.draw(); + }, + ai:{ + order:9, + result:{ + target:function(player,target){ + if(target.hp0; + }, + filterCard:function(card){ + return get.type(card)=='equip'; + }, + position:'he', + viewAs:{name:'nanman'}, + prompt:'将一张装备牌当南蛮入侵使用', + check:function(card){ + var player=_status.currentPhase; + if(player.num('he',{subtype:get.subtype(card)})>1){ + return 11-ai.get.equipValue(card); + } + if(player.num('h')0){ + return att+5; + } + return -1; + } + if(player.isTurnedOver()){ + return 5-att; + } + return -att; + }; + "step 1" + if(result.bool){ + player.discard(result.cards); + player.logSkill('huanling',result.targets); + player.turnOver(); + result.targets[0].turnOver(); + } + }, + group:'huanling2', + ai:{ + effect:{ + target:function(card,player,target,current){ + if(card.name=='guiyoujie') return [0,2]; + if(target.isTurnedOver()){ + if(get.tag(card,'damage')) return 0; + } + } + }, + expose:0.2 + } + }, + huanling2:{ + trigger:{player:'damageBefore'}, + filter:function(event,player){ + return player.isTurnedOver(); + }, + forced:true, + content:function(){ + trigger.untrigger(); + trigger.finish(); + }, + }, + ljifeng:{ + trigger:{player:'phaseUseBefore'}, + direct:true, + filter:function(event,player){ + return player.num('h')>0; + }, + content:function(){ + "step 0" + var check=player.num('h')<=player.hp+(player.hp>2?2:1); + player.chooseCardTarget({ + prompt:'是否发动【疾风】?', + filterCard:true, + filterTarget:function(card,player,target){ + if(player==target) return false; + return player.canUse({name:'sha'},target,false); + }, + selectTarget:[1,2], + ai1:function(card){ + if(!check) return 0; + return 8-ai.get.value(card); + }, + ai2:function(target){ + if(!check) return 0; + return ai.get.effect(target,{name:'sha'},player); + } + }); + "step 1" + if(result.bool){ + player.logSkill('ljifeng',result.targets); + player.discard(result.cards); + player.useCard({name:'sha'},result.targets).animate=false; + trigger.untrigger(); + trigger.finish(); + } + } + }, + lxianglong:{ + trigger:{target:'shaMiss'}, + priority:5, + direct:true, + content:function(){ + "step 0" + player.chooseTarget(function(card,player,target){ + return player.canUse(trigger.card,target); + },'是否发动【翔龙】?').ai=function(target){ + return ai.get.effect(target,trigger.card,player); + } + "step 1" + if(result.bool){ + player.logSkill('lxianglong'); + player.line(result.targets); + player.useCard(trigger.card,trigger.cards,result.targets).animate=false; + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(card.name=='sha'&&target.num('h')) return 0.7; + } + } + } + }, + zhenjiu:{ + enable:'phaseUse', + usable:1, + filterCard:{color:'red'}, + filterTarget:function(card,player,target){ + return !target.skills.contains('zhenjiu2'); + }, + check:function(card){ + return 8-ai.get.value(card); + }, + discard:false, + prepare:function(cards,player,targets){ + player.$give(cards,targets[0]); + }, + content:function(){ + "step 0" + game.delay(); + "step 1" + target.storage.zhenjiu2=cards[0]; + target.addSkill('zhenjiu2'); + }, + ai:{ + result:{ + target:function(player,target){ + if(target.hpplayer.hp) return 0.5; + return 0; + } + }, + order:9, + threaten:1.7 + } + }, + zhenjiu2:{ + trigger:{player:'phaseBegin'}, + forced:true, + mark:'card', + content:function(){ + player.recover(); + player.gain(player.storage.zhenjiu2,'gain2'); + game.log(get.translation(player)+'获得了'+get.translation(player.storage.zhenjiu2)); + player.removeSkill('zhenjiu2'); + delete player.storage.zhenjiu2; + }, + intro:{ + content:'card' + } + }, + mazui:{ + enable:'phaseUse', + usable:1, + filterCard:{color:'black'}, + filterTarget:function(card,player,target){ + return !target.skills.contains('mazui2'); + }, + check:function(card){ + return 6-ai.get.value(card); + }, + discard:false, + prepare:function(cards,player,targets){ + player.$give(cards,targets[0]); + }, + content:function(){ + "step 0" + game.delay(); + "step 1" + target.storage.mazui2=cards[0]; + target.addSkill('mazui2'); + }, + ai:{ + expose:0.2, + result:{ + target:function(player,target){ + return -target.hp; + } + }, + order:4, + threaten:1.2 + } + }, + mazui2:{ + trigger:{source:'damageBegin'}, + forced:true, + mark:'card', + filter:function(event){ + return event.num>0; + }, + content:function(){ + trigger.num--; + player.addSkill('mazui3'); + player.removeSkill('mazui2'); + }, + intro:{ + content:'card' + } + }, + mazui3:{ + trigger:{source:'damageEnd'}, + forced:true, + popup:false, + content:function(){ + player.gain(player.storage.mazui2,'gain2'); + game.log(get.translation(player)+'获得了'+get.translation(player.storage.mazui2)); + player.removeSkill('mazui3'); + delete player.storage.mazui2; + } + }, + shoulie:{ + trigger:{player:'shaBegin'}, + direct:true, + content:function(){ + "step 0" + var dis=trigger.target.num('h','shan')||trigger.target.num('e','bagua')||trigger.target.num('h')>2; + player.chooseToDiscard('是否发动【狩猎】?').ai=function(card){ + if(dis) return 7-ai.get.value(card); + return 0; + } + "step 1" + if(result.bool){ + player.logSkill('shoulie'); + trigger.directHit=true; + } + } + }, + hudun:{ + trigger:{source:'damageEnd'}, + forced:true, + filter:function(event,player){ + return !player.storage.hudun; + }, + content:function(){ + player.storage.hudun=true; + player.markSkill('hudun'); + }, + init:function(player){ + player.storage.hudun=false; + }, + intro:{ + content:function(st){ + if(st) return '已开启'; + return '未开启'; + } + }, + group:'hudun2' + }, + hudun2:{ + trigger:{player:'damageBegin'}, + forced:true, + filter:function(event,player){ + return event.num>0&&player.storage.hudun; + }, + content:function(){ + trigger.num--; + player.storage.hudun=false; + player.unmarkSkill('hudun'); + } + }, + toudan:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.num('he',{suit:'spade'}); + }, + filterTarget:function(card,player,target){ + return player!=target; + }, + filterCard:{suit:'spade'}, + check:function(card){ + return 10-ai.get.value(card); + }, + position:'he', + line:'fire', + content:function(){ + "step 0" + target.damage('fire'); + event.targets=[]; + for(var i=0;i1) return [0,0,0,0]; + } + } + } + } + } + } + }, + zhexian:{ + inherit:'lingbo' + } + }, + translate:{ + swd_yangshuo:'杨硕', + swd_septem:'赛特', + swd_yuxiaoxue:'于小雪', + swd_lilian:'莉莲', + swd_cheyun:'车芸', + swd_jipeng:'疾鹏', + swd_muyun:'徐暮云', + swd_zhaoyun:'皇甫朝云', + swd_jiliang:'姬良', + swd_lanyin:'兰茵', + swd_zhiyin:'芝茵', + swd_hengai:'横艾', + swd_huzhongxian:'壶中仙', + swd_qiner:'磬儿', + swd_huanyuanzhi:'桓远之', + swd_murongshi:'慕容诗', + swd_hupo:'琥珀', + swd_miles:'麦尔斯', + swd_kangnalishi:'康那里士', + swd_satan:'撒旦', + swd_philis:'菲力斯', + swd_weida:'薇达', + swd_fengtianling:'凤天凌', + swd_huyue:'瑚月', + swd_jiting:'姬亭', + swd_rongshuang:'蓉霜', + swd_zhuoshanzhu:'浊山铸', + swd_jialanduo:'迦兰多', + swd_linming:'林明', + swd_duanmeng:'端蒙', + swd_nicole:'妮可', + swd_kendi:'肯迪', + swd_lijing:'李靖', + swd_hanteng:'韩腾', + swd_yuwentuo:'宇文拓', + swd_shanxiaoxiao:'单小小', + swd_yuchiyanhong:'尉迟嫣红', + swd_pepin:'丕平', + swd_anka:'安卡', + swd_jiangwu:'疆梧', + swd_situqiang:'司徒蔷', + swd_tuwei:'徒维', + swd_yeyaxi:'耶亚希', + swd_chunyuheng:'淳于恒', + swd_duguningke:'独孤宁珂', + swd_duguningke2:'魔化宁珂', + swd_chenjingchou:'陈靖仇', + swd_zhanglie:'张烈', + swd_guyue:'古月圣', + swd_kama:'卡玛', + swd_yuli:'玉澧', + swd_duopeng:'多鹏', + swd_jiangziya:'姜子牙', + swd_heran:'何然', + swd_zhanggao:'张诰', + swd_hanlong:'韩龙', + swd_jiuyou:'久悠', + swd_qingming:'青冥', + swd_shangzhang:'尚章', + swd_youzhao:'游兆', + swd_wangsiyue:'王思月', + swd_huanglei:'黄雷', + swd_tuobayuer:'拓跋玉儿', + swd_tuobayueer:'拓跋月儿', + swd_chengyaojin:'程咬金', + swd_qinshubao:'秦叔宝', + swd_lishimin:'李世民', + swd_shuijing:'水镜', + swd_xuanyuanjianxian:'轩辕剑仙', + swd_xuanyuanjiantong:'轩辕剑童', + swd_luchengxuan:'陆承轩', + swd_xiarou:'夏柔', + swd_moye:'莫邪', + swd_fu:'毛民·福', + swd_hanluo:'寒洛', + swd_linyue:'临月', + swd_zidashu:'子大暑', + swd_maixing:'麦星', + swd_haidapang:'海大胖', + swd_shaowei:'少微', + swd_fuyan:'符验', + swd_huiyan:'慧彦', + swd_sikongyu:'司空宇', + swd_muyue:'沐月', + swd_ziqiao:'子巧', + swd_fengyu:'凤煜', + swd_qi:'柒', + swd_chenfu:'陈辅', + swd_libai:'李白', + swd_xingtian:'刑天', + swd_lanmoshen:'蓝魔神', + swd_wushi:'巫师', + + miaobi:'妙笔', + miaobi_info:'出牌阶段限一次,你可以将一张红桃牌当作五谷丰登使用', + zhexian:'谪仙', + jufu:'巨斧', + jufu_info:'锁定技,当你有武器牌时,杀造成的伤害+1', + huajing:'化精', + huajing_info:'每当你使用锦囊牌造成伤害,可以回复一点体力', + pingxu:'冯虚', + pingxu_info:'锁定技,当你没有武器牌时,与其他角色的距离-1;当你没有防具牌时,其他角色与你的距离+1', + yudun:'愚钝', + yudun_info:'锁定技,你的锦囊牌均视为杀,你于回合内使用的杀无数量限制', + bingfeng:'冰封', + bingfeng2:'冰封', + bingfeng2_info:'不能使用或打出手牌', + bingfeng_info:'限定技,出牌阶段,你可以指定至多三个目标与其一同翻面,且处于翻面状态时不能使用或打出手牌;若如此做,你失去技能玄咒并减少一点体力上限', + guozao:'聒噪', + guozao_info:'锁定技,每当距离你1以内的角色受到一次伤害,若伤害来源不你,你须观看牌堆顶的三张牌,然后指定一名有手牌的角色将手牌与这些牌交换', + heihuo:'黑火', + heihuo_info:'出牌阶段,你可以弃置一张装备牌,令你的手牌数加倍;若你的手牌因此达到10张或更多,你立即受到3点火焰伤害且本回合内不能再次发动黑火', + yaotong:'妖瞳', + yaotong1:'妖瞳', + yaotong2:'妖瞳', + yaotong3:'妖瞳', + yaotong4:'妖瞳', + yaotong_info:'当你的手牌数为奇数时,你可以将一张手牌当作杀或闪使用或打出,当你的手牌数为偶数时,你可以将一张手牌当作无懈可击使用', + pojian:'破茧', + pojian_info:'每当你失去最后一张手牌,可以从牌堆中获得一张装备牌并装备之', + kuangfu:'狂斧', + kuangfu_info:'每当你使用杀造成伤害,可以将对方的一张装备牌移到你的装备区', + huajin:'化金', + huajin2:'化金', + huajin_info:'出牌阶段限一次,你可以弃置一张牌令你造成的伤害+1,直到你的下一回合开始', + poxiao:'破霄', + poxiao_info:'你可以将一张装备牌当杀使用;当你没有武器牌时,你的攻击范围+1,杀可以额外指定一个目标', + jianji:'箭疾', + jianji_info:'你可以将一张装备牌当杀使用,然后摸一张牌,此杀无视距离和防具,且不计入回合内出杀限制', + yuchen:'浴尘', + yuchen_info:'每当你于回合外使用或打出一张黑色牌,你可以弃置一名角色的一张牌', + huangyu:'凰羽', + huangyu_info:'出牌阶段限一次,你可以将两张红色牌当炽羽袭使用', + bingjian:'冰箭', + bingjian_info:'出牌阶段限一次,你可以弃置一张黑色的杀,令一名有手牌的其他角色展示手牌并弃置其中的所有闪,若其没有闪则受到一点雷电伤害', + rumeng:'入梦', + rumeng_info:'其他角色的出牌阶段前,你可以弃置一张非基本牌,并令其选择一项:弃置一张基本牌,或跳过出牌及弃牌阶段', + lianda:'连打', + lianda_info:'当你使用一杀结算完毕后,可以弃置一张牌视为对目标再使用一张杀', + xianghui:'祥晖', + xianghui_info:'出牌阶段限一次,你可以弃置一张红色手牌,然后令场上体力值最少的角色各回复一点体力', + huiqi:'回气', + huiqi_info:'每当你的体力值减少,可令一名角色摸X张牌,X为你已损失的体力值且最多为3', + toudan:'投弹', + toudan_info:'出牌阶段限一次,你可以弃置一张黑桃牌对一名其他角色造成一点火焰伤害,然后令距离该角色1以内的所有角色弃置一张牌', + shending:'神丁', + shending_info:'锁定技,若你没有宝物牌,视为装备了蓝格怪衣', + hzhenwei:'镇卫', + hzhenwei_info:'当一名其他角色成为杀的目标后,若你在杀的使用者的攻击范围内,你可以弃置一张牌将此杀转移给自己,并在杀结算完毕后摸一张牌', + shoulie:'狩猎', + shoulie_info:'当你使用一张杀指定目标后,可以弃置一张手牌令此杀不可闪避', + hudun:'护盾', + hudun_bg:'盾', + hudun2:'护盾', + hudun_info:'锁定技,当你造成一次伤害后,受到的下一次伤害-1', + mazui:'麻醉', + mazui2:'麻醉', + mazui_info:'出牌阶段限一次,你可以将一张黑色手牌置于一名角色的武将牌上,该角色造成的下一次伤害-1,然后获得此牌', + zhenjiu:'针灸', + zhenjiu2:'针灸', + zhenjiu_info:'出牌阶段限一次,你可以将一张红色手牌置于一名角色的武将牌上,该角色于下一个回合开始阶段回复一点体力,然后获得此牌', + ljifeng:'疾风', + ljifeng_info:'你可以弃置一张手牌并跳过出牌阶段,视为对至多两名角色使用一张杀', + lxianglong_info:'每当你闪避一张杀,可以将此杀对攻击范围内的一名角色使用', + lxianglong:'翔龙', + shangxi:'伤袭', + shangxi_info:'回合开始阶段,你可以弃置一张牌,并对攻击范围内一名体力值不小于你的其他角色造成一点伤害', + zhenwei:'镇威', + zhenwei_info:'你可以将攻击范围内其他角色打出的卡牌交给除该角色外的任意一名角色', + fuyan:'覆岩', + fuyan2:'覆岩', + fuyan_info:'每当你受到一次伤害,可以摸一张牌,并将一张牌置于一名角色的武将牌上称为“岩”;当其受到伤害时,须将“岩”置于弃牌堆,然后令伤害-1', + guaili:'怪力', + guaili_info:'锁定技,你的杀造成的伤害+1', + pingshen:'凭神', + pingshen2:'凭神', + pingshen_info:'锁定技,受到过你的伤害的角色可在回合内对你发动一次【离魂】(每局限发动一次)', + xingzhui:'星坠', + xingzhui_info:'出牌阶段限一次,你可以弃置一张牌,并选择一名角色令其弃置一张牌,若其弃置的牌类别与你不同,其受到一点伤害', + lingxian:'凌仙', + lingxian_info:'每当你于回合外使用或打出一张手牌,你可以选择攻击范围外的一名其他角色与你各摸一张牌', + shouyin:'守印', + shouyin_info:'限定技,当任意一名角色处于濒死状态时,若你的武将牌正朝上,可以将武将牌翻面,然后令场上所有存活角色将体力回复至体力上限', + bofeng:'搏风', + bofeng_info:'锁定技,体力值不大于你的角色视为在你的攻击范围;当你使用杀指定目标时,可令目标额外打出一张闪,否则此杀不可闪避且造成的伤害+1', + hutian:'护天', + hutian2:'护天', + hutian3:'护天', + hutian_info:'回合结束阶段,你可以将X张牌置于一名角色的武将牌上,则该角色的体力值始终不能小于X;在你的下一个回合结束阶段,该角色获得武将牌上的牌(在此回合不能再次发动)', + linyun:'凌云', + linyun_info:'你可以将两张牌当作杀使用,此杀需要额外一张闪才能闪避;若此杀造成伤害,你摸一张牌', + sliufeng:'流风', + sliufeng_info:'锁定技,体力值不大于你的角色视为在你的攻击范围', + chengjian:'承剑', + chengjian_info:'每当其他角色使用杀造成一次伤害,你可以令其摸一张牌', + huanling:'幻灵', + huanling2:'幻灵', + huanling_info:'回合结束阶段,你可以选择一名角色与你同时翻面;翻面状态下,你防止一切伤害', + xiaozhan:'消战', + xiaozhan_info:'其他角色使用杀时,若你不是杀的目标,可以弃置一张杀取消之', + xielei:'挟雷', + xielei_info:'每当你使用或打出一张杀,可立即对一名目标以外的角色造成一点雷电伤害', + dangping:'荡平', + dangping_info:'每当你造成一次伤害,可以弃置一张手牌对其距离1以内的另一名角色造成一点伤害', + guisi:'归思', + guisi_info:'每当你成为杀的目标,你可以交给对方一张手牌并取消之', + duishi:'对诗', + duishi_info:'出牌阶段限一次,你可以弃置一张手牌,并指定一名角色弃置一张与之花色相同的手牌,否则你获得其一张牌', + anlianying:'连营', + anlianying_info:'每当你失去最后一张手牌,可摸两张牌', + lianwu:'连舞', + lianwu_info:'锁定技,你的杀可以额外指定一个目标,你的红杀不可被闪避', + jiying:'疾鹰', + jiying_info:'锁定技,你使用杀无视距离', + daofa:'道法', + daofa_info:'每当有一名其他角色造成伤害,你可以令其弃置一张牌', + xiaomoyu:'魔愈', + xiaomoyu_info:'锁定技,每当你造成一次伤害,你摸一张牌或回复一点体力', + yihua:'移花', + yihua_info:'每当你成为其他角色的某张卡牌的惟一目标时,你可以弃置两张手牌,将使用者与目标对调', + youyin:'游吟', + youyin_info:'每当有其他角色弃置卡牌时,若其中有基本牌且你的手牌数不超过5,你可以摸一张牌', + rexue:'热血', + rexue_info:'任意一名角色的回合开始阶段,你可以对其使用一张杀,然后摸一张牌', + huopu:'火瀑', + huopu_info:'你可以将一张红桃手牌当作流星火羽使用', + benlei:'奔雷', + benlei2:'奔雷', + benlei_info:'你可以将三张牌当惊雷闪使用;每当你造成一次雷属性伤害,你回复一点体力', + lingwu:'灵舞', + lingwu_info:'回合结束后,若你在本回合内使用了至少3张牌,你可以进行一个额外的回合', + miejing:'灭境', + miejing_info:'限制技,你可以弃置所有黑色牌,然后令所有其他角色受到一点雷电伤害', + lingxin:'灵心', + lingxin_info:'回合结束阶段,你可以亮出牌堆顶的X+1张牌,然后获得其中的红桃牌,X为你回合内使用的牌数且至少为2', + fushen:'附身', + fushen_info:'回合开始前,你可以将自己移出游戏,并代替另一名角色进行一回合,然后流失一点体力', + fushen2:'附身', + tiandao:'天道', + tiandao_info:'任意一名角色的判定生效前,你可以打出一张牌替换之', + swdqinyin:'琴音', + swdqinyin_info:'回合结束阶段,若你于本回合内未造成过伤害,你可以令所有角色失去或回复一点体力', + wangchen:'忘尘', + wangchen_info:'若你于弃牌阶段弃置了基本牌,可令一名角色翻面', + guiyin:'归隐', + guiyin_info:'若你于弃牌阶段弃置了至少两张牌,你可以摸两张牌', + shejie:'设界', + shejie2:'设界', + shejie_info:'每当你受到一次伤害,可以令伤害来源不能使用或打出其手牌,直到其下一回合开始', + shejie2_info:'不能使用或打出手牌,直到下一回合开始', + yinyue:'引月', + yinyue_info:'每当有一名角色回复一次体力,你可以令其摸一张牌,若你的手牌数比其少,你也摸一张牌', + mohua2:'魔化', + mohua2_info:'锁定技,当你进入濒死状态时,你立即变身为撒旦,将体力回复至2,然后摸两张牌', + liexin:'裂心', + liexin_info:'每当你即将造成伤害,你可以弃置一张牌令伤害+1', + swdxueyi:'血裔', + swdxueyi_info:'锁定技,你摸牌阶段额外摸X张牌,X为你已损失的体力值', + moyan:'血焰', + moyan_info:'出牌阶段,你可以弃置X张红色手牌,然后对至多X名角色各造成一点火焰伤害,X为你已损失的体力值。每阶段限一次', + aojian:'傲剑', + aojian_info:'出牌阶段,你可以弃置X张手牌,然后对攻击范围内至多X名角色各造成一点伤害,X为你已损失的体力值。每阶段限一次', + milesxiehun:'邪魂', + milesxiehun_info:'锁定技,出牌阶段结束后,你令随机X名角色各弃置一张牌,X为你已损失的体力值且至少为1 ', + liaochen:'撩尘', + liaochen_info:'锁定技,出牌阶段结束后,所有角色需弃置一张牌', + lianji:'连计', + lianji_info:'出牌阶段限一次,你可以选择一张手牌并指定两名角色进行拼点,拼点赢的角色获得此牌,并对没赢的角色造成一点伤害', + yinmo:'引魔', + yinmo_info:'锁定技,当你对场上所有角色发动「连计」后,你立即变身为魔化宁珂,然后对所有其他角色造成一点雷电伤害', + huanxing:'幻形', + huanxing2:'幻形', + huanxing_info:'回合开始阶段,你可以弃置一张处于并选择一名男性角色,获得其所有技能,直到你首次受到伤害', + meihuo:'魅惑', + meihuo_info:'每当你失去最后一张装备牌,你可以获得一名其他角色的一张牌,若此牌来自装备区,你立即装备之', + + touxi:'偷袭', + touxi_info:'在其他角色的回合结束阶段,你可以进行一次判定,若结果为黑色,你对其造成一点雷电伤害并摸一张牌,且直到下一回合开始不能再次发动偷袭;若结果为红色,对方须弃置你的一张牌', + minjing:'明镜', + minjing_info:'锁定技,若你没有防具牌,你视为装备了光纱天衣', + qimou:'奇谋', + qimou_info:'每当你于回合外受到一次伤害,你可以摸一张牌,并立即使用之', + mufeng:'沐风', + mufeng_info:'当你成为一张指定了多个目标的卡牌的目标时,你可以取消之,并摸一张牌。', + lexue:'乐学', + lexue_info:'回合内,你随机获得制衡、集智、缔盟、驱虎中的一个技能;回合外,你随机获得遗计、急救、鬼道、反馈中的一个技能', + mingfu:'冥缚', + mingfu_info:'出牌阶段限一次,你可以将一张梅花牌当鬼幽结使用', + chuanyue:'穿月', + chuanyue_info:'出牌阶段限一次,你可以将两张手牌当决斗使用', + + miedao:'灭道', + miedao1:'灭道', + miedao2:'灭道', + miedao_info:'锁定技,摸牌阶段,你额外摸X张牌;弃牌阶段,你至少须弃X张牌(不足则全弃),X为你已损失的体力值。', + + polang:'破浪', + polang_info:'每当你造成一次伤害,可以弃置对方装备区内的所有牌。', + jikong:'亟空', + jikong2:'亟空', + jikong_info:'每当你失去最后一手手牌,可以对一名角色造成一点雷电伤害;回合开始阶段,你可以指定一名角色视为对其使用一张雷杀', + xiangu:'仙骨', + xiangu_info:'锁定技,你的手牌上限不会因体力值的减少而减少。', + yiesheng:'回雪', + yiesheng_info:'出牌阶段,你可以弃置任意数量的黑色手牌,然后摸等量的牌。', + huajian:'化剑', + huajian_info:'出牌阶段结束时,你可以弃置一张牌,视为对一张角色使用一张杀', + xuanyuan:'轩辕', + xuanyuan_info:'锁定技,你无视轩辕剑的装备条件;失去轩辕剑时不流失体力', + jilve:'极略', + jilve2:'极略', + jilve_info:'回合内,你可以观看牌堆顶的两张牌,然后使用其中的基本牌或锦囊牌', + gongshen:'工神', + gongshen_info:'任意一名其他角色使用一张基本牌或锦囊牌指定目标后,你可以弃置一张装备牌令其失效', + + liuhong:'流虹', + liuhong_info:'每当你使用或打出一张杀,可以摸一张牌', + poyue:'破月', + poyue_info:'锁定技,你的黑杀无视距离,红色不计入回合内的出杀限制且不可闪避', + mojian:'墨剑', + mojian_info:'每当你使用杀并指定目标后,你可以令其摸一张牌,然后你回复一点体力', + duanyue:'断月', + duanyue_info:'出牌阶段限一次,你可以弃置一张装备牌,对一名其他角色造成一点伤害,并弃其所有手牌。若弃置的手牌数不少于3,你流失一点体力', + fengmo:'封魔', + fengmo_info:'出牌阶段限一次,你可以弃置场所有武器牌(至少两张),然后令一名未翻面的角色摸等量的牌并翻面', + pozhou:'破咒', + pozhou_bg:'破', + pozhou2:'破咒', + pozhou3:'破咒', + pozhou3_bg:'咒', + pozhou_info:'每当你受到一次伤害,你获得一枚破咒标记。在其他角色的回合开始阶段,你可以弃置一枚破咒标记令其所有非锁定技失效直到下一回合开始', + xuanzhou:'玄咒', + xuanzhou_info:'出牌阶段限一次,你可以将一张非延时锦囊牌当作任意一张延时锦囊,对任意一名角色使用(无视锦囊使用范围限制)', + ningxian:'凝霰', + ningxian_info:'每当你受到一次伤害,你可以弃置任意张黑色牌并选择等量其他角色对其各造成一点伤害', + guanhu:'贯鹄', + guanhu_info:'每当你使用杀造成伤害,你可以弃置对方一张牌', + chuanyang:'穿杨', + chuanyang_info:'每当你使用一张杀,若你不在目标的攻击范围,你可以令此杀不可闪避', + fengming:'凤鸣', + fengming_info:'出牌阶段限一次,你可以弃置一张装备牌,令一名角色恢复一点体力并摸一张牌', + duanxing:'锻星', + duanxing_info:'每当你装备一张装备牌,可以视为一名角色使用一张杀', + wanjun:'万钧', + wanjun_info:'你可以将一张装备牌当作南蛮入侵使用', + dunxing:'遁形', + dunxing_info:'锁定技,体力值比你多的角色无法在回合内对你使用卡牌', + guiying:'鬼影', + guiying_info:'你可以将一张黑色牌当偷梁换柱使用', + shehun:'摄魂', + shehun_info:'出牌阶段限一次,你可以弃置任意张花色不同的牌,另一名其他角色弃置等量的牌,若其弃置的牌中有牌的花色与你弃置的牌相同,你对其造成一点伤害', + + + zhanlu:'沾露', + luomu:'落木', + jifeng:'魔影', + liaoyuan:'燎原', + chongsheng:'重生', + huanhun:'唤魂', + daixing:'代形', + yishan:'异闪', + yishan2:'异闪', + swd_wuxie:'无邪', + qingcheng:'倾城', + xianjiang:'仙匠', + xianjiang3:'仙匠', + shengong:'神工', + ningjian:'凝剑', + ningjian1:'凝剑', + ningjian2:'凝剑', + taixu:'太虚', + duoren:'夺刃', + tanlin:'探麟', + tanlin2:'探麟', + pozhen:'破阵', + yunchou:'运筹', + tianshu:'天书', + tianshu2:'天书', + xingdian:'星点', + luomei:'落梅', + yulin:'玉鳞', + funiao:'符鸟', + lingbo:'凌波', + xuehuang:'血凰', + zhuyu:'朱羽', + ningshuang:'凝霜', + zaowu:'造物', + // shouhua:'收化', + xielv:'谐率', + tianhuo:'天火', + huanyin:'幻音', + tianlun:'天轮', + longyin:'龙吟', + lanzhi:'兰芷', + duanyi:'断意', + miesheng:'灭生', + guxing:'孤星', + guxing1:'孤星', + guxing2:'孤星', + poxing:'破星', + mohua:'魔化', + miles_xueyi:'血裔', + wuying:'无影', + xiehun:'邪魂', + xiehun1:'邪魂', + xiehun2:'邪魂', + xiehun3:'邪魂', + jumo:'聚魔', + duijue:'对决', + yueren:'月刃', + busi:'不死', + xuying:'虚影', + yinguo:'因果', + guiyan:'鬼眼', + guiyan2:'鬼眼', + swd_xiuluo:'修罗', + yunshen:'云身', + yunshen2:'云身', + suiyan:'碎岩', + suiyan_info:'每当你造成一次伤害,可以弃置一张牌并弃置对方的全部装备牌', + xianyin:'散结', + qiaoxie:'巧械', + xiaoji2:'巧械', + xuanfeng2:'巧械', + mailun:'脉轮', + mailun31:'脉轮', + mailun32:'脉轮', + mailun41:'脉轮', + mailun42:'脉轮', + swdshelie:'涉猎', + kunlunjing:'镜界', + kunlunjing1:'镜界', + kunlunjing2:'镜界', + susheng:'苏生', + shengshou:'圣手', + huanjian:'幻箭', + yuhuo:'浴火', + huanjian_info:'你可以将一张黑色手牌当作毒箭使用', + shengshou_info:'你可以将一张黑色手牌当作草药使用', + susheng_info:'在任意一名角色即将死亡时,你可以弃置一张手牌防止其死亡,并将其体力回复至1', + zhanlu_info:'出牌阶段,你可以弃置一张黑桃牌令至多3名角色各回复一点体力', + kunlunjing_info:'回合开始前或当你受到一次伤害后,你可以令场上所有牌还原到你上一回合结束后的位置;若在回合开始前发动,你流失一点体力', + swdshelie_info:'摸牌阶段,你可以放弃摸牌,改为从牌堆顶亮出五张牌,你获得不同花色的牌各一张,将其余的牌置入弃牌堆。', + swd_xiuluo_info:'回合开始阶段,你可以弃一张手牌来弃置你判断区里的一张延时类锦囊(必须花色相同)', + xianyin_info:'出牌阶段,你可以令所有判定区内有牌的角色弃置判定区内的牌,然后交给你一张手牌', + qiaoxie_info:'每当你装备一张牌,可摸一张牌,每当你失去一张装备牌(不含替换),你可以弃置其他角色的一张牌', + mailun_info:'回合开始阶段,你可以选择如下效果:一、减少一点体力并增加一点体力上限(不能超过6);二、增加一点体力并减'+ + '少一点体力上限;三、令你即将造成和即将受到的首次伤害-1;四、令你即将造成和即将受到的首次伤害+1;五、少摸一张牌并令手牌上限+1'+ + ';六、多摸一张牌并令手牌上限-1;七、进攻距离+1,防御距离-1;八、进攻距离-1,防御距离+1', + yunshen_info:'每当你打出一张闪,你可以令其他角色与你的距离+1;回合开始阶段,你将累计的防御距离清零,然后摸等量的牌', + guiyan_info:'出牌阶段,你可以观看一名角色的手牌,并获得其中一张梅花牌,每阶段限一次。当你首次进入濒死状态时,你须回复一点体力并失去技能鬼眼', + busi_info:'锁定技,你死亡后每次轮过你时你自动复活', + xuying_info:'锁定技,每当你即将受到伤害,你防止此伤害,若你此时有手牌,你流失一点体力', + yinguo_info:'除你之外的任意一名角色即将受到受到伤害时,若有伤害来源,你可以弃置一张牌将伤害来源和目标对调', + yueren_info:'每当你使用一张杀,可以进行一次判定,若结果为黑色,你弃置目标一张牌,若结果为红色,你将此杀收回,每回合限发动一次', + duijue_info:'限定技,出牌阶段,你可以指定一名角色与其单挑,直到一方死亡为止', + wuying_info:'锁定技,你的杀和单体锦囊目标锁定为范围内的所有角色', + xiehun_info:'锁定技,受到来自你伤害的角色进入混乱状态,行为不受控制,且会攻击队友,直到你的下一回合开始', + jumo_info:'锁定技,回合结束阶段,你摸X-1张牌,X为未进入混乱状态的角色数与进入混乱状态的角色数之差(若为双将则改为X)', + jifeng_info:'你的杀和单体锦囊可以额外指定任意个目标,若如此做,此卡牌有一定机率失效,指定的目标越多失效的概率越大', + mohua_info:'锁定技,在身份局中,当你进入濒死状态时,你立即变身为撒旦,体力上限变为现存角色数(至少为4),并成为其他所有角色的共同敌人', + miles_xueyi_info:'锁定技,你防止即将受到的伤害,然后流失一点体力', + duanyi_info:'出牌阶段限一次,你可以弃置两张杀,对一名角色造成一点伤害,然后其翻面并摸X张牌,X为其已损失的体力值', + guxing_info:'出牌阶段,你可以将最后至多X张手牌当杀使用,此杀无视距离且可以指定至多3个目标,每造成一次伤害,你摸一张牌,X为你已损失的体力值且至少为1。', + tianlun_info:'任意一名角色的判定生效前,你可以弃置一张场上角色的判定牌替换之', + longyin_info:'出牌阶段,你可以弃置任意张颜色相同且点数不同的牌,并获得逆时针座位距离与卡牌点数相同的角色区域内的一张牌。每阶段限一次', + lanzhi_info:'每当你即将造成伤害,可以防止此伤害,然后摸两张牌。每回合限发动一次。', + tianhuo_info:'出牌阶段,你可以令所有角色弃置其判定区域内的牌,并受到没有来源的等量火焰伤害,每阶段限一次', + huanyin_info:'锁定技,每当你成为其他角色的卡牌的目标时,你进行一次判定,若为黑桃则取消之,若为红桃你摸一张牌', + luomu_info:'锁定技,每当你造成伤害时,受伤害角色随机弃置一张牌', + poxing_info:'锁定技,每当你即将造成伤害,若目标的体力值大于你,你令伤害+1', + liaoyuan_info:'每当你使用一张杀结算完毕后,可以将一张与此牌花色相同的牌当杀对目标使用', + yuhuo_info:'限定技,濒死阶段,你可以重置角色牌,减少一点体力上限,然后将体力回复至体力上限', + yishan_info:'每当你受到一次伤害,你可以重新获得最近失去的两张牌', + huanhun_info:'当一名角色进入濒死状态时,你可以弃置一张牌令其进行一次判定,若结果为红色,其回复一点体力', + daixing_info:'回合结束阶段,你可以弃置至多X张牌,并抵挡等量伤害,效果在下一个回合结束阶段失效,X为现存角色数-1', + swd_wuxie_info:'锁定技,你不能成为其他角色的延时锦囊的目标', + qingcheng_info:'回合开始阶段,你可以进行判定,若为红色则可以继续判定,判定结束后将判定成功的牌收入手牌', + xianjiang_info:'出牌阶段,你可以将一张装备牌永久转化为任意一张其它装备牌,一张牌在一个阶段只能转化一次', + xianjiang3_info:'出牌阶段,若你装备区内没有牌,你可以弃置一张锦囊牌,并从牌堆中随机获得一张装备牌,若牌堆中没有装备牌,你摸一张牌,每阶段限一次', + shengong_info:'每当你需要打出一张杀或闪时,你可以弃置一名角色装备区内的一张武器牌或防具牌,视为打出一张杀或闪,然后该角色摸一张牌,你弃一张牌', + ningjian_info:'你可以将一张红色牌当闪、黑色牌当杀使用或打出', + taixu_info:'限定技,你可以弃置你的所有牌(至少1张),并对一名体力值大于1为其他角色造成X点火焰伤害,X为你已损失的体力值且至少为1', + duoren_info:'每当你闪避一张杀,你可以立即获得来源的武器牌', + tanlin_info:'出牌阶段限一次,你可以与一名其他角色进行拼点,若你赢,你获得双方拼点牌、对该角色使用卡牌无视距离且可以额外使用一张杀直到回合结束,若你没赢,你受到该角色的一点伤害。', + pozhen_info:'每当你受到一次伤害,若你的手牌数大于伤害来源,你可以弃置X张手牌对其造成一点伤害;若你的手牌数小于伤害来源,你可以弃置其X张手牌。X为你与伤害来源的手牌数之差。', + yunchou_info:'出牌阶段限一次,你可以弃置任意张手牌,并弃置一张其他角色的手牌,你弃置的手牌中每有一张与此牌的颜色相同,你摸一张牌,否则对方摸一张牌', + tianshu_info:'回合开始阶段,你可以获得场上一名存活角色的一项技能;出牌阶段,你可以弃置一张锦囊牌,然后更换一项技能', + luomei_info:'每当你使用或打出一张梅花花色的牌,你可以摸一张牌', + xingdian_info:'出牌阶段限一次,你可以弃置一张手牌,然后指定至多两名角色令其各弃置一张牌', + yulin_info:'每当你即将受到伤害,你可以弃置一张装备牌抵消此伤害', + funiao_info:'出牌阶段,你可以交给一名角色一张手牌,然后观看其手牌,每个阶段对一名角色只能发动一次', + zhexian_info:'每当你使用或打出一张闪,你可以摸两张牌', + lingbo_info:'每当你使用或打出一张闪,你可以摸两张牌', + xuehuang_info:'出牌阶段限一次,你可以弃置一张红色手牌令距离你一以内的所有角色受到一点火焰伤害', + zhuyu_info:'每当有横置的角色即将受到非火焰伤害,你可以弃置一张红色牌使其额外受到一点火焰伤害', + ningshuang_info:'每当你成为黑色牌的目标,你可以弃置一张黑色牌将其横置,并摸一张牌,若其已经模置则将其翻面', + zaowu_info:'出牌阶段,你可以弃置三张不同类型的牌,创造任意两张牌并获得之', + xielv_info:'弃牌阶段结束后,若你的所有手牌(至少两张)颜色均相同,你可以展示所有手牌,然后选择一项:1、回复一点体力;2、弃置场上所有与你手牌颜色不同的牌', + }, +} diff --git a/character/test.md b/character/test.md new file mode 100644 index 000000000..6c2349aa4 --- /dev/null +++ b/character/test.md @@ -0,0 +1,24 @@ +御剑+诸方神石 +诸葛诞 观星 安恤 利奴 + +赛特 +徐暮云 +皇甫朝云 +云天河 +拓跋玉儿 +慕容诗 +慕容紫英 +水镜 + +柳梦璃 +壶中仙 +古月圣 +轩辕剑仙 +于小雪 +方兰生 + +独孤宁珂 +王思月 +陈靖仇 +车芸 +阿阮 diff --git a/character/wind.js b/character/wind.js new file mode 100644 index 000000000..30f5f748d --- /dev/null +++ b/character/wind.js @@ -0,0 +1,474 @@ +character.wind={ + character:{ + xiahouyuan:['male','wei',4,['shensu'],['fullskin']], + caoren:['male','wei',4,['jushou'],['fullskin']], + huangzhong:['male','shu',4,['liegong'],['fullskin']], + weiyan:['male','shu',4,['kuanggu'],['fullskin']], + xiaoqiao:['female','wu',3,['tianxiang','hongyan'],['fullskin']], + zhoutai:['male','wu',4,['buqu','fenji'],['fullskin']], + zhangjiao:['male','qun',3,['leiji','guidao','huangtian'],['zhu','fullskin']], + diy_zhangjiao:['male','qun',3,['diyleiji','guidao','huangtian'],['zhu','fullskin']], + // spzhangjiao:['male','qun',3,['spleiji','guidao','huangtian'],['zhu']], + // yuji:['male','qun',3,['guhuo']], + }, + skill:{ + shensu:{ + group:['shensu1','shensu2'] + }, + shensu1:{ + trigger:{player:'phaseBegin'}, + direct:true, + content:function(){ + "step 0" + player.addSkill('shensu3'); + var check= player.num('h')>2; + player.chooseTarget('是否发动神速?',function(card,player,target){ + if(player==target) return false; + return player.canUse({name:'sha'},target); + }).ai=function(target){ + if(!check) return 0; + return ai.get.effect(target,{name:'sha'},_status.event.player); + } + "step 1" + if(result.bool){ + player.logSkill('shensu1',result.targets); + player.useCard({name:'sha'},result.targets[0],false); + player.skip('phaseJudge'); + player.skip('phaseDraw'); + } + player.removeSkill('shensu3'); + } + }, + shensu2:{ + trigger:{player:'phaseUseBefore'}, + direct:true, + filter:function(event,player){ + return player.num('he',{type:'equip'})>0; + }, + content:function(){ + "step 0" + player.addSkill('shensu3'); + var check=player.num('h')<=player.hp; + player.chooseCardTarget({ + prompt:'是否发动【神速】?', + filterCard:function(card){ + return get.type(card)=='equip' + }, + position:'he', + filterTarget:function(card,player,target){ + if(player==target) return false; + return player.canUse({name:'sha'},target); + }, + ai1:function(card){ + if(!check) return 0; + return 6-ai.get.value(card); + }, + ai2:function(target){ + if(!check) return 0; + return ai.get.effect(target,{name:'sha'},_status.event.player); + } + }); + "step 1" + if(result.bool){ + player.logSkill('shensu2',result.targets); + player.discard(result.cards[0]); + player.useCard({name:'sha'},result.targets[0]); + trigger.untrigger(); + trigger.finish(); + } + player.removeSkill('shensu3'); + } + }, + shensu3:{ + mod:{ + targetInRange:function(card,player,target,now){ + return true; + } + }, + }, + jushou:{ + trigger:{player:'phaseEnd'}, + content:function(){ + player.turnOver(); + player.draw(3); + } + }, + liegong:{ + trigger:{player:'shaBegin'}, + filter:function(event,player){ + var length=event.target.num('h'); + return (length>=player.hp||length<=get.attackRange(player)); + }, + content:function(){ + trigger.directHit=true; + } + }, + kuanggu:{ + trigger:{source:'damageEnd'}, + forced:true, + filter:function(event,player){ + return get.distance(player,event.player)<=1; + }, + content:function(){ + player.recover(trigger.num); + } + }, + tianxiang:{ + trigger:{player:'damageBefore'}, + direct:true, + filter:function(event,player){ + return player.num('h',{suit:'heart'})>0&&event.num>0; + }, + content:function(){ + "step 0" + player.chooseCardTarget({ + filterCard:function(card){ + return get.suit(card)=='heart'; + }, + filterTarget:function(card,player,target){ + return player!=target; + }, + ai1:function(card){ + return 10-ai.get.value(card); + }, + ai2:function(target){ + if(trigger.num>1){ + if(target.maxHp>5&&target.hp>1) return 0; + return -att; + } + var eff=ai.get.damageEffect(target,trigger.source,target,trigger.nature); + var att=ai.get.attitude(player,target); + if(att==0) return 0.1; + if(eff>=0&&trigger.num==1){ + return att; + } + if(target.hp==target.maxHp) return -att; + if(target.hp==1){ + if(target.maxHp<=4&&!target.hasSkillTag('maixie')){ + if(target.maxHp<=3){ + return -att; + } + return -att/2; + } + return 0; + } + if(target.hp==target.maxHp-1){ + if(target.hp>2||target.hasSkillTag('maixie')) return att/5; + if(att>0) return 0.02; + return 0.05; + } + return att/2; + }, + prompt:'天香:弃置一张红桃牌转移伤害' + }); + "step 1" + if(result.bool){ + player.logSkill('tianxiang',result.targets); + trigger.untrigger(); + trigger.player=result.targets[0]; + trigger.player.addSkill('tianxiang2'); + player.discard(result.cards[0]); + } + else{ + event.finish(); + } + "step 2" + trigger.trigger('damageBefore'); + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(player.skills.contains('jueqing')) return; + if(get.tag(card,'damage')&&target.num('h')>1) return 0.7; + } + }, + threaten:function(player,target){ + if(target.num('h')==0) return 2; + } + } + }, + tianxiang2:{ + trigger:{player:['damageAfter','damageCancelled']}, + forced:true, + popup:false, + content:function(){ + if(player.hp0}, + content:function(){ + "step 0" + event.card=get.cards()[0]; + if(player.storage.buqu==undefined) player.storage.buqu=[]; + player.storage.buqu.push(event.card); + event.dialog=ui.create.dialog('不屈',player.storage.buqu); + var str=get.translation(player)+'的不屈牌为'+player.storage.buqu[0].number; + for(var i=1;i2; + }, + content:function(){ + "step 0" + player.loseHp(); + "step 1" + trigger.player.draw(2); + }, + }, + leiji:{ + trigger:{player:'respond'}, + filter:function(event,player){ + return event.card.name=='shan'; + }, + direct:true, + content:function(){ + "step 0"; + player.chooseTarget('是否发动雷击?').ai=function(target){ + return ai.get.damageEffect(target,player,player); + }; + "step 1" + if(result.bool){ + player.logSkill('leiji',result.targets,'thunder'); + event.target=result.targets[0]; + event.target.judge(function(card){ + if(get.suit(card)=='spade') return -4; + return 0; + }); + } + else{ + event.finish(); + } + "step 2" + if(result.bool==false){ + event.target.damage(2,'thunder'); + } + }, + ai:{ + mingzhi:false, + effect:{ + target:function(card,player,target,current){ + if(get.tag(card,'respondShan')){ + var hastarget=false; + for(var i=0;i0; + }, + direct:true, + content:function(){ + "step 0" + player.chooseCard('请选择替换判定的牌','he',function(card){ + return get.color(card)=='black'; + }).ai=function(card){ + var trigger=_status.event.parent._trigger; + var player=_status.event.player; + var result=trigger.judge(card)-trigger.judge(trigger.player.judging); + var attitude=ai.get.attitude(player,trigger.player); + if(attitude==0||result==0) return 0; + if(attitude>0){ + return result; + } + else{ + return -result; + } + }; + "step 1" + if(result.bool){ + player.respond(result.cards); + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + player.logSkill('guidao'); + player.$gain2(trigger.player.judging); + player.gain(trigger.player.judging); + trigger.player.judging=result.cards[0]; + trigger.position.appendChild(result.cards[0]); + game.log(get.translation(trigger.player)+'的判定牌改为'+get.translation(result.cards[0])); + } + "step 3" + game.delay(2); + }, + ai:{ + tag:{ + rejudge:1 + } + } + }, + guhuo:{ + trigger:{player:'phaseBegin'}, + forced:true, + content:function(){ + player.draw(); + player.chooseToDiscard('hej',true).ai=ai.get.disvalue; + }, + ai:{ + effect:{ + target:function(card){ + if(get.type(card)=='delay') return [0,1]; + } + } + } + }, + huangtian:{ + unique:true, + global:'huangtian2' + }, + huangtian2:{ + enable:'phaseUse', + discard:false, + line:true, + prepare:function(cards,player,targets){ + player.$give(cards,targets[0]); + }, + filter:function(event,player){ + if(!game.zhu) return false; + return (player!=game.zhu&&game.zhu.skills.contains('huangtian')&&player.group=='qun') + }, + filterCard:function(card){ + return (card.name=='shan'||card.name=='shandian') + }, + filterTarget:function(card,player,target){ + return target==game.zhu; + }, + usable:1, + content:function(){ + target.gain(cards); + }, + ai:{ + expose:0.3, + order:10, + result:{ + target:5 + } + } + } + }, + translate:{ + xiahouyuan:'夏侯渊', + caoren:'曹仁', + huangzhong:'黄忠', + weiyan:'魏延', + xiaoqiao:'小乔', + zhoutai:'周泰', + zhangjiao:'张角', + spzhangjiao:'张角', + yuji:'于吉', + shensu:'神速', + shensu1:'神速', + shensu2:'神速', + jushou:'据守', + liegong:'烈弓', + kuanggu:'狂骨', + tianxiang:'天香', + hongyan:'红颜', + buqu:'不屈', + leiji:'雷击', + spleiji:'新雷击', + guidao:'鬼道', + huangtian:'黄天', + huangtian2:'黄天', + guhuo:'蛊惑', + fenji:'奋激', + shensu_info: + '你可以跳过摸牌阶段,或跳过出牌阶段并弃置一张装备牌,'+ + '若如此则视为对任意一名使用一张【杀】', + jushou_info: + '回合结束阶段,你可以将武将牌翻页并摸3张牌', + liegong_info: + '当你使用【杀】时,若目标的手牌数大于等于你的体力值,或小于等于你的攻击范围,你可令此【杀】不能闪避', + kuanggu_info: + '锁定技,每当你造成一点伤害,若受伤害角色与你的距离不大于1,你回复一点体力', + tianxiang_info: + '当你即将受到伤害时,你可以弃置一张红桃牌将伤害转移给任意一名其他角色,然后该角色摸x张牌,x为其已损失体力值', + hongyan_info: + '锁定技,你的黑桃牌均视为红桃', + buqu_info: + '锁定技,每当你扣减1点体力后,若你当前的体力值为0,你可以将牌堆顶的一张牌置于你的武将牌上,'+ + '称为“创”,若所有“创”的点数均不同,你不会死亡。你的手牌上限为“创”的个数', + leiji_info: + '每当你使用或打出一张【闪】,可令任意一名角色进行一次判定,若结果为黑桃,其受到两点雷电伤害', + spleiji_info: + '每当你使用或打出一张【闪】,可令任意一名角色进行一次判定,若结果为黑色,其受到一点雷电伤害,然后你回复一点体力', + guidao_info: + '任意一名角色的判定生效前,你可以打出一张黑色牌替换之', + huangtian_info: + '主公技,群雄角色可在他们各自的回合里给你一张【闪】或【闪电】。', + guhuo_info: + '锁定技,回合开始阶段,你摸一张牌并弃置区域内的一张牌', + fenji_info: + '每当一名角色的手牌于回合外被弃置时,你可以失去1点体力,然后该角色摸两张牌。' + }, +} diff --git a/character/woods.js b/character/woods.js new file mode 100644 index 000000000..06fb57afa --- /dev/null +++ b/character/woods.js @@ -0,0 +1,719 @@ +character.woods={ + character:{ + menghuo:['male','shu',4,['huoshou','zaiqi'],['fullskin']], + zhurong:['female','shu',4,['juxiang','lieren'],['fullskin']], + caopi:['male','wei',3,['xingshang','fangzhu','songwei'],['zhu','fullskin']], + xuhuang:['male','wei',4,['duanliang'],['fullskin']], + lusu:['male','wu',3,['haoshi','dimeng'],['fullskin']], + sunjian:['male','wu',4,['yinghun'],['fullskin']], + dongzhuo:['male','qun',8,['jiuchi','roulin','benghuai','baonue'],['zhu','fullskin']], + jiaxu:['male','qun',3,['luanwu','wansha','weimu'],['fullskin']], + }, + skill:{ + huoshou:{ + locked:true, + group:['huoshou1','huoshou2'], + ai:{ + effect:{ + target:function(card,player,target){ + if(card.name=='nanman') return 0; + } + } + } + }, + huoshou1:{ + trigger:{target:'useCardToBefore'}, + forced:true, + filter:function(event,player){ + return (event.card.name=='nanman'); + }, + content:function(){ + trigger.untrigger(); + trigger.finish(); + }, + }, + huoshou2:{ + trigger:{global:'damageBefore'}, + forced:true, + filter:function(event,player){ + return (event.card&&event.card.name=='nanman'); + }, + content:function(){ + trigger.source=player; + } + }, + zaiqi:{ + trigger:{player:'phaseDrawBefore'}, + filter:function(event,player){ + return player.hp=2; + } + return true; + }, + content:function(){ + "step 0" + trigger.untrigger(); + trigger.finish(); + event.cards=get.cards(player.maxHp-player.hp); + player.showCards(event.cards); + "step 1" + var num=0; + for(var i=0;i0 + }, + content:function(){ + "step 0" + player.gain(trigger.cards); + player.$draw(trigger.cards); + //trigger.player.$give(trigger.cards,player); + game.delay(); + // var card=trigger.cards; + // var str=get.translation(player)+'获得了'+get.translation(card[0]); + // for(var i=1;i0){ + if(target.classList.contains('turnedover')) return 1000-target.num('h'); + if(player.maxHp-player.hp<3) return -1; + return 100-target.num('h'); + } + else{ + if(target.classList.contains('turnedover')) return -1; + if(player.maxHp-player.hp>=3) return -1; + return 1+target.num('h'); + } + } + "step 1" + if(result.bool){ + player.logSkill('fangzhu',result.targets); + result.targets[0].draw(player.maxHp-player.hp); + result.targets[0].turnOver(); + } + }, + ai:{ + maixie:true, + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-2]; + var hastarget=false; + var hasfriend=false; + var turnfriend=false; + for(var i=0;i0&&game.players[i].isTurnedOver()){ + hastarget=true; + turnfriend=true; + } + if(game.players[i]!=target&&ai.get.attitude(game.players[i],target)>=0){ + hasfriend=true; + } + } + if(ai.get.attitude(player,target)>0&&!hastarget) return; + if(!hasfriend) return; + if(turnfriend||target.hp==target.maxHp) return [0.5,1]; + if(target.hp>1) return [1,1]; + } + } + } + } + }, + songwei:{ + unique:true, + global:'songwei2', + }, + songwei2:{ + trigger:{player:'judgeEnd'}, + filter:function(event,player){ + if(!game.zhu) return false; + return (player!=game.zhu&&game.zhu.skills.contains('songwei')&&player.group=='wei'&&get.color(event.result.card)=='black'); + }, + check:function(event,player){ + return ai.get.attitude(player,game.zhu)>0; + }, + content:function(){ + game.zhu.draw(); + } + }, + duanliang:{ + group:['duanliang1','duanliang2'], + ai:{ + threaten:1.2 + } + }, + duanliang1:{ + enable:'chooseToUse', + filterCard:function(card){ + if(get.type(card)=='trick') return false; + if(get.type(card)=='delay') return false; + return get.color(card)=='black'; + }, + position:'he', + viewAs:{name:'bingliang'}, + prompt:'将一黑色的基本牌或装备牌当兵粮寸断使用', + check:function(card){return 6-ai.get.value(card)}, + ai:{ + order:9 + } + }, + duanliang2:{ + mod:{ + targetInRange:function(card,player,target){ + if(card.name=='bingliang'){ + if(get.distance(player,target)<=2) return true; + } + } + } + }, + haoshi:{ + trigger:{player:'phaseDrawBegin'}, + threaten:1.4, + check:function(event,player){ + if(player.num('h')<=1) return true; + var min=[]; + var temp=player.next.num('h'); + for(var i=0;i0) return true; + } + return false; + }, + content:function(){ + trigger.num+=2; + player.addSkill('haoshi2'); + }, + ai:{ + threaten:2 + } + }, + haoshi2:{ + trigger:{player:'phaseDrawEnd'}, + forced:true, + popup:false, + content:function(){ + "step 0" + player.removeSkill('haoshi2'); + if(player.num('h')<=5){ + event.finish(); + return; + } + var temp=player.next.num('h'); + for(var i=0;i3) list.push(game.players[i]); + } + list.sort(function(a,b){ + return a.num('h')-b.num('h'); + }); + if(list.length==0) return -1; + var from=list[0]; + list.length=0; + + for(var i=0;i=list[0].num('h')) return -1; + for(var i=0;i=2) return -1; + if(ui.selected.cards.length3) list.push(game.players[i]); + } + list.sort(function(a,b){ + return a.num('h')-b.num('h'); + }); + if(target==list[0]) return ai.get.attitude(player,target); + return -ai.get.attitude(player,target); + } + else{ + var from=ui.selected.targets[0]; + for(var i=0;i=list[0].num('h')) return -ai.get.attitude(player,target); + for(var i=0;i=2) return -ai.get.attitude(player,target); + if(target==list[i]) return ai.get.attitude(player,target); + return -ai.get.attitude(player,target); + } + } + } + } + } + } + }, + yinghun:{ + trigger:{player:'phaseBegin'}, + filter:function(event,player){ + return player.hp0){ + return 10+ai.get.attitude(_status.event.player,target); + } + if(player.maxHp-player.hp==1){ + return -1; + } + return 1; + } + "step 1" + if(result.bool){ + player.logSkill('yinghun',result.targets); + event.target=result.targets[0]; + player.chooseControl('yinghun_true','yinghun_false',function(event,player){ + if(ai.get.attitude(player,event.target)>0) return 'yinghun_true'; + return 'yinghun_false'; + }) + } + else{ + event.finish(); + } + "step 2" + if(result.control=='yinghun_true'){ + event.target.draw(player.maxHp-player.hp); + event.target.chooseToDiscard(true,'he'); + } + else{ + event.target.draw(); + event.target.chooseToDiscard(player.maxHp-player.hp,true,'he'); + } + }, + ai:{ + threaten:function(player,target){ + if(target.hp==1) return 2; + if(target.hp==2) return 1.5; + return 0.5; + }, + maixie:true, + effect:{ + target:function(card,player,target){ + if(target.maxHp<=3) return; + if(get.tag(card,'damage')){ + if(target.hp==target.maxHp) return [0,1]; + } + if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0]; + } + } + } + }, + jiuchi:{ + enable:'chooseToUse', + filterCard:function(card){ + return get.suit(card)=='spade'; + }, + viewAs:{name:'jiu'}, + prompt:'将一张黑桃手牌当酒使用', + check:function(card){ + if(_status.event.type=='dying') return 1; + return 4-ai.get.value(card); + } + }, + roulin:{ + trigger:{player:'shaBegin',target:'shaBegin'}, + forced:true, + filter:function(event,player){ + if(player==event.player){ + return event.target.sex=='female'; + } + return event.player.sex=='female'; + }, + check:function(event,player){ + return player==event.player; + }, + content:function(){ + "step 0" + var next=trigger.target.chooseToRespond({name:'shan'}); + next.autochoose=lib.filter.autoRespondShan; + next.ai=function(card){ + if(trigger.target.num('h','shan')>1){ + return ai.get.unuseful2(card); + } + return -1; + }; + "step 1" + if(result.bool==false){ + trigger.untrigger(); + trigger.directHit=true; + } + } + }, + benghuai:{ + trigger:{player:'phaseEnd'}, + forced:true, + check:function(){ + return false; + }, + filter:function(event,player){ + for(var i=0;i0; + }, + content:function(){ + "step 0" + player.judge(function(card){ + if(get.suit(card)=='spade') return 4; + return 0; + }) + "step 1" + if(result.bool){ + game.zhu.recover(); + } + } + }, + luanwu:{ + unique:true, + enable:'phaseUse', + filter:function(event,player){ + return !player.storage.luanwu; + }, + content:function(){ + "step 0" + player.storage.luanwu=true; + event.current=player.next; + "step 1" + event.current.chooseToUse({name:'sha'},function(card,player,target){ + if(player==target) return false; + if(get.distance(player,target)<=1) return true; + for(var i=0;i0) att=1; + if(att<0) att=-1; + if(game.players[i]!=player&&game.players[i].hp<=3){ + if(game.players[i].num('h')==0) num+=att/game.players[i].hp; + else if(game.players[i].num('h')==1) num+=att/2/game.players[i].hp; + else if(game.players[i].num('h')==2) num+=att/4/game.players[i].hp; + } + if(game.players[i].hp==1) num+=att*1.5; + } + // console.log(num); + if(player.hp==1){ + return -num; + } + if(player.hp==2){ + return -game.players.length/4-num; + } + return -game.players.length/3-num; + } + } + } + }, + wansha:{ + locked:true, + global:'wansha2' + }, + wansha2:{ + mod:{ + cardSavable:function(card,player){ + if(_status.currentPhase.skills.contains('wansha')&&_status.currentPhase!=player){ + if(card.name=='tao'&&_status.dying!=player) return false; + } + } + } + }, + weimu:{ + mod:{ + targetEnabled:function(card){ + if((get.type(card)=='trick'||get.type(card)=='delay')&& + get.color(card)=='black') return false; + } + } + }, + }, + translate:{ + zhurong:'祝融', + menghuo:'孟获', + caopi:'曹丕', + xuhuang:'徐晃', + lusu:'鲁肃', + sunjian:'孙坚', + dongzhuo:'董卓', + jiaxu:'贾诩', + huoshou:'祸首', + huoshou1:'祸首', + huoshou2:'祸首', + zaiqi:'再起', + juxiang:'巨象', + juxiang1:'巨象', + juxiang2:'巨象', + lieren:'烈刃', + xingshang:'行殇', + fangzhu:'放逐', + songwei:'颂威', + songwei2:'颂威', + duanliang:'断粮', + duanliang1:'断粮', + haoshi:'好施', + dimeng:'缔盟', + yinghun:'英魂', + yinghun_true:'摸X弃1', + yinghun_false:'摸1弃X', + jiuchi:'酒池', + roulin:'肉林', + benghuai:'崩坏', + baonue:'暴虐', + baonue2:'暴虐', + baonue_hp:'体力', + baonue_maxHp:'体力上限', + luanwu:'乱舞', + wansha:'完杀', + weimu:'帷幕', + huoshou_info:'【南蛮入侵】对你无效;你是任何【南蛮入侵】造成伤害的来源。', + zaiqi_info:'摸牌阶段,若你已受伤,你可以放弃摸牌并展示牌堆顶的X张牌,X为你已损失的体力值,其中每有一张♥牌,你回复1点体力,然后弃掉这些♥牌,将其余的牌收入手牌。', + juxiang_info:'南蛮入侵】对你无效;若其他角色使用的【南蛮入侵】在结算完时进入弃牌堆,你立即获得它。', + lieren_info:'你每使用【杀】造成一次伤害,可与受到该伤害的角色拼点;若你赢,你获得对方的一张牌。', + xingshang_info:'你可以立即获得死亡角色的所有牌。', + fangzhu_info:'你每受到一次伤害,可令除你以外的任一角色补X张牌,X为你已损失的体力值,然后该角色将其武将牌翻面。', + songwei_info:'其他魏势力的角色的判定牌结果为♠或♣且失效后,可以让你摸一张牌。', + duanliang_info:'出牌阶段,你可以将你的任意一张♠或♣的基本牌或装备牌当【兵粮寸断】使用;你可以对与你距离2以内的角色使用【兵粮寸断】。', + haoshi_info:'摸牌阶段,你可以额外摸两张牌,若此时你的手牌数多于五张,你必须将一半(向下取整)的手牌交给场上除你外手牌数最少的一名角色。', + dimeng_info:'出牌阶段,你可以选择其他两名角色,你弃掉等同于这两名角色手牌数量的牌,然后交换他们的手牌,每回合限一次。', + yinghun_info:'回合开始阶段,若你已受伤,可选择一名其他角色执行下列两项中的一项: 1.摸X张牌,然后弃一张牌。 2.摸一张牌,然后弃X张牌。 X为你已损失的体力值,每回合限一次。', + jiuchi_info:'你可将你的任意一张♠手牌当【酒】使用。', + roulin_info:'你对女性角色、女性角色对你使用【杀】时,都需连续使用两张【闪】才能抵消。', + benghuai_info:'回合结束阶段,若你的体力不是全场最少的(或之一),你须减1点体力或体力上限。', + baonue:'其他群雄角色每造成一次伤害,可进行一次判定,若为♠,你回复1点体力。', + luanwu_info:'出牌阶段,可令除你外的所有角色依次对与其距离最近的另一名角色使用一张【杀】,无法如此做者失去1点体力。', + wansha_info:'在你的回合,除你以外,只有处于濒死状态的角色才能使用【桃】。', + weimu_info:'你不能成为♠或♣锦囊的目标。', + }, +} diff --git a/character/xianjian.js b/character/xianjian.js new file mode 100644 index 000000000..337dc74d5 --- /dev/null +++ b/character/xianjian.js @@ -0,0 +1,1405 @@ +character.xianjian={ + character:{ + pal_lixiaoyao:['male','qun',4,['xiaoyao','yujian'],['fullskin']], + pal_zhaoliner:['female','wei',3,['huimeng','tianshe'],['fullskin']], + pal_linyueru:['female','wei',3,['guiyuan','qijian'],['fullskin']], + + // pal_wangxiaohu:['male','qun',4,['guiyuan','qijian']], + // pal_sumei:['female','shu',3,['guiyuan','qijian']], + // pal_shenqishuang:['female','wei',3,['guiyuan','qijian']], + + + pal_jingtian:['male','wu',3,['sajin','jubao'],['fullskin']], + pal_xuejian:['female','shu',3,['shuangren','shenmu','duci'],['fullskin']], + // pal_longkui:['female','shu',3,['shuangren','shenmu','duci']], + // pal_longkuigui:['female','shu',3,['shuangren','shenmu','duci']], + pal_zixuan:['female','wei',3,['shuiyun','wangyou','changnian'],['fullskin']], + pal_changqing:['male','wei',4,['luanjian','tianfu'],['fullskin']], + + // pal_nangonghuang:['male','wei',3,[]], + // pal_wenhui:['female','shu',4,[]], + // pal_wangpengxu:['female','shu',3,[]], + // pal_xingxuan:['male','wei',3,[]], + // pal_xingxuan:['male','wei',3,[]], + + pal_yuntianhe:['male','wu',4,['longxi','zhuyue','guanri'],['fullskin']], + pal_hanlingsha:['female','shu',3,['tannang','tuoqiao'],['fullskin']], + pal_liumengli:['female','wei',3,['tianxian','runxin','zhimeng'],['fullskin']], + pal_murongziying:['male','wei',4,['xuanning','poyun','qianfang'],['fullskin']], + pal_xuanxiao:['male','wei',4,['xuanyan','ningbin','fenxin'],['fullskin']], + + }, + skill:{ + xuanyan:{ + trigger:{source:'damageBefore'}, + forced:true, + priority:5, + check:function(event,player){ + return player.hp>3; + }, + filter:function(event){ + return event.card&&get.color(event.card)=='red'; + }, + content:function(){ + trigger.nature='fire'; + }, + group:['xuanyan2','xuanyan3'] + }, + xuanyan2:{ + trigger:{source:'damageBegin'}, + forced:true, + filter:function(event){ + return event.nature=='fire'; + }, + content:function(){ + trigger.num++; + } + }, + xuanyan3:{ + trigger:{source:'damageEnd'}, + forced:true, + popup:false, + filter:function(event){ + return event.nature=='fire'; + }, + content:function(){ + player.loseHp(); + } + }, + ningbin:{ + trigger:{player:'damageEnd',source:'damageEnd'}, + forced:true, + filter:function(event){ + return event.nature=='thunder'; + }, + content:function(){ + player.recover(); + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'thunderDamage')){ + if(target.hp<=1) return [0,0]; + return [0,1.5]; + } + } + } + }, + }, + fenxin:{ + trigger:{player:'changeHp'}, + forced:true, + filter:function(event){ + return event.num!=0; + }, + content:function(){ + player.draw(Math.abs(trigger.num)); + }, + ai:{ + effect:{ + target:function(card){ + if(get.tag(card,'thunderDamage')) return; + if(get.tag(card,'damage')||get.tag(card,'recover')){ + return [1,0.2]; + } + } + } + }, + group:'fenxin2' + }, + fenxin2:{ + trigger:{source:'dieAfter'}, + forced:true, + content:function(){ + player.gainMaxHp(); + player.recover(); + } + }, + luanjian:{ + enable:'phaseUse', + filter:function(event,player){ + return player.num('h','sha')>1&&lib.filter.filterCard({name:'sha'},player); + }, + filterCard:{name:'sha'}, + selectCard:2, + check:function(card){ + var num=0; + var player=_status.event.player; + for(var i=0;i0){ + num++; + if(num>1) return 8-ai.get.value(card); + } + } + return 0; + }, + selectTarget:[1,Infinity], + discard:false, + prepare:function(cards,player,targets){ + player.$throw(cards); + player.line(targets); + }, + filterTarget:function(card,player,target){ + return lib.filter.targetEnabled({name:'sha'},player,target); + }, + content:function(){ + "step 0" + if(!player.skills.contains('unequip')){ + event.added=true; + player.skills.push('unequip'); + } + targets.sort(lib.sort.seat); + player.useCard({name:'sha'},cards,targets,'luanjian').animate=false; + "step 1" + if(event.added){ + player.skills.remove('unequip'); + } + }, + multitarget:true, + ai:{ + order:function(){ + return lib.card.sha.ai.order+0.1; + }, + result:{ + target:function(player,target){ + var added=false; + if(!player.skills.contains('unequip')){ + added=true; + player.skills.push('unequip'); + } + var eff=ai.get.effect(target,{name:'sha'},player,target); + if(added){ + player.skills.remove('unequip'); + } + return eff; + } + }, + effect:{ + player:function(card,player){ + if(_status.currentPhase!=player) return; + if(card.name=='sha'&&player.num('h','sha')<2&&player.num('h')<=player.hp){ + var num=0; + var player=_status.event.player; + for(var i=0;i1) return [0,0,0,0]; + } + } + } + } + }, + } + }, + tianfu:{ + enable:'phaseUse', + filter:function(event,player){ + return player.num('h','shan')>0; + }, + filterCard:{name:'shan'}, + discard:false, + prepare:function(cards,player,targets){ + player.$give(cards,targets[0]); + game.delay(); + }, + filterTarget:function(card,player,target){ + return target!=player&&!target.skills.contains('tianfu2'); + }, + check:function(card){ + if(_status.event.player.hp>=3) return 8-ai.get.value(card); + return 7-ai.get.value(card); + }, + content:function(){ + target.storage.tianfu2=cards[0]; + target.storage.tianfu3=player; + target.addSkill('tianfu2'); + }, + ai:{ + result:{ + target:function(player,target){ + var att=ai.get.attitude(player,target); + if(att>=0) return 0; + return ai.get.damageEffect(target,player,target); + } + }, + expose:0.2 + } + }, + tianfu2:{ + trigger:{source:'damageAfter'}, + forced:true, + mark:'card', + filter:function(event,player){ + return player.storage.tianfu2&&player.storage.tianfu3; + }, + content:function(){ + "step 0" + player.damage(player.storage.tianfu3.isAlive()?player.storage.tianfu3:'nosource'); + "step 1" + player.$throw(player.storage.tianfu2); + ui.discardPile.appendChild(player.storage.tianfu2); + delete player.storage.tianfu2; + delete player.storage.tianfu3; + player.removeSkill('tianfu2') + }, + group:'tianfu3', + intro:{ + content:'card' + } + }, + tianfu3:{ + trigger:{player:'dieBegin'}, + forced:true, + popup:false, + content:function(){ + if(player.storage.tianfu3.isAlive()){ + player.storage.tianfu3.gain(player.storage.tianfu2,'gain2'); + } + else{ + ui.discardPile.appendChild(player.storage.tianfu2); + } + delete player.storage.tianfu2; + delete player.storage.tianfu3; + player.removeSkill('tianfu2'); + } + }, + shuiyun:{ + trigger:{player:'phaseEnd'}, + direct:true, + init:function(player){ + player.storage.shuiyun=[]; + }, + filter:function(event,player){ + if(player.storage.shuiyun.length>=3) return false; + var types=[]; + for(var i=0;i2?1:0; + } + "step 1" + if(result.bool){ + player.storage.shuiyun.remove(result.links[0]); + if(!player.storage.shuiyun.length){ + player.unmarkSkill('shuiyun'); + } + player.$throw(result.links); + ui.discardPile.appendChild(result.links[0]); + trigger.player.recover(); + trigger.player.draw(); + if(player!=trigger.player){ + player.draw(); + } + player.logSkill('shuiyun5',trigger.player,'thunder'); + } + }, + ai:{ + expose:0.3 + } + }, + wangyou:{ + trigger:{global:'phaseEnd'}, + unique:true, + gainable:true, + direct:true, + filter:function(event,player){ + if(!player.num('he')) return false; + if(player==event.player) return false; + for(var i=0;i0) num++; + else if(att<0) num--; + targets.push(game.players[i]); + } + } + player.chooseToDiscard('是否对'+get.translation(targets)+'发动【忘忧】?','he').ai=function(card){ + if(num<=0) return 0; + switch(num){ + case 1:return 5-ai.get.value(card); + case 2:return 7-ai.get.value(card); + default:return 8-ai.get.value(card); + } + } + event.targets=targets; + "step 1" + if(result.bool){ + event.targets.sort(lib.sort.seat); + player.logSkill('wangyou',event.targets); + game.asyncDraw(event.targets); + } + else{ + event.finish(); + } + }, + ai:{ + expose:0.1, + threaten:1.2 + }, + group:'wangyou2' + }, + wangyou2:{ + trigger:{global:'damageEnd'}, + forced:true, + popup:false, + silent:true, + filter:function(event){ + return event.player.isAlive(); + }, + content:function(){ + trigger.player.addTempSkill('wangyou3','phaseAfter'); + } + }, + wangyou3:{}, + changnian:{ + trigger:{player:'dieBegin'}, + direct:true, + unique:true, + content:function(){ + "step 0" + player.chooseTarget('是否发动【长念】?',function(card,player,target){ + return player!=target; + }).ai=function(target){ + return ai.get.attitude(player,target); + }; + "step 1" + if(result.bool){ + var cards=player.get('hej'); + var target=result.targets[0]; + if(player.storage.shuiyun&&player.storage.shuiyun.length){ + target.gainMaxHp(); + target.recover(player.storage.shuiyun.length); + cards=cards.concat(player.storage.shuiyun); + player.storage.shuiyun.length=0; + } + player.$give(cards,target); + target.gain(cards); + target.addSkill('changnian2'); + player.logSkill('changnian',target); + } + }, + ai:{ + threaten:0.8 + } + }, + changnian2:{ + trigger:{player:'phaseEnd'}, + forced:true, + content:function(){ + player.draw(); + }, + }, + sajin:{ + enable:'phaseUse', + filterTarget:function(card,player,target){ + return target.hpplayer.hp){ + return 7-ai.get.value(card); + } + return 4-ai.get.value(card); + }, + content:function(){ + "step 0" + var suit=get.suit(cards[0]); + target.judge(function(card){ + return get.suit(card)==suit?1:0; + }); + "step 1" + if(result.bool){ + target.recover(); + } + }, + ai:{ + order:3, + result:{ + target:function(player,target){ + return ai.get.recoverEffect(target); + } + }, + threaten:1.2 + } + }, + jubao:{ + trigger:{global:'discardAfter'}, + filter:function(event,player){ + if(event.player==player) return false; + if(_status.currentPhase==player) return false; + for(var i=0;i0){ + return [1,3]; + } + } + } + } + } + } + }, + shuangren:{ + trigger:{player:['loseEnd']}, + filter:function(event,player){ + if(!player.equiping) return false; + for(var i=0;i0; + }, + content:function(){ + "step 0" + player.chooseTarget([1,trigger.cards.length],'是否发动【气剑】?',function(card,player,target){ + return player.canUse({name:'sha'},target,false); + }).ai=function(target){ + return ai.get.effect(target,{name:'sha'},player); + }; + "step 1" + if(result.bool){ + player.logSkill('qijian'); + player.useCard({name:'sha'},result.targets); + } + }, + }, + shenmu:{ + trigger:{global:'dying'}, + priority:6, + filter:function(event,player){ + return event.player.hp<=0&&player.num('h',{color:'red'}); + }, + check:function(event,player){ + if(ai.get.attitude(player,event.player)<=0) return false; + var cards=player.get('h',{color:'red'}); + for(var i=0;i7&&cards.length>2) return false; + } + }, + content:function(){ + "step 0" + player.showHandcards(); + "step 1" + var cards=player.get('h',{color:'red'}); + event.num=cards.length; + player.discard(cards); + "step 2" + trigger.player.recover(1-trigger.player.hp); + trigger.player.draw(event.num); + }, + ai:{ + threaten:1.6, + expose:0.2 + } + }, + qianfang:{ + trigger:{player:'phaseBegin'}, + direct:true, + filter:function(event,player){ + return player.storage.xuanning&&player.num('he')+player.storage.xuanning>=3; + }, + content:function(){ + "step 0" + var ainum=0; + var num=3-player.storage.xuanning; + event.targets=[]; + for(var i=0;i=0){ + switch(num){ + case 1:return 8-ai.get.value(card); + case 2:return 6-ai.get.value(card); + case 3:return 4-ai.get.value(card); + } + } + return -1; + } + } + else{ + player.chooseBool('是否发动【千方】?').ai=function(){ + return ainum>=0; + } + } + "step 1" + if(result.bool){ + player.storage.xuanning=0; + player.unmarkSkill('xuanning'); + player.addTempSkill('qianfang2','phaseAfter'); + player.logSkill('qianfang'); + player.useCard({name:'wanjian'},event.targets); + } + else{ + event.finish(); + } + }, + ai:{ + expose:0.1, + threaten:1.5 + } + }, + qianfang2:{ + trigger:{player:'phaseDrawBegin'}, + forced:true, + popup:false, + content:function(){ + trigger.num++; + } + }, + poyun:{ + trigger:{source:'damageEnd'}, + check:function(event,player){ + return ai.get.attitude(player,event.player)<0&&event.player.num('he')>1; + }, + filter:function(event,player){ + return player.storage.xuanning>0&&event.player.num('he')>0; + }, + direct:true, + content:function(){ + "step 0" + player.discardPlayerCard(trigger.player,'he','是否发动【破云】',[1,2]); + "step 1" + if(result.bool){ + player.storage.xuanning--; + if(!player.storage.xuanning){ + player.unmarkSkill('xuanning'); + } + player.logSkill('poyun',trigger.player); + } + }, + ai:{ + threaten:1.3 + } + }, + poyun2:{ + trigger:{source:'damageEnd'}, + forced:true, + popup:false, + filter:function(event,player){ + return player.storage.poyun?true:false; + }, + content:function(){ + player.draw(); + player.storage.poyun=false; + player.removeSkill('poyun2'); + } + }, + poyun3:{}, + zhuyue:{ + enable:'phaseUse', + filter:function(event,player){ + return player.num('he',{type:'basic'})0; + }, + usable:1, + locked:false, + check:function(card){ + return 7-ai.get.value(card); + }, + content:function(){ + if(target.num('he')){ + player.discardPlayerCard(target,'he').ai=function(){ + if(ai.get.attitude(player,target)<0){ + return ai.get.buttonValue.apply(this,arguments); + } + return -1; + }; + } + player.storage.zhuyue.add(target); + + }, + ai:{ + result:{ + target:function(player,target){ + if(!target.num('he')) return -0.2; + return -1; + } + }, + order:10, + threaten:1.2 + }, + mod:{ + targetInRange:function(card,player,target){ + if(card.name=='sha'&&player.storage.zhuyue&&player.storage.zhuyue.contains(target)){ + return true; + } + }, + selectTarget:function(card,player,range){ + if(card.name=='sha'&&player.storage.zhuyue&&player.storage.zhuyue.length){ + range[1]=-1; + range[0]=-1; + } + }, + playerEnabled:function(card,player,target){ + if(card.name=='sha'&&player.storage.zhuyue&&player.storage.zhuyue.length&&!player.storage.zhuyue.contains(target)){ + return false; + } + } + }, + intro:{ + content:'players' + }, + group:'zhuyue2' + }, + zhuyue2:{ + trigger:{player:'phaseUseEnd'}, + forced:true, + popup:false, + silent:true, + content:function(){ + player.storage.zhuyue.length=0; + } + }, + longxi:{ + trigger:{player:['chooseToRespondBegin','chooseToUseBegin']}, + forced:true, + popup:false, + max:2, + filter:function(event,player){ + return _status.currentPhase!=player; + }, + content:function(){ + var cards=[]; + // var max=player.hp<=2?3:2; + var max=Math.min(ui.cardPile.childNodes.length,lib.skill.longxi.max); + for(var i=0;i=player.hp; + }, + intro:{ + content:'limited' + }, + line:'fire', + content:function(){ + "step 0" + player.storage.guanri=true; + player.loseHp(); + "step 1" + target.damage(2,'fire'); + "step 2" + if(target.isAlive()){ + target.discard(target.get('e')); + } + }, + ai:{ + order:1, + result:{ + target:function(player,target){ + var eff=ai.get.damageEffect(target,player,target,'fire'); + if(player.hp>2) return eff; + if(player.hp==2&&target.hp==2) return eff; + return 0; + } + }, + expose:0.5 + } + }, + tianxian:{ + mod:{ + targetInRange:function(card,player,target,now){ + if(card.name=='sha') return true; + }, + selectTarget:function(card,player,range){ + if(card.name=='sha'&&range[1]!=-1) range[1]=Infinity; + } + }, + priority:5.5, + trigger:{player:'useCardToBefore'}, + filter:function(event){ + return event.card.name=='sha'; + }, + forced:true, + check:function(){ + return false; + }, + content:function(){ + "step 0" + trigger.target.judge(function(card){ + return get.color(card)=='black'?1:0; + }); + "step 1" + if(result.bool){ + trigger.untrigger(); + trigger.finish(); + } + } + }, + runxin:{ + trigger:{player:['useCard','respondEnd']}, + direct:true, + filter:function(event){ + if(get.suit(event.card)=='heart'){ + for(var i=0;i0){ + if(noneed&&player==target){ + num=0.5; + } + else if(target.hp==1){ + num+=3; + } + else if(target.hp==2){ + num+=1; + } + } + return num; + } + "step 1" + if(result.bool){ + player.logSkill('runxin'); + result.targets[0].recover(); + } + }, + ai:{ + expose:0.3, + threaten:1.5 + } + }, + zhimeng:{ + trigger:{player:'phaseEnd'}, + direct:true, + locked:true, + unique:true, + gainable:true, + group:'zhimeng3', + content:function(){ + "step 0" + player.chooseTarget('是否发动【织梦】?').ai=function(target){ + var num=ai.get.attitude(player,target); + if(num>0){ + if(player==target){ + num++; + } + if(target.hp==1){ + num+=3; + } + if(target.hp==2){ + num+=1; + } + } + return num; + } + "step 1" + if(result.bool){ + var target=result.targets[0]; + var card=get.cards()[0]; + target.$draw(card); + if(get.type(card)=='equip'){ + game.delay(); + event.card=card; + event.target=target; + } + else{ + target.storage.zhimeng2=card; + target.addSkill('zhimeng2'); + event.finish(); + } + player.logSkill('zhimeng',target); + } + "step 2" + if(event.target){ + event.target.equip(event.card); + } + "step 3" + if(event.target){ + event.target.draw(); + } + }, + ai:{ + expose:0.2 + } + }, + zhimeng2:{ + intro:{ + content:'card', + onunmark:function(storage,player){ + delete player.storage.zhimeng2; + } + }, + mark:'card', + trigger:{target:'useCardToBegin'}, + frequent:true, + filter:function(event,player){ + return player.storage.zhimeng2&&get.type(event.card,'trick')==get.type(player.storage.zhimeng2,'trick'); + }, + content:function(){ + player.draw(); + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(target.storage.zhimeng2&&get.type(card,'trick')==get.type(target.storage.zhimeng2,'trick')){ + return [1,0.5]; + } + } + } + } + }, + zhimeng3:{ + trigger:{player:['phaseBegin','dieBegin']}, + forced:true, + popup:false, + content:function(){ + "step 0" + event.players=game.players.slice(0); + event.num=0; + "step 1" + if(event.num1){ + return 11-ai.get.equipValue(card); + } + if(player.num('h')1; + }, + trigger:{target:'useCardToBefore'}, + content:function(){ + "step 0" + player.chooseToDiscard('是否弃置两张牌使'+get.translation(trigger.card)+'失效?','he',2).ai=function(card){ + if(ai.get.effect(player,trigger.card,trigger.player,player)<0){ + if(get.tag(trigger.card,'respondSha')&&player.num('h','sha')) return 0; + if(get.tag(trigger.card,'respondShan')&&player.num('h','shan')) return 0; + return 4-ai.get.value(card); + } + return 0; + } + "step 1" + if(result.bool){ + trigger.untrigger(); + trigger.finish(); + player.logSkill('xiaoyao'); + } + } + }, + tuoqiao:{ + filter:function(event,player){ + return game.players.length>3&&(event.player==player.next||event.player==player.previous); + }, + check:function(event,player){ + return ai.get.effect(player,event.card,event.player,player)<0 + }, + forbid:['versus'], + trigger:{target:'useCardToBefore'}, + content:function(){ + if(trigger.player==player.next){ + game.swapSeat(player,player.previous); + } + else if(trigger.player==player.previous){ + game.swapSeat(player,player.next); + } + else{ + return; + } + trigger.untrigger(); + trigger.finish(); + // player.popup('xiaoyao'); + }, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(target==player.next||target==player.previous) return 0.1; + } + } + } + }, + yujian:{ + enable:'phaseUse', + usable:1, + forbid:['versus'], + filterTarget:function(card,player,target){ + return player!=target&&player.next!=target; + }, + filterCard:true, + check:function(card){ + return 4-ai.get.value(card); + }, + content:function(){ + while(player.next!=target){ + game.swapSeat(player,player.next); + } + }, + ai:{ + order:5, + result:{ + player:function(player,target){ + var att=ai.get.attitude(player,target); + if(target==player.previous&&att>0) return 1; + if(target==player.next.next&&ai.get.attitude(player,player.next)<0) return 1; + return 0; + } + } + } + }, + huimeng:{ + trigger:{player:'recoverAfter'}, + frequent:true, + // filter:function(event,player){ + // if(event.cards){ + // for(var i=0;i0; + }, + content:function(){ + "step 0" + player.chooseTarget('是否发动【诱敌】?',function(card,player,target){ + return player!=target; + }).ai=function(target){ + if(target.num('he')==0) return 0; + return -ai.get.attitude(player,target); + } + "step 1" + if(result.bool){ + game.delay(); + player.logSkill('youdi',result.targets); + event.target=result.targets[0]; + event.target.discardPlayerCard(player,'he',true); + } + else{ + event.finish(); + } + "step 2" + if(result.links[0].name!='sha'&&event.target.num('he')){ + player.gainPlayerCard('he',event.target,true); + } + }, + ai:{ + expose:0.2, + threaten:1.4 + } + }, + fuhun:{ + enable:['chooseToUse','chooseToRespond'], + filterCard:true, + selectCard:2, + position:'h', + viewAs:{name:'sha'}, + prompt:'将两张手牌当杀使用或打出', + check:function(card){ + if(_status.event.player.num('h')<4) return 6-ai.get.useful(card); + return 7-ai.get.useful(card); + }, + ai:{ + respondSha:true, + order:function(item,player){ + if(player.skills.contains('wusheng')&&player.skills.contains('paoxiao')){ + return 1; + } + if(player.num('h')<4){ + return 1; + } + return 4; + }, + }, + group:'fuhun2' + }, + fuhun2:{ + trigger:{source:'damageAfter'}, + forced:true, + filter:function(event){ + return event.parent.skill=='fuhun'; + }, + content:function(){ + player.addTempSkill('wusheng','phaseAfter'); + player.addTempSkill('paoxiao','phaseAfter'); + } + }, + fencheng:{ + enable:'phaseUse', + filter:function(event,player){ + return !player.storage.fencheng; + }, + filterTarget:function(card,player,target){ + return player!=target; + }, + selectTarget:-1, + mark:true, + line:'fire', + content:function(){ + "step 0" + player.storage.fencheng=true; + player.unmarkSkill('fencheng'); + var res=ai.get.damageEffect(target,player,target,'fire'); + var num=Math.max(1,target.num('e')); + target.chooseToDiscard(num,'he','弃置'+get.cnNumber(num)+'张牌或受到1点火焰伤害').ai=function(card){ + if(res>=0) return -1; + if(num>2&&player.hp>1) return -1; + if(num>1&&player.hp>2) return -1; + if(get.position(card)=='e'){ + return 10-ai.get.value(card); + } + return 6-ai.get.value(card); + } + "step 1" + if(!result.bool){ + target.damage('fire'); + } + }, + ai:{ + order:1, + result:{ + player:function(player){ + var num=0; + for(var i=0;i0){ + num-=Math.max(1,game.players[i].num('e')); + } + else if(att<0){ + num+=Math.max(1,game.players[i].num('e')); + } + } + } + if(game.players.length<5){ + return num-1; + } + else{ + return num-2; + } + } + } + }, + init:function(player){ + player.storage.fencheng=false; + }, + intro:{ + content:'limited' + } + }, + mieji:{ + trigger:{player:'useCardBegin'}, + direct:true, + filter:function(event,player){ + return event.targets.length==1&&get.type(event.card)=='trick'&&get.color(event.card)=='black'; + }, + position:'he', + content:function(){ + "step 0" + player.chooseTarget('是否发动【灭计】?',function(card,player,target){ + return lib.filter.filterTarget(trigger.card,player,target)&&target!=trigger.targets[0]; + }).ai=function(target){ + return ai.get.effect(target,trigger.card,player,player); + }; + "step 1" + if(result.bool){ + trigger.targets.push(result.targets[0]); + player.logSkill('mieji',result.targets); + } + } + }, + junxing:{ + enable:'phaseUse', + usable:1, + filterCard:true, + selectCard:[1,Infinity], + filter:function(event,player){ + return player.num('h')>0; + }, + check:function(card){ + if(ui.selected.cards.length) return -1; + var val=ai.get.value(card); + if(get.type(card)=='basic') return 8-ai.get.value(card); + return 5-ai.get.value(card); + }, + filterTarget:function(card,player,target){ + return player!=target; + }, + content:function(){ + "step 0" + var types=[]; + for(var i=0;i0; + }, + filter:function(event,player){ + if(event.player.num('h')) return false; + if(_status.currentPhase!=player) return false; + if(event.player==player) return false; + for(var i=0;i2){ + if(game.phaseNumber=6) return true; + } + return false; + }, + content:function(){ + if(trigger.player.num('ej')){ + player.gainPlayerCard(trigger.player,'ej',true); + } + trigger.untrigger(); + trigger.finish(); + } + }, + sanyao:{ + enable:'phaseUse', + usable:1, + filterTarget:function(card,player,target){ + for(var i=0;itarget.hp) return false; + } + return true; + }, + check:function(card){return 7-ai.get.value(card);}, + position:'he', + filterCard:true, + content:function(){ + target.damage(); + }, + ai:{ + result:{ + target:function(player,target){ + if(target.num('j')&&ai.get.attitude(player,target)>0){ + return 1; + } + if(target.num('e')){ + return -1; + } + return ai.get.damageEffect(target,player); + }, + }, + order:7 + } + }, + qiaoshui:{ + trigger:{player:'phaseUseBegin'}, + direct:true, + filter:function(event,player){ + return player.num('h')>0; + }, + content:function(){ + "step 0" + player.chooseTarget('是否发动【巧说】?',function(card,player,target){ + return player!=target&&target.num('h')>0; + }).ai=function(target){ + return -ai.get.attitude(player,target)/target.num('h'); + } + "step 1" + if(result.bool){ + player.logSkill('qiaoshui',result.targets[0]); + player.chooseToCompare(result.targets[0]); + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + player.gain(result.target,'gain2'); + player.addTempSkill('jizhi','phaseAfter'); + } + else{ + player.gain(result.player,'gain2'); + player.addTempSkill('qiaoshui2','phaseAfter'); + } + }, + ai:{ + expose:0.1 + } + }, + qiaoshui2:{ + mod:{ + cardEnabled:function(card){ + if(get.type(card,'trick')=='trick') return false; + } + } + }, + jyzongshi:{ + trigger:{target:'useCardToBegin'}, + filter:function(event,player){ + if(event.targets&&event.targets.length>1) return false; + return event.card&&get.type(event.card)=='trick'&&event.player!=player; + }, + frequent:true, + content:function(){ + player.draw(); + }, + ai:{ + effect:function(card,player,target){ + if(get.type(card)=='trick') return [1,1]; + }, + } + }, + shenxing:{ + enable:'phaseUse', + position:'he', + filterCard:true, + selectCard:2, + prompt:'弃置任意张牌并摸等量的牌', + check:function(card){return 4-ai.get.useful(card)}, + content:function(){ + player.draw(); + }, + ai:{ + order:1, + result:{ + player:1 + }, + }, + }, + bingyi:{ + trigger:{player:'phaseDiscardEnd'}, + filter:function(event,player){ + var cards=player.get('h'); + if(cards.length<1) return false; + var color=get.color(cards[0]); + for(var i=1;i0; + }, + check:function(event,player){ + if(ai.get.attitude(player,event.player)<5) return false; + if(player.maxHp-player.hp>=2) return false; + if(player.hp==1) return false; + if(player.hp==2&&player.num('h')<2) return false; + if(event.player.num('h')>=event.player.hp) return false; + return true; + }, + content:function(){ + "step 0" + player.draw(2); + "step 1" + player.chooseCard(2,true,'交给'+get.translation(trigger.player)+'两张牌').ai=function(card){ + if(ui.selected.cards.length&&card.name==ui.selected.cards[0].name) return -1; + if(get.tag(card,'damage')) return 1; + if(get.type(card)=='equip') return 1; + return 0; + }; + "step 2" + trigger.player.gain(result.cards); + if(player==game.me||trigger.player==game.me) + player.$give(result.cards,trigger.player); + else + player.$give(2,trigger.player); + game.delay(); + trigger.player.addSkill('xiantu2'); + trigger.player.storage.xiantu=player; + }, + ai:{ + threaten:1.1, + expose:0.3 + } + }, + xiantu2:{ + trigger:{player:'phaseUseEnd'}, + forced:true, + content:function(){ + if(player.storage.xiantu){ + player.storage.xiantu.loseHp(); + delete player.storage.xiantu; + } + player.removeSkill('xiantu2'); + }, + group:'xiantu3' + }, + xiantu3:{ + trigger:{source:'dieAfter'}, + forced:true, + content:function(){ + delete player.storage.xiantu; + player.removeSkill('xiantu2'); + } + }, + qiangzhi:{ + enable:'phaseUse', + usable:1, + filterTarget:function(card,player,target){ + return target!=player&&target.num('h')>0; + }, + content:function(){ + var card=target.get('h').randomGet(); + player.showCards(card); + player.storage.qiangzhi=get.type(card,'trick'); + player.markSkill('qiangzhi'); + }, + intro:{ + content:function(type){ + return get.translation(type)+'牌'; + } + }, + group:['qiangzhi2','qiangzhi3'], + ai:{ + order:11, + result:{ + player:1 + } + } + }, + qiangzhi2:{ + trigger:{player:'useCard'}, + frequent:true, + filter:function(event,player){ + return (get.type(event.card,'trick')==player.storage.qiangzhi&&event.cards[0]&&event.cards[0]==event.card); + }, + content:function(){ + player.draw(); + }, + ai:{ + threaten:1.4 + } + }, + qiangzhi3:{ + trigger:{player:'phaseUseEnd'}, + forced:true, + popup:false, + content:function(){ + delete player.storage.qiangzhi; + player.unmarkSkill('qiangzhi'); + } + }, + dingpin:{ + enable:'phaseUse', + usable:3, + filter:function(event,player){ + return player.num('h')>0; + }, + filterTarget:function(card,player,target){ + return target.hp0; + }, + content:function(){ + trigger.player.draw(); + }, + ai:{ + expose:0.2 + } + }, + jiaojin:{ + trigger:{player:'damageBegin'}, + filter:function(event,player){ + return player.num('he',{type:'equip'})&&event.source&&event.source.sex=='male'; + }, + direct:true, + content:function(){ + "step 0" + player.chooseToDiscard('he','是否弃置一张装备牌令伤害-1?',function(card,player){ + return get.type(card)=='equip'; + }).ai=function(card){ + if(player.hp==1||trigger.num>1){ + return 9-ai.get.value(card); + } + if(player.hp==2){ + return 8-ai.get.value(card); + } + return 7-ai.get.value(card); + }; + "step 1" + if(result.bool){ + player.logSkill('jiaojin'); + game.delay(); + trigger.num--; + } + } + }, + chanhui:{ + trigger:{player:'useCard'}, + filter:function(event,player){ + if(_status.currentPhase!=player) return false; + if(player.skills.contains('chanhui2')) return false; + if(event.targets.length>1) return false; + var card=event.card; + if(card.name=='sha') return true; + if(get.color(card)=='black'&&get.type(card)=='trick') return true; + return false; + }, + direct:true, + content:function(){ + "step 0" + player.chooseTarget('是否发动【谮毁】?',function(card,player,target){ + return player.canUse(trigger.card,target)&&trigger.targets.contains(target)==false; + }).ai=function(target){ + return ai.get.effect(target,trigger.card,player,player)+1; + } + "step 1" + if(result.bool){ + game.delay(); + player.addSkill('chanhui2'); + event.target=result.targets[0]; + setTimeout(function(){ + player.logSkill('chanhui',event.target,'green'); + },200); + event.target.chooseCard('交给'+get.translation(player)+'一张手牌,或成为'+ + get.translation(trigger.card)+'的额外目标').ai=function(card){ + return 5-ai.get.value(card); + } + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + player.gain(result.cards); + event.target.$give(1,player); + game.delay(); + trigger.untrigger(); + trigger.player=event.target; + trigger.trigger('useCard'); + game.log(get.translation(event.target)+'成为了'+get.translation(trigger.card)+'的使用者'); + } + else{ + game.log(get.translation(event.target)+'成为了'+get.translation(trigger.card)+'的额外目标'); + trigger.targets.push(event.target); + } + } + }, + chanhui2:{ + trigger:{player:'phaseEnd'}, + forced:true, + popup:false, + content:function(){ + player.removeSkill('chanhui2'); + } + }, + quanji:{ + trigger:{player:'damageEnd'}, + frequent:true, + locked:false, + init:function(player){ + player.storage.quanji=[]; + }, + content:function(){ + "step 0" + player.draw(trigger.num); + "step 1" + if(player.num('he')){ + player.chooseCard('将'+get.cnNumber(trigger.num)+'张手牌置于武将牌上作为“权”',trigger.num,true); + } + else{ + event.finish(); + } + "step 2" + if(result.cards&&result.cards.length){ + player.lose(result.cards,ui.special); + player.storage.quanji=player.storage.quanji.concat(result.cards); + game.log(get.translation(player)+'将'+get.translation(result.cards)+'置于武将牌上作为“权”'); + player.markSkill('quanji'); + } + }, + intro:{ + content:'cards' + }, + mod:{ + maxHandcard:function(player,num){ + return num+player.storage.quanji.length; + } + }, + ai:{ + maixie:true, + threaten:0.8, + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-2]; + var hasfriend=false; + for(var i=0;i=0){ + hasfriend=true;break; + } + } + if(!hasfriend) return; + if(target.hp>=4) return [0.5,get.tag(card,'damage')*2]; + if(target.hp==3) return [0.5,get.tag(card,'damage')*1.5]; + if(target.hp==2) return [1,get.tag(card,'damage')*0.5]; + } + } + } + } + }, + zili:{ + unique:true, + trigger:{player:'phaseBegin'}, + forced:true, + filter:function(event,player){ + return !player.skills.contains('paiyi')&&player.storage.quanji&&player.storage.quanji.length>=3; + }, + content:function(){ + "step 0" + player.chooseControl('recover_hp','draw_card',function(event,player){ + if(player.hp>=2) return 'draw_card'; + return 'recover_hp'; + }); + "step 1" + if(result.control=='draw_card'){ + player.draw(2); + } + else{ + player.recover(); + } + "step 2" + if(lib.config.mode!='guozhan'||player.maxHp>=4){ + player.loseMaxHp(); + } + if(player.hp>player.maxHp) player.hp=player.maxHp; + player.update(); + player.addSkill('paiyi'); + } + }, + paiyi:{ + enable:'phaseUse', + usable:1, + filterTarget:true, + filter:function(event,player){ + return player.storage.quanji.length>0; + }, + content:function(){ + "step 0" + player.chooseCardButton(player.storage.quanji,true); + "step 1" + var card=result.buttons[0].link; + player.discard(card); + player.storage.quanji.remove(card); + if(!player.storage.quanji.length){ + player.unmarkSkill('quanji'); + } + "step 2" + target.draw(2); + "step 3" + if(target.num('h')>player.num('h')){ + target.damage(); + } + }, + ai:{ + order:1, + result:{ + target:function(player,target){ + if(player!=target) return 0; + if(player.num('h')+2<=player.hp+player.storage.quanji.length) return 1; + return 0; + } + } + } + }, + xianzhou:{ + unique:true, + enable:'phaseUse', + filter:function(event,player){ + return !player.storage.xianzhou&&player.num('e')>0; + }, + init:function(player){ + player.storage.xianzhou=false; + }, + filterTarget:function(card,player,target){ + return player!=target; + }, + mark:true, + content:function(){ + "step 0" + player.unmarkSkill('xianzhou'); + var cards=player.get('e'); + target.gain(cards); + event.num=cards.length; + player.$give(cards,target); + player.storage.xianzhou=true; + game.delay(); + "step 1" + target.chooseTarget([1,event.num],'令'+get.translation(player)+'回复'+ + event.num+'点体力,或对攻击范围内的'+event.num+'名角色造成一点伤害',function(card,player,target2){ + return get.distance(target,target2,'attack')<=1; + }).ai=function(target2){ + if(ai.get.attitude(target,player)>0){ + if(player.hp+event.num<=player.maxHp||player.hp==1) return -1; + } + return ai.get.damageEffect(target2,target,target); + } + "step 2" + if(result.bool){ + event.targets=result.targets; + event.num2=0; + } + else{ + player.recover(event.num); + event.finish(); + } + "step 3" + if(event.num21||event.targets[0]!=player); + }, + forced:true, + popup:false, + content:function(){ + player.addTempSkill('qieting3','phaseAfter'); + } + }, + qieting3:{}, + zhuikong:{ + trigger:{global:'phaseBegin'}, + check:function(event,player){ + if(ai.get.attitude(player,event.player)<-2){ + var cards=player.get('h'); + if(cards.length>player.hp) return true; + for(var i=0;i9&&useful<7) return true; + } + } + return false; + }, + filter:function(event,player){ + return player.hp0&&event.player.num('h')>0; + }, + content:function(){ + "step 0" + player.chooseToCompare(trigger.player); + "step 1" + if(result.bool){ + trigger.player.addTempSkill('zishou2','phaseAfter'); + } + }, + }, + qiuyuan:{ + trigger:{target:'shaBefore'}, + direct:true, + priority:11, + content:function(){ + "step 0" + player.chooseTarget('是否发动【求援】?',function(card,player,target){ + return target!=player&&trigger.player.canUse('sha',target,false); + }).ai=function(target){ + return ai.get.effect(target,trigger.card,trigger.player,player)+0.1; + } + "step 1" + if(result.bool){ + var target=result.targets[0]; + event.target=target; + target.chooseCard({name:'shan'},'交给'+get.translation(player)+ + '一张闪,或成为此杀的额外目标').ai=function(card){ + return ai.get.attitude(target,player)>=0?1:-1; + } + player.logSkill('qiuyuan',target); + game.delay(); + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + player.gain(result.cards); + event.target.$give(result.cards,player); + game.delay(); + } + else{ + trigger.targets.push(event.target); + game.log(get.translation(event.target)+'成为了额外目标'); + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(card.name!='sha') return; + for(var i=0;i1){ + return 11-ai.get.equipValue(card); + } + return 6-ai.get.equipValue(card); + }, + content:function(){ + "step 0" + player.addTempSkill('gongji2','phaseAfter'); + "step 1" + if(get.type(cards[0])=='equip'){ + player.chooseTarget('是否弃置一名角色的一张牌?',function(card,player,target){ + return player!=target&&target.num('he')>0; + }).ai=function(target){ + if(ai.get.attitude(player,target)<0){ + return Math.max(0.5,ai.get.effect(target,{name:'sha'},player,player)); + } + return 0; + } + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + event.target=result.targets[0]; + player.discardPlayerCard(event.target,'he',true).ai=ai.get.buttonValue; + } + }, + ai:{ + order:9, + result:{ + player:1 + } + } + }, + gongji2:{ + mod:{ + attackFrom:function(){ + return -Infinity; + }, + }, + }, + zhuiyi:{ + trigger:{player:'dieBegin'}, + direct:true, + content:function(){ + "step 0" + player.chooseTarget('是否发动【追忆】?',function(card,player,target){ + return player!=target&&trigger.source!=target; + }).ai=function(target){ + var num=ai.get.attitude(player,target); + if(num>0){ + if(target.hp==1){ + num+=2; + } + if(target.hpgame.players[i].num('h')) return true; + } + return false; + }, + selectTarget:2, + content:function(){ + var gainner,giver; + if(targets[0].num('h')0) return -1; + for(var i=0;i=0&&num20){ + return 1; + } + return 0; + }; + "step 2" + if(result.control=='draw_card'){ + targets[0].draw(); + } + else{ + targets[0].useCard({name:'sha'},targets[1]); + } + }, + ai:{ + result:{ + player:1, + target:function(player,target){ + if(ui.selected.targets.length){ + return -0.1; + } + return 1; + } + }, + order:8.5, + expose:0.2 + } + }, + xinxuanhuo:{ + trigger:{player:'phaseDrawBegin'}, + direct:true, + content:function(){ + "step 0" + player.chooseTarget('是否发动【眩惑】',function(card,player,target){ + return player!=target; + }).ai=function(target){ + var att=ai.get.attitude(player,target); + if(att>0){ + if(target.num('h')0){ + return true; + } + } + return false; + }, + filter:function(event,player){ + return player.hp=player.maxHp-1) return [0,0]; + } + } + } + }, + zhenlie:{ + filter:function(event,player){ + return event.player!=player&&event.card&&(event.card.name=='sha'||get.type(event.card)=='trick'); + }, + check:function(event,player){ + if(ai.get.attitude(player,event.player)>0){ + return false; + } + if(get.tag(event.card,'respondSha')){ + if(player.num('h',{name:'sha'})==0){ + return true; + } + } + else if(get.tag(event.card,'respondShan')){ + if(player.num('h',{name:'shan'})==0){ + return true; + } + } + else if(get.tag(event.card,'damage')){ + if(player.num('h')<2) return true; + } + else if(event.card.name=='shunshou'&&player.hp>2){ + return true; + } + return false; + }, + priority:10, + trigger:{target:'useCardToBefore'}, + content:function(){ + "step 0" + player.loseHp(); + "step 1" + trigger.untrigger(); + trigger.finish(); + "step 2" + if(trigger.player.num('he')){ + player.discardPlayerCard(trigger.player,'he',true); + } + }, + ai:{ + expose:0.3 + } + }, + wuyan:{ + trigger:{target:'useCardToBefore',player:'useCardToBefore'}, + forced:true, + priority:15, + check:function(event,player){ + return ai.get.effect(event.target,event.card,event.player,player)<0; + }, + filter:function(event,player){ + if(!event.target) return false; + if(event.player==player&&event.target==player) return false; + return (get.type(event.card)=='trick'); + }, + content:function(){ + game.log(get.translation(player)+'发动了无言,'+get.translation(trigger.card)+'对'+get.translation(trigger.target)+'失效') + trigger.untrigger(); + trigger.finish(); + }, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(get.type(card)=='trick'&&player!=target) return [0,0,0,0]; + }, + player:function(card,player,target,current){ + if(get.type(card)=='trick'&&player!=target) return [0,0,0,0]; + } + } + } + }, + xinwuyan:{ + check:function(){return false}, + trigger:{target:'useCardToBefore',player:'useCardToBefore'}, + forced:true, + priority:15, + filter:function(event,player){ + if(event.player==player&&event.target==player) return false; + return (get.type(event.card,'trick')=='trick'&&get.tag(event.card,'damage')); + }, + check:function(event,player){ + return ai.get.effect(event.target,event.card,event.player,player)<0; + }, + content:function(){ + game.log(get.translation(player)+'发动了无言,'+get.translation(trigger.card)+'对'+get.translation(trigger.target)+'失效') + trigger.untrigger(); + trigger.finish(); + }, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(get.type(card)=='trick'&&player!=target&&get.tag(card,'damage')) return [0,0,0,0]; + }, + player:function(card,player,target,current){ + if(get.type(card)=='trick'&&player!=target&&get.tag(card,'damage')) return [0,0,0,0]; + } + } + } + }, + xinjujian:{ + trigger:{player:'phaseEnd'}, + direct:true, + filter:function(event,player){ + return player.num('he')>player.num('he',{type:'basic'}); + }, + content:function(){ + "step 0" + player.chooseCardTarget({ + filterTarget:function(card,player,target){ + return player!=target; + }, + filterCard:function(card){ + return get.type(card)!='basic'; + }, + ai1:function(card){ + if(get.tag(card,'damage')&&get.type(card)=='trick'){ + return 20; + } + return 9-ai.get.value(card); + }, + ai2:function(target){ + var att=ai.get.attitude(player,target); + if(att>0){ + if(target.isTurnedOver()) att+=3; + if(target.hp==1) att+=3; + } + return att; + }, + position:'he', + prompt:'是否发动【举荐】?' + }); + "step 1" + if(result.bool){ + var target=result.targets[0]; + event.target=target; + player.logSkill('xinjujian',target); + player.discard(result.cards); + if(target.hp==target.maxHp&& + !target.isTurnedOver()&& + !target.isLinked()){ + target.draw(2); + event.finish(); + } + else{ + var controls=['draw_card']; + if(target.hp2){ + return 'recover_hp'; + } + else if(target.hp==2&&target.maxHp>2&&target.num('h')>1){ + return 'recover_hp'; + } + else{ + return 'draw_card'; + } + } + } + } + else{ + event.finish(); + } + "step 2" + event.control=result.control; + switch(event.control){ + case 'recover_hp':event.target.recover();event.finish();break; + case 'draw_card':event.target.draw(2);event.finish();break; + case 'reset_character':if(event.target.isTurnedOver()) event.target.turnOver();break; + } + "step 3" + if(event.control=='reset_character'&&event.target.isLinked()){ + event.target.link(); + } + }, + ai:{ + expose:0.2, + threaten:1.4 + } + }, + jujian:{ + enable:'phaseUse', + usable:1, + filterCard:true, + position:'he', + selectCard:[1,3], + check:function(card){ + var player=get.owner(card); + if(get.type(card)=='trick') return 10; + if(player.num('h')-player.hp-ui.selected.cards.length>0){ + return 8-ai.get.value(card); + } + return 4-ai.get.value(card); + }, + filterTarget:function(card,player,target){ + return player!=target; + }, + content:function(){ + target.draw(cards.length); + if(cards.length==3){ + if(get.type(cards[0],'trick')==get.type(cards[1],'trick')&& + get.type(cards[0],'trick')==get.type(cards[2],'trick')){ + player.recover(); + } + } + }, + ai:{ + expose:0.2, + order:1, + result:{ + target:1 + } + } + }, + yizhong:{ + trigger:{target:'shaBefore'}, + forced:true, + filter:function(event,player){ + if(player.get('e','2')) return false; + return (event.card.name=='sha'&&get.color(event.card)=='black') + }, + content:function(){ + trigger.untrigger(); + trigger.finish(); + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(target.get('e','2')) return; + if(card.name=='sha'&&get.color(card)=='black') return 0; + } + } + } + }, + jueqing:{ + trigger:{source:'damageBefore'}, + forced:true, + priority:10, + content:function(){ + trigger.untrigger(); + trigger.finish(); + var ex=0; + if(trigger.card&&trigger.card.name=='sha'){ + if(player.skills.contains('jiu')) ex++; + if(player.skills.contains('luoyi2')) ex++; + if(player.skills.contains('reluoyi2')) ex++; + } + trigger.player.loseHp(trigger.num+ex); + } + }, + shangshi:{ + trigger:{player:['loseEnd','changeHp']}, + forced:true, + filter:function(event,player){ + return (player.num('h')0 + }, + delay:0, + content:function(){ + "step 0" + var list=[]; + player.getStat('skill').qice--; + for(var i in lib.card){ + if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; + if(lib.card[i].type=='trick') list.push(['','',i]); + } + var dialog=ui.create.dialog([list,'vcard']); + player.chooseButton(dialog,function(button){ + var recover=0,lose=1; + for(var i=0;i0){ + if(game.players[i].hp<2){ + lose--; + recover+=0.5; + } + lose--; + recover++; + } + else if(ai.get.attitude(player,game.players[i])<0){ + if(game.players[i].hp<2){ + lose++; + recover-=0.5; + } + lose++; + recover--; + } + } + else{ + if(ai.get.attitude(player,game.players[i])>0){ + lose--; + } + else if(ai.get.attitude(player,game.players[i])<0){ + lose++; + } + } + } + } + if(lose>recover&&lose>0) return (button.link[2]=='nanman')?1:-1; + if(lose0) return (button.link[2]=='taoyuan')?1:-1; + return (button.link[2]=='wuzhong')?1:-1; + }); + "step 1" + if(result.bool){ + lib.skill.qice2.viewAs={name:result.buttons[0].link[2]}; + player.popup(result.buttons[0].link[2]); + event.parent.parent.backup('qice2'); + event.parent.parent.step=0; + if(event.isMine()){ + event.parent.parent.openskilldialog='将全部手牌当'+get.translation(result.buttons[0].link[2])+'使用'; + } + } + else{ + if(player.skills.contains('qice4')){ + player.addTempSkill('qice5','phaseAfter') + } + else{ + player.addTempSkill('qice4','phaseAfter') + } + event.finish(); + } + }, + ai:{ + order:1, + result:{ + player:function(player){ + if(player.skills.contains('qice5')) return 0; + var num=0; + var cards=player.get('h'); + for(var i=0;i1 + } + else{ + for(var i=0;i3&&player.num('h','sha')>1){ + return 'jiangchi_less'; + } + if(player.num('h','sha')>2){ + return 'jiangchi_less'; + } + if(player.hp-player.num('h')>1){ + return 'jiangchi_more'; + } + return 'cancel'; + }); + "step 1" + if(result.control=='jiangchi_less'){ + trigger.num--; + player.addTempSkill('jiangchi2','phaseUseEnd'); + player.logSkill('jiangchi'); + } + else if(result.control=='jiangchi_more'){ + trigger.num++; + player.addTempSkill('jiangchi3','phaseUseEnd'); + player.logSkill('jiangchi'); + } + } + }, + jiangchi2:{ + mod:{ + targetInRange:function(card,player,target,now){ + if(card.name=='sha') return true; + }, + cardUsable:function(card,player,num){ + if(card.name=='sha') return num+1; + } + } + }, + jiangchi3:{ + mod:{ + cardEnabled:function(card){if(card.name=='sha') return false} + } + }, + xinzhan:{ + enable:'phaseUse', + filter:function(event,player){ + return true;//player.num('h')>player.maxHp; + }, + usable:1, + content:function(){ + "step 0" + var cards=get.cards(3+player.maxHp-player.hp); + event.cards=cards; + player.chooseCardButton(cards,'选择获得的红桃牌',[1,Infinity]).filterButton=function(button){ + return get.suit(button.link)=='heart'; + } + "step 1" + if(result.bool){ + player.gain(result.links); + player.$gain(result.links); + game.delay(2); + } + for(var i=event.cards.length-1;i>=0;i--){ + if(!result.bool||!result.links.contains(event.cards[i])){ + ui.cardPile.insertBefore(event.cards[i],ui.cardPile.firstChild); + } + } + }, + ai:{ + order:11, + result:{ + player:1 + } + } + }, + huilei:{ + trigger:{player:'dieBegin'}, + forced:true, + filter:function(event){ + return event.source!=undefined; + }, + content:function(){ + trigger.source.discard(trigger.source.get('he')); + }, + ai:{ + threaten:0.7 + } + }, + + xinenyuan:{ + trigger:{player:'damageEnd'}, + check:function(event,player){ + var att=ai.get.attitude(player,event.source); + var num=event.source.num('h'); + if(att<=0) return true; + if(num>2) return true; + if(num) return att<4; + return false; + }, + filter:function(event,player){ + return event.source&&event.source!=player; + }, + content:function(){ + "step 0" + trigger.source.chooseCard('交给'+get.translation(player)+'一张手牌或流失一点体力').ai=function(card){ + if(ai.get.attitude(trigger.source,player)>0){ + return 11-ai.get.value(card); + } + else{ + return 7-ai.get.value(card); + } + }; + "step 1" + if(result.bool){ + player.gain(result.cards[0]); + trigger.source.$give(1,player); + } + else{ + trigger.source.loseHp(); + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(player.skills.contains('jueqing')) return [1,-1.5]; + var hasfriend=false; + for(var i=0;i=0){ + hasfriend=true;break; + } + } + if(!hasfriend) return; + if(get.tag(card,'damage')) return [1,0,0,-0.7]; + } + } + } + }, + + enyuan:{ + locked:true, + group:['enyuan1','enyuan2'], + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'recover')&&player!=target) return [1,0,0,0.1]; + if(player.skills.contains('jueqing')) return [1,-2]; + var hasfriend=false; + for(var i=0;i=0){ + hasfriend=true;break; + } + } + if(!hasfriend) return; + if(get.tag(card,'damage')) return [1,0,0,-1]; + } + } + } + }, + enyuan1:{ + trigger:{player:'recoverEnd'}, + forced:true, + filter:function(event,player){ + return event.source&&event.source!=player; + }, + content:function(){ + trigger.source.draw(); + } + }, + enyuan2:{ + trigger:{player:'damageEnd'}, + forced:true, + filter:function(event,player){ + return event.source&&event.source!=player; + }, + content:function(){ + "step 0" + trigger.source.chooseCard('交出一张红桃牌或流失一点体力',function(card){ + return get.suit(card)=='heart'; + }).ai=function(card){ + return 6-ai.get.value(card); + }; + "step 1" + if(result.bool){ + player.gain(result.cards[0]); + trigger.source.$give(1,player); + } + else{ + trigger.source.loseHp(); + } + } + }, + xuanhuo:{ + enable:'phaseUse', + usable:1, + discard:false, + prepare:function(cards,player,targets){ + player.$give(1,targets[0]); + }, + filterCard:function(card){ + return get.suit(card)=='heart'; + }, + filterTarget:function(card,player,target){ + if(game.players.length==2) return false; + return player!=target; + }, + check:function(card){ + var player=get.owner(card); + for(var i=0;i3) break; + } + if(i==game.players.length) return -1; + return 5-ai.get.value(card); + }, + content:function(){ + "step 0" + target.gain(cards); + game.delay(); + "step 1" + player.gainPlayerCard(target,'he',true); + "step 2" + var source=target; + event.card=result.buttons[0].link; + player.chooseTarget(function(card,player,target){ + return target!=source&&target!=player; + }).ai=function(target){ + return ai.get.attitude(player,target); + } + "step 3" + if(result.bool){ + result.targets[0].gain(card); + player.$give(1,result.targets[0]); + game.delay(); + } + }, + ai:{ + result:{ + target:-0.5, + }, + basic:{ + order:9, + } + } + }, + ganlu:{ + enable:'phaseUse', + usable:1, + selectTarget:2, + filterTarget:function(card,player,target){ + if(ui.selected.targets.length==0) return true; + if(ui.selected.targets[0].num('e')==0&&target.num('e')==0) return false; + return Math.abs(ui.selected.targets[0].num('e')-target.num('e'))<=player.maxHp-player.hp; + }, + multitarget:true, + content:function(){ + "step 0" + event.cards=[targets[0].get('e'),targets[1].get('e')]; + targets[0].lose(event.cards[0]); + targets[1].lose(event.cards[1]); + if(event.cards[0].length) targets[0].$give(event.cards[0],targets[1]); + if(event.cards[1].length) targets[1].$give(event.cards[1],targets[0]); + "step 1" + for(var i=0;i0) list1.push(game.players[i]); + else if(ai.get.attitude(player,game.players[i])<0) list2.push(game.players[i]); + } + list1.sort(function(a,b){ + return a.num('e')-b.num('e'); + }); + list2.sort(function(a,b){ + return b.num('e')-a.num('e'); + }); + var delta; + for(var i=0;i0; + }, + check:function(event,player){ + if(event.player==player){ + return event.player.get('h',function(card){ + return get.type(card)!='basic'; + }).length>0; + } + return ai.get.attitude(player,event.player)>0; + }, + content:function(){ + "step 0" + if(trigger.player!=player) event.card=trigger.player.get('h').randomGet(); + else{ + event.card=trigger.player.get('h',function(card){ + return get.type(card)!='basic'; + }).randomGet(); + } + event.dialog=ui.create.dialog(get.translation(player)+'展示的手牌',[event.card]); + game.delay(2); + "step 1" + if(get.type(event.card)!='basic'){ + trigger.player.recover(); + trigger.player.discard(event.card); + } + event.dialog.close(); + }, + ai:{ + threaten:1.4 + } + }, + pojun:{ + trigger:{source:'damageEnd'}, + check:function(event,player){ + if(event.player.isTurnedOver()) return ai.get.attitude(player,event.player)>0; + if(event.player.hp<3){ + return ai.get.attitude(player,event.player)<0; + } + return ai.get.attitude(player,event.player)>0; + }, + filter:function(event){ + return event.card&&event.card.name=='sha'&&event.player.isAlive(); + }, + content:function(){ + "step 0" + trigger.player.draw(Math.min(5,trigger.player.hp)); + "step 1" + trigger.player.turnOver(); + } + }, + jingce:{ + trigger:{player:'phaseUseEnd'}, + frequent:true, + filter:function(event,player){ + return get.cardCount(true,player)>=player.hp; + }, + content:function(){ + player.draw(2); + }, + init:function(player){player.storage.jingce=true}, + intro:{ + content:function(storage,player){ + if(_status.currentPhase==player) return '已使用'+get.cardCount(true,player)+'张牌'; + } + } + }, + chengxiang:{ + trigger:{player:'damageEnd'}, + direct:true, + content:function(){ + "step 0" + event.cards=get.cards(4); + if(event.isMine()==false){ + event.dialog=ui.create.dialog('称象',event.cards); + game.delay(2); + } + "step 1" + if(event.dialog) event.dialog.close(); + var dialog=ui.create.dialog('称象:选择任意张点数小于13的牌',event.cards); + var next=player.chooseButton([0,4],dialog); + next.filterButton=function(button){ + var num=0 + for(var i=0;i=0){ + hasfriend=true;break; + } + } + if(!hasfriend) return; + if(target.hp>=4) return [1,2]; + if(target.hp==3) return [1,1.5]; + if(target.hp==2) return [1,0.5]; + } + } + } + } + }, + renxin:{ + trigger:{global:'damageBefore'}, + priority:6, + filter:function(event,player){ + return event.player!=player&&event.player.hp==1&&player.num('he',{type:'equip'})>0; + }, + direct:true, + content:function(){ + "step 0" + player.chooseToDiscard('是否发动【仁心】?',{type:'equip'},'he').ai=function(card){ + if(ai.get.attitude(player,trigger.player)>3){ + return 11-ai.get.value(card); + } + return -1; + } + "step 1" + if(result.bool){ + player.logSkill('renxin',trigger.player); + player.turnOver(); + } + else{ + event.finish(); + } + "step 2" + trigger.untrigger(); + trigger.finish(); + }, + ai:{ + expose:0.5 + } + }, + yuce:{ + trigger:{player:'damageAfter'}, + direct:true, + content:function(){ + "step 0" + player.chooseToDiscard('是否发动御策?').ai=function(card){ + return 7-ai.get.value(card); + } + "step 1" + if(result.bool){ + player.logSkill('yuce'); + var type=get.type(result.cards[0],'trick'); + if(trigger.source){ + trigger.source.chooseToDiscard('弃置一张'+get.translation(type)+'牌或令'+get.translation(player)+'回复一点体力',function(card){ + return get.type(card,'trick')==type; + }).ai=function(card){ + if(ai.get.recoverEffect(player,trigger.source)<0){ + return 7-ai.get.value(card); + } + return 0; + } + } + else{ + event.recover=true; + } + } + else{ + event.finish(); + } + "step 2" + if(event.recover){ + player.recover(); + } + else if(result.bool){ + player.draw(); + } + else{ + player.recover(); + } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage'&&target.num('h'))){ + return 0.8 + } + } + } + } + }, + xiansi:{ + trigger:{player:'phaseBegin'}, + direct:true, + init:function(player){ + player.storage.xiansi=[]; + }, + unique:true, + content:function(){ + "step 0" + player.chooseTarget('是否发动陷嗣?',[1,2],function(card,player,target){ + return target.num('he')>0&&player!=target; + }, + function(target){ + return -ai.get.attitude(_status.event.player,target); + }); + "step 1" + if(result.bool){ + player.logSkill('xiansi',result.targets); + event.targets=result.targets; + } + else{ + event.finish(); + } + "step 2" + if(event.targets.length){ + var target=event.targets.shift(); + event.current=target; + player.choosePlayerCard(target,true); + } + else{ + event.finish(); + } + "step 3" + if(result.bool){ + player.markSkill('xiansi'); + player.storage.xiansi=player.storage.xiansi.concat(result.links); + event.current.lose(result.links,ui.special); + event.current.$give(result.links,player); + event.goto(2); + } + }, + intro:{ + content:'cards', + onunmark:function(storage,player){ + if(storage&&storage.length){ + for(var i=0;i1&&player.canUse('sha',game.players[i],true,true); + } + } + if(remove){ + lib.skill.global.remove('xiansi2'); + } + return false; + }, + content:function(){ + "step 0" + for(var i=0;i0){ + player.recover(); + } + else if(result.judge<0){ + player.loseHp(); + } + if(!player.skills.contains('shibei2')){ + player.addTempSkill('shibei2','phaseAfter'); + } + } + }, + shibei2:{}, + jianying:{ + trigger:{player:'useCard'}, + frequent:true, + filter:function(event,player){ + if(!event.cards||event.cards.length!=1) return false; + if(_status.currentPhase!=player) return false; + if(!player.storage.jianying) return false; + return get.suit(player.storage.jianying)==get.suit(event.cards[0])|| + player.storage.jianying.number==event.cards[0].number; + }, + content:function(){ + player.draw(); + }, + intro:{ + content:'card' + }, + group:['jianying2','jianying3'] + }, + jianying3:{ + trigger:{player:'useCard'}, + priority:-1, + forced:true, + popup:false, + silent:true, + filter:function(event,player){ + if(!event.cards||event.cards.length!=1) return false; + if(_status.currentPhase!=player) return false; + return true; + }, + content:function(){ + player.storage.jianying=trigger.cards[0]; + } + }, + jianying2:{ + trigger:{player:'phaseAfter'}, + forced:true, + silent:true, + popup:false, + content:function(){ + player.storage.jianying=null; + } + }, + zzhenggong:{ + trigger:{player:'damageEnd'}, + direct:true, + filter:function(event,player){ + return event.source&&event.source.num('e')>0; + }, + content:function(){ + "step 0" + var att=ai.get.attitude(player,trigger.source); + player.choosePlayerCard('e','是否发动【争功】?',trigger.source).ai=function(button){ + if(att<=0){ + return ai.get.equipValue(button.link); + } + return 0; + } + "step 1" + if(result.bool){ + player.logSkill('zzhenggong',trigger.source); + player.equip(result.links[0]); + trigger.source.$give(result.links[0],player); + } + } + }, + zquanji:{ + trigger:{global:'phaseBegin'}, + priority:15, + check:function(event,player){ + var att=ai.get.attitude(player,event.player); + if(att<0){ + var nh1=event.player.num('h'); + var nh2=player.num('h'); + return nh1<=2&&nh2>nh1+1; + } + if(att>0&&event.player.num('j','lebu')&&event.player.num('h')>event.player.hp+1) return true; + return false; + }, + filter:function(event,player){ + return event.player!=player&&event.player.num('h')>0&&player.num('h')>0; + }, + content:function(){ + "step 0" + player.chooseToCompare(trigger.player); + "step 1" + if(result.bool){ + trigger.player.skip('phaseJudge'); + trigger.untrigger(); + } + }, + ai:{ + expose:0.2 + } + }, + zbaijiang:{ + trigger:{player:'phaseBegin'}, + forced:true, + unique:true, + init:function(player){ + player.storage.zbaijiang=false; + }, + intro:{ + content:'limited' + }, + filter:function(event,player){ + return !player.storage.zbaijiang&&player.num('e')>=3; + }, + content:function(){ + player.storage.zbaijiang=true; + player.removeSkill('zzhenggong'); + player.removeSkill('zquanji'); + player.addSkill('zyexin'); + player.addSkill('zzili'); + player.gainMaxHp(); + } + }, + zyexin:{ + trigger:{player:'damageEnd',source:'damageEnd'}, + frequent:true, + init:function(player){ + player.storage.zyexin=[]; + }, + intro:{ + content:'cards' + }, + content:function(){ + var card=get.cards()[0]; + player.storage.zyexin.push(card); + player.$draw(card); + player.markSkill('zyexin'); + }, + group:'zyexin2' + }, + zyexin2:{ + enable:'phaseUse', + usable:1, + lose:false, + delay:false, + selectCard:[1,Infinity], + filterCard:true, + filter:function(event,player){ + return player.storage.zyexin.length>0; + }, + prompt:'用任意数量的手牌与等量的“权”交换', + content:function(){ + "step 0" + player.lose(cards,ui.special)._triggered=null; + player.storage.zyexin=player.storage.zyexin.concat(cards); + player.chooseCardButton(player.storage.zyexin,'选择'+cards.length+'张牌作为手牌',cards.length,true).ai=function(button){ + return ai.get.value(button.link); + } + if(player==game.me&&_status.auto){ + game.delay(); + } + "step 1" + player.gain(result.links)._triggered=null; + for(var i=0;i=4&&!player.storage.zzili; + }, + forced:true, + content:function(){ + player.storage.zzili=true; + player.loseMaxHp(); + player.addSkill('zpaiyi'); + }, + intro:{ + content:'limited' + } + }, + zpaiyi:{ + trigger:{player:'phaseEnd'}, + filter:function(event,player){ + for(var i=0;i=2; + }, + content:function(){ + trigger.untrigger(); + trigger.finish(); + player.addSkill('nichang2'); + } + }, + nichang2:{ + trigger:{player:'phaseEnd'}, + forced:true, + content:function(){ + "step 0" + if(player.num('h')){ + player.showHandcards(); + } + player.removeSkill('nichang2'); + "step 1" + var suits=['spade','heart','diamond','club']; + var cards=player.get('h'); + for(var i=0;i1){ + if(game.phaseNumber=3){ + break; + } + } + event.cards=cards; + event.suit=suit; + player.showCards(cards); + } + else{ + event.finish(); + } + "step 2" + if(event.cards&&event.cards.length){ + if(get.suit(event.cards[event.cards.length-1])==event.suit){ + ui.discardPile.appendChild(event.cards.pop()); + } + if(event.cards.length){ + player.gain(event.cards,'draw2'); + } + } + }, + ai:{ + maixie:true, + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-2]; + var hasfriend=false; + for(var i=0;i=0){ + hasfriend=true;break; + } + } + if(!hasfriend) return; + if(target.hp>=4) return [1,2]; + if(target.hp==3) return [1,1.5]; + if(target.hp==2) return [1,0.5]; + } + } + } + } + }, + bolehuiyan:{ + trigger:{global:'shaBegin'}, + direct:true, + priority:11, + filter:function(event,player){ + if(player.skills.contains('bolehuiyan4')) return false; + if(lib.config.mode=='versus'&&lib.storage.single_control&&event.target.side==player.side) return false; + return event.player!=player&&event.target!=player&&event.target.num('h')>0; + }, + group:['bolehuiyan2','bolehuiyan3'], + content:function(){ + "step 0" + if(event.isMine()){ + event.dialog=ui.create.dialog('慧眼:预言'+get.translation(trigger.player)+'对'+get.translation(trigger.target)+'的杀能否命中'); + } + player.chooseControl('能命中','不能命中','cancel').ai=function(event){ + if(trigger.player.skills.contains('wushuang')) return 0; + if(trigger.player.skills.contains('liegong')) return 0; + if(trigger.player.skills.contains('tieji')) return 0; + if(trigger.player.skills.contains('retieji')) return 0; + if(trigger.player.skills.contains('roulin')&&trigger.target.sex=='female') return 0; + if(trigger.player.skills.contains('nvquan')&&trigger.target.sex=='male') return 0; + if(trigger.target.skills.contains('yijue2')) return 0; + if(trigger.target.skills.contains('shejie2')) return 0; + + var equip=trigger.target.get('e','2'); + if(equip&&equip.name=='bagua') return 1; + return trigger.target.num('h')<2?0:1; + }; + "step 1" + if(event.dialog){ + event.dialog.close(); + } + if(result.control!='cancel'){ + player.addTempSkill('bolehuiyan4','phaseAfter'); + game.log(get.translation(player)+'预言'+result.control); + player.storage.bolehuiyan=result.control; + player.popup(result.control); + game.delay(); + } + } + }, + bolehuiyan2:{ + trigger:{global:'shaEnd'}, + forced:true, + popup:false, + filter:function(event,player){ + return player.storage.bolehuiyan?true:false; + }, + content:function(){ + if(player.storage.bolehuiyan=='不能命中'){ + player.popup('预言成功'); + player.draw(); + } + delete player.storage.bolehuiyan; + } + }, + bolehuiyan3:{ + trigger:{global:'shaDamage'}, + forced:true, + popup:false, + filter:function(event,player){ + return player.storage.bolehuiyan?true:false; + }, + content:function(){ + if(player.storage.bolehuiyan=='能命中'){ + player.popup('预言成功'); + player.draw(); + } + delete player.storage.bolehuiyan; + } + }, + bolehuiyan4:{}, + oldbolehuiyan:{ + trigger:{global:'judgeBegin'}, + direct:true, + priority:11, + filter:function(event,player){ + return event.player!=player; + }, + content:function(){ + "step 0" + if(event.isMine()){ + event.dialog=ui.create.dialog('慧眼:预言'+get.translation(trigger.player)+'的'+trigger.judgestr+'判定'); + } + player.chooseControl('heart2','diamond2','club2','spade2','cancel').ai=function(event){ + switch(Math.floor(Math.random()*4)){ + case 0:return 'heart2'; + case 1:return 'diamond2'; + case 2:return 'club2'; + case 3:return 'spade2'; + } + }; + "step 1" + if(event.dialog){ + event.dialog.close(); + } + if(result.control!='cancel'){ + game.log(get.translation(player)+'预言判定结果为'+get.translation(result.control)); + player.storage.bolehuiyan=result.control.slice(0,result.control.length-1); + player.popup(result.control); + game.delay(); + } + }, + group:'bolehuiyan2' + }, + oldbolehuiyan2:{ + trigger:{global:'judgeEnd'}, + forced:true, + popup:false, + content:function(){ + if(player.storage.bolehuiyan==trigger.result.suit){ + game.log(get.translation(player)+'预言成功'); + player.popup('洗具'); + player.draw(2); + } + else if(get.color({suit:player.storage.bolehuiyan})==trigger.result.color){ + player.popup('洗具'); + player.draw(); + } + delete player.storage.bolehuiyan; + } + }, + xiangma:{ +// group:['mashu','feiying'] + inherit:'yicong' + }, + weiyi:{ + trigger:{player:'damageEnd'}, + filter:function(event,player){ + return (event.source&&event.source.num('he')); + }, + check:function(event,player){ + return ai.get.attitude(player,event.source)<0; + }, + content:function(){ + trigger.source.chooseToDiscard(2,'he',true); + }, + ai:{ + result:{ + target:function(card,player,target){ + if(player.num('he')>1&&get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-1]; + if(ai.get.attitude(target,player)<0) return [1,0,0,-1.5]; + } + } + } + } + }, + qiandu:{ + enable:'phaseUse', + usable:1, + forbid:['versus'], + filterTarget:function(card,player,target){ + return player!=target&&player.next!=target; + }, + filterCard:{color:'black'}, + check:function(card){ + return 4-ai.get.value(card); + }, + content:function(){ + game.swapSeat(player,target); + }, + ai:{ + order:5, + result:{ + player:function(player,target){ + var att=ai.get.attitude(player,target); + if(target==player.previous&&att>0) return att; + if(target==player.next&&att<0) return -att; + var att2=ai.get.attitude(player,player.next); + if(target==player.next.next&&att<0&&att2<0) return -att-att2; + return 0; + } + } + } + }, + nvquan:{ + group:['nvquan1','nvquan2','nvquan3'], + }, + nvquan1:{ + trigger:{player:'shaBegin'}, + forced:true, + filter:function(event){ + return event.target.sex=='male'; + }, + content:function(){ + "step 0" + var next=trigger.target.chooseToRespond({name:'shan'}); + next.autochoose=lib.filter.autoRespondShan; + next.ai=function(card){ + if(trigger.target.num('h','shan')>1){ + return ai.get.unuseful2(card); + } + return -1; + }; + "step 1" + if(result.bool==false){ + trigger.untrigger(); + trigger.directHit=true; + } + } + }, + nvquan2:{ + trigger:{player:'juedou',target:'juedou'}, + forced:true, + filter:function(event,player){ + return event.turn!=player&&event.turn.sex=='male'; + }, + content:function(){ + "step 0" + var next=trigger.turn.chooseToRespond({name:'sha'}); + next.autochoose=lib.filter.autoRespondSha; + next.ai=function(card){ + if(ai.get.attitude(trigger.turn,player)<0&&trigger.turn.num('h','sha')>1){ + return ai.get.unuseful2(card); + } + return -1; + }; + "step 1" + if(result.bool==false){ + trigger.directHit=true; + } + }, + ai:{ + result:{ + target:function(card,player,target){ + if(card.name=='juedou'&&target.num('h')>0) return [1,0,0,-1]; + } + } + } + }, + nvquan3:{ + // trigger:{target:'useCardToBegin'}, + // filter:function(event){ + // return event.player.sex=='male'&&(event.card.name=='sha'||event.card.name=='juedou'); + // }, + // check:function(event,player){ + // return ai.get.attitude(player,event.player)<=0; + // }, + // direct:true, + // content:function(){ + // "step 0" + // var bool=(ai.get.attitude(player,trigger.player)<=0); + // player.choosePlayerCard(trigger.player,'是否发动【女权】?','he').ai=function(button){ + // if(bool){ + // return ai.get.buttonValue(button); + // } + // else{ + // return 0; + // } + // } + // "step 1" + // if(result.bool){ + // trigger.player.discard(result.links); + // } + // } + mod:{ + targetEnabled:function(card,player,target){ + if(card.name=='juedou'&&player.sex=='male'){ + return false; + } + } + } + }, + feigong:{ + trigger:{global:'useCard'}, + priority:15, + filter:function(event,player){ + return event.card.name=='sha'&&event.player!=player&& + player.num('h','sha')>0&&event.targets.contains(player)==false; + }, + direct:true, + content:function(){ + "step 0" + var effect=0; + for(var i=0;i2){ + ef+=0.5; + } + } + if(ai.get.attitude(player,game.players[i])>0){ + num+=ef; + } + else if(ai.get.attitude(player,game.players[i])<0){ + num-=ef; + } + } + return num>0; + }, + content:function(){ + "step 0" + event.targets=game.players.slice(0); + event.targets.remove(player); + "step 1" + if(event.targets.length){ + event.targets.shift().recover(); + event.redo(); + } + }, + ai:{ + expose:0.1 + } + }, + jieyong:{ + trigger:{player:'useCardAfter'}, + direct:true, + filter:function(event,player){ + if(get.position(event.card)!='d') return false; + if(player.skills.contains('jieyong2')) return false; + return player.num('he',{color:'black'})>0; + }, + content:function(){ + "step 0" + player.chooseToDiscard('he','是否弃置一张黑色牌并收回'+get.translation(trigger.card)+'?',{color:'black'}).ai=function(card){ + return ai.get.value(trigger.card)-ai.get.value(card); + } + "step 1" + if(result.bool){ + player.logSkill('jieyong'); + player.gain(trigger.card,'gain2'); + player.addTempSkill('jieyong2',['phaseAfter','phaseBegin']); + } + }, + ai:{ + threaten:1.3 + } + }, + jieyong_old:{ + enable:'phaseUse', + usable:1, + group:['jieyong3'], + direct:true, + filter:function(event,player){ + return player.num('h',{suit:'heart'})>0; + }, + content:function(){ + "step 0" + var list=[]; + player.getStat('skill').jieyong--; + for(var i in lib.card){ + if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; + if(lib.card[i].type=='trick'||lib.card[i].type=='basic'){ + if(lib.filter.filterCard({name:i,suit:'heart'}),player){ + var select=get.select(lib.card[i].selectTarget); + if(select[0]==1&&select[1]==1){ + list.push(['','',i]); + } + } + } + } + var dialog=ui.create.dialog([list,'vcard']); + player.chooseButton(dialog,function(button){ + // if(player.skills.contains('jieyong4')==false){ + // for(var i=0;i0){ + if(game.players[i].hp<2){ + lose--; + recover+=0.5; + } + lose--; + recover++; + } + else if(ai.get.attitude(player,game.players[i])<0){ + if(game.players[i].hp<2){ + lose++; + recover-=0.5; + } + lose++; + recover--; + } + } + else{ + if(ai.get.attitude(player,game.players[i])>0){ + lose--; + } + else if(ai.get.attitude(player,game.players[i])<0){ + lose++; + } + } + } + } + if(player.hp0; + }, + content:function(){ + "step 0" + var val=ai.get.value(trigger.card); + var suit=get.suit(trigger.card); + player.chooseToDiscard('he','逐鹿:是否发动弃置一张'+get.translation(suit)+ + '牌并获得'+get.translation(trigger.card)+'?',{suit:suit}).ai=function(card){ + return val-ai.get.value(card); + }; + "step 1" + if(result.bool){ + player.gain(trigger.card,'gain2'); + player.addTempSkill('zhulu2','phaseAfter'); + player.logSkill('zhulu'); + } + }, + ai:{ + threaten:1.2 + } + }, + zhulu2:{}, + xieling:{ + enable:'phaseUse', + usable:1, + filterCard:true, + selectCard:2, + check:function(card){ + return 7-ai.get.value(card); + }, + multitarget:true, + targetprompt:['被移走','移动目标'], + filterTarget:function(card,player,target){ + if(ui.selected.targets.length){ + var from=ui.selected.targets[0]; + var judges=from.get('j'); + for(var i=0;i0; + } + }, + selectTarget:2, + content:function(){ + "step 0" + if(targets.length==2){ + player.choosePlayerCard('ej',function(button){ + if(ai.get.attitude(player,targets[0])>ai.get.attitude(player,targets[1])){ + return get.position(button.link)=='j'?10:0; + } + else{ + if(get.position(button.link)=='j') return -10; + return ai.get.equipValue(button.link); + } + },targets[0]); + } + else{ + event.finish(); + } + "step 1" + if(result.bool){ + if(get.position(result.buttons[0].link)=='e'){ + event.targets[1].equip(result.buttons[0].link); + } + else if(result.buttons[0].link.viewAs){ + event.targets[1].addJudge({name:result.buttons[0].link.viewAs},[result.buttons[0].link]); + } + else{ + event.targets[1].addJudge(result.buttons[0].link); + } + event.targets[0].$give(result.buttons[0].link,event.targets[1]) + game.delay(); + } + }, + ai:{ + order:10, + result:{ + target:function(player,target){ + if(ui.selected.targets.length==0){ + if(target.num('j')&&ai.get.attitude(player,target)>0) return 1; + if(ai.get.attitude(player,target)<0){ + for(var i=0;i0){ + if((target.get('e','1')&&!game.players[i].get('e','1'))|| + (target.get('e','2')&&!game.players[i].get('e','2'))|| + (target.get('e','3')&&!game.players[i].get('e','3'))|| + (target.get('e','4')&&!game.players[i].get('e','4'))|| + (target.get('e','5')&&!game.players[i].get('e','5'))) + return -1; + } + } + } + return 0; + } + else{ + return ai.get.attitude(player,ui.selected.targets[0])>0?-1:1; + } + }, + }, + expose:0.2, + threaten:1.5 + } + } + }, + translate:{ + yxs_guanyu:'关羽', + yxs_wuzetian:'武则天', + yxs_caocao:'曹操', + yxs_mozi:'墨子', + yxs_bole:'伯乐', + yxs_aijiyanhou:'埃及艳后', + yxs_diaochan:'貂蝉', + yxs_yangyuhuan:'杨玉环', + + kuixin:'窥心', + kuixin_info:'锁定技,你立即获得你的判定牌', + weiyi:'威仪', + weiyi_info:'每当你受到一次伤害,可以令伤害来源弃置两张牌', + xieling:'挟令', + xieling_info:'出牌阶段,弃掉两张手牌,将任意一名角色装备区或判定区的牌移动到另一名角色对应的区域', + baye:'霸业', + baye_info:'出牌阶段,你可以将一张牌当做本回合内前一张使用的牌来使用。每回合限用一次。', + nvquan:'女权', + nvquan1:'女权', + nvquan2:'女权', + nvquan_info:'你对男性角色使用【杀】或【决斗】时,对方需连续打出两张【杀】当做一张【杀】;你不能成为男性角色的决斗目标', + qiandu:'迁都', + qiandu_info:'出牌阶段,你可以弃一张黑色手牌,和一名存活的玩家与其交换位置。每回合限一次。', + budao:'补刀', + budao_info:'你的回合外,你的攻击范围的一名角色受到【杀】的伤害时,你可以对其使用一张【杀】,只要你的【杀】对目标角色造成了伤害,你就可以继续对其使用【杀】。', + feigong:'非攻', + feigong_info:'其他角色使用杀时,若你不是杀的目标,可以弃置一张杀取消之', + jianai:'兼爱', + jianai_info:'每当你回复一点体力,可以令所有其他角色回复一点体力', + bolehuiyan:'慧眼', + bolehuiyan_info:'当一名有手牌的其他角色成为来源不为你的杀的目标时,你可以预言此杀能否命中,若预言正确,你摸一张牌,每回合限发动一次', + xiangma:'相马', + xiangma_info:'锁定技,计算你与其他角色的距离时始终-1,计算其他角色与你的距离时始终+1', + seyou:'色诱', + seyou_info:'限定技,出牌阶段,你可以指定任意1名角色,其他所有男性角色需选择1项执行:(1)对你指定的角色出【杀】;(2)令你获得其一张牌。', + sheshi:'蛇噬', + sheshi_info:'每受到1次伤害,可以指定1种花色,依次展示牌堆顶的牌,直到出现指定花色的牌为止,你获得与指定花色不同花色的所有牌(最多展示4张牌)。', + + + sanbanfu:'三板斧', + sanbanfu_info:'出牌阶段,你使用对目标角色使用【杀】时,若目标角色不出闪,则目标受到2点伤害,你弃掉1张手牌;若目标角色出1张闪,则目标角色受到1点伤害,你自减1点血量;若目标角色出2张闪,则目标角色不掉血,你自减1点血量。每回合限一次。', + fengyi:'凤仪', + fengyi_info:'出牌阶段,你可以弃一张手牌,指定任意目标摸两张牌。(每回合限用一次)', + wange:'婉歌', + wange_info:'摸牌时,你可以少摸一张牌,则回合结束时你可以抽取一名其他角色的手牌,至少1张,至多X张(X为你当前的掉血量)。', + nichang:'霓裳', + nichang2:'霓裳', + nichang_info:'摸牌时,你可以选择不摸牌,回合结束时展示手牌,每少一种花色摸一张牌', + fengyan:'丰艳', + fengyan_info:'你可以获得其他男性角色的红色判定牌', + chujia:'出嫁', + chujia_info:'出牌阶段可以弃掉两张相同颜色的手牌,指定任意角色摸X张牌。(X为该角色已损失的血量)', + zhulu:'逐鹿', + zhulu_info:'回合外,当有非延时锦囊结算完毕后,你可以立即弃掉一张相同花色手牌或装备区的牌,获得这张锦囊牌。', + jieyong:'节用', + jieyong2:'节用', + jieyong_info:'你使用的卡牌进入弃牌堆后,你可以弃置一张黑色牌并重新获得之(每回合限一次)', + shangtong:'尚同', + shangtong_info:'每当你令其他角色恢复1点血量或掉1点血量时,你可以摸1张牌(摸牌上限为4)', + feiming:'非命', + feiming_info:'其他角色对你造成伤害时,你可以令该角色须选择1项执行:1,将1张红桃花色手牌交给你;2,流失1点血量', + yxsrenwang:'人望', + yxsrenwang_info:'出牌阶段,你可以弃掉2张牌并指定一名手牌数大于你的角色,你摸牌至与该角色手牌数相等,每阶段限一次。', + shiwei:'施威', + shiwei_info:'当其他角色失去最后一张手牌时,你可以将牌堆顶的一张牌背面朝上置于该角色面前,该角色回合,跳过出牌阶段并弃掉这张牌。', + yxswushuang:'无双', + yxswushuang_info:'出牌阶段,你使用【杀】时可同时打出两张【杀】,则该【杀】具有以下效果之一:1,伤害+1;2,额外指定两个目标', + xiaoyong:'骁勇', + xiaoyong_info:'你可以将黑色手牌当作【杀】来使用', + qinzheng:'亲征', + qinzheng_info:'出牌阶段,你对其他角色造成伤害时,可以令场上任意角色摸一张牌。', + juma:'拒马', + juma_info:'你与其他角色的距离始终视为1。', + }, +}; diff --git a/character/zhuogui.js b/character/zhuogui.js new file mode 100644 index 000000000..c10baa852 --- /dev/null +++ b/character/zhuogui.js @@ -0,0 +1,358 @@ +character.zhuogui={ + character:{ + nianshou:['male','shu',4,['nianrui','qixiang']], + mamian:['male','qun',4,['lianyu','guiji']], + niutou:['male','shu',4,['manjia','xiaoshou'],['fullskin']], + baiwuchang:['male','qun',3,['qiangzheng','zuijiu']], + heiwuchang:['male','qun',3,['suoling','xixing']], + }, + skill:{ + qixiang:{ + group:['qixiang1','qixiang2'], + ai:{ + effect:{ + target:function(card,player,target,current){ + if(card.name=='lebu'&&card.name=='bingliang') return 0.8; + } + } + } + }, + qixiang1:{ + trigger:{player:'judge'}, + forced:true, + filter:function(event,player){ + if(event.card){ + if(event.card.viewAs){ + return event.card.viewAs=='lebu'; + } + else{ + return event.card.name=='lebu'; + } + } + }, + content:function(){ + player.addTempSkill('qixiang3','phaseJudgeAfter'); + } + }, + qixiang2:{ + trigger:{player:'judge'}, + forced:true, + filter:function(event,player){ + if(event.card){ + if(event.card.viewAs){ + return event.card.viewAs=='bingliang'; + } + else{ + return event.card.name=='bingliang'; + } + } + }, + content:function(){ + player.addTempSkill('qixiang4','phaseJudgeAfter'); + } + }, + qixiang3:{ + mod:{ + suit:function(card,suit){ + if(suit=='diamond') return 'heart'; + } + } + }, + qixiang4:{ + mod:{ + suit:function(card,suit){ + if(suit=='spade') return 'club'; + } + } + }, + nianrui:{ + trigger:{player:['phaseBegin','phaseEnd']}, + content:function(){ + "step 0" + player.judge(function(card){ + return get.color(card)=='red'?1:0; + }); + "step 1" + if(result.bool){ + player.draw(); + } + } + }, + lianyu:{ + enable:'phaseUse', + usable:1, + filterCard:{color:'red'}, + check:function(card){return 6-ai.get.value(card)}, + filterTarget:true, + selectTarget:-1, + line:'fire', + content:function(){ + target.damage('fire'); + }, + ai:{ + result:{ + player:function(card,player,target){ + var eff=0; + for(var i=0;iplayers[1].hp&&players[0]!=player; + }, + check:function(event,player){ + var players=game.players.slice(0); + players.sort(function(a,b){ + return b.hp-a.hp; + }); + return ai.get.damageEffect(players[0],player,player,'fire')>0; + }, + prompt:function(){ + var players=game.players.slice(0); + players.sort(function(a,b){ + return b.hp-a.hp; + }); + return '枭首:是否对'+get.translation(players[0])+'造成一点火焰伤害?'; + }, + content:function(){ + var players=game.players.slice(0); + players.sort(function(a,b){ + return b.hp-a.hp; + }); + if(players[0].hp>players[1].hp&&players[0]!=player){ + players[0].damage('fire'); + player.line(players[0],'fire'); + } + }, + ai:{ + expose:0.2 + } + }, + guiji:{ + trigger:{player:'phaseJudgeBegin'}, + forced:true, + content:function(){ + player.discard(player.get('j').randomGet()); + }, + filter:function(event ,player){ + return player.num('j')>0; + }, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(get.type(card)=='delay'&&target.num('j')==0) return 0.1; + } + } + } + }, + qiangzheng:{ + trigger:{player:'phaseEnd'}, + direct:true, + forced:true, + filter:function(event,player){ + for(var i=0;i0; + }).ai=function(target){ + return -ai.get.attitude(player,target); + }; + "step 1" + if(result.targets&&result.targets.length){ + player.logSkill('qiangzheng',result.targets); + player.gain(result.targets[0].get('h').randomGet()); + result.targets[0].$give(1,player); + game.delay(); + } + } + }, + zuijiu:{ + trigger:{source:'damageBegin'}, + filter:function(event){ + return event.card&&event.card.name=='sha'&&get.color(event.card)=='black'; + }, + forced:true, + content:function(){ + trigger.num++; + player.addSkill('zuijiu2'); + } + }, + zuijiu2:{ + trigger:{source:'damageEnd'}, + forced:true, + popup:false, + content:function(){ + player.removeSkill('zuijiu2'); + player.chooseToDiscard(true); + } + }, + suoling:{ + trigger:{player:'phaseEnd'}, + forced:true, + content:function(){ + "step 0" + event.targets=game.players.slice(0); + event.targets.remove(player); + event.targets.sort(lib.sort.seat); + if(player.isLinked()) player.link(); + "step 1" + if(event.targets.length){ + var target=event.targets.shift(); + if(!target.isLinked()){ + target.link(); + } + event.redo(); + } + } + }, + xixing:{ + enable:'phaseUse', + usable:1, + filterCard:function(card){ + var type=get.type(card); + for(var i=0;i忠臣:不惜一切保护主公,胜利条件与主公相同。'+ + '
反贼:杀死主公,推翻统治。
内奸:前期在保护主公的情况下除掉其他人,最后杀死主公成为生还者。', + guozhan:'当全场只剩下一种势力存活时,该势力的角色获胜', + versus:'', + infinity:'', + boss:'', + character_card_config:'', + }, + current_mode:{}, + forbid:[ + ['huashen'], + ['lingwu','jilve'], + ['lingwu','yongsi'], + ['lingwu','shangshi'], + ['jizhi','zhiheng'], + ['xiaoji','zhiheng'], + ['relianying','zhiheng'], + ['lianying','rende'], + ['lianying','qingjian'], + ['shanbshi','rende'], + ['shanbshi','qingjian'], + ['rende','relianying'], + ['qingjian','relianying'], + ['rende','yuling'], + ['qingjian','yuling'], + ['qingnang','yiji'], + ['qingnang','reyiji'], + ['qingjian','tuntian'], + ['yiji','tuntian'], + ['reyiji','tuntian'], + ['tuntian','guidao'], + ['tuntian','guicai'], + ['jiang','chongzhen'], + ['fenji','yuling'], + ['jiushi','guixin'], + ['jiushi','jushou'], + ['jiushi','kuiwei'], + ] +} diff --git a/game/game.js b/game/game.js new file mode 100644 index 000000000..14af134a8 --- /dev/null +++ b/game/game.js @@ -0,0 +1,10947 @@ +"use strict"; +window.mode={}; +window.card={}; +window.character={}; +window.play={}; +(function(){ + var _status={ + paused:false, + paused2:false, + over:false, + clicked:false, + auto:false, + event:{ + finished:true, + next:[], + }, + ai:{}, + lastdragchange:[] + }; + var lib={ + version:'1.0.0.1', + configprefix:'noname_0.9_', + updates:[], + canvasUpdates:[], + status:{ + running:false, + canvas:false, + time:0, + delayed:0, + frameId:0, + }, + help:{ + '关于':'无名杀 '+lib.version+'
  • 1L 先谢神上
  • 图片等素材来自网(shén)络(shā)
  • bug反馈/建议欢迎来百度无名杀吧', + '选项帮助':'
    • 控制台命令:开启后可用浏览器控制台控制游戏
    • 自动确认:开启后当候选目标仅有1个时点击目标无需再点击确定
    • 悬停时间:弹出角色/卡牌介绍所需的等待时间
    • '+ + '触屏模式:可消除iOS等设备上300ms的点击延迟,但开启后无法使用鼠标
    • 滚轮控制手牌:开启后滚轮可控制手牌的左右滚动,建议Mac等具备横向滚动功能的设备关闭此选项'+ + '
    • 隐藏非全身皮肤:在新版布局中,若角色没有全身皮肤将被隐藏
    • 游戏玩法:为游戏增加不同玩法,开启后可在帮助中查看介绍'+ + '
    • 加强主公:反贼人数多于2时主公会额外增加一个技能(每个主公的额外技能固定,非常备主公增加天命)', + '游戏操作':'
      • 长按/鼠标悬停/右键单击(需在设置中开启)显示信息
      • 触屏模式中双指点击切换暂停
      • 键盘快捷键
        '+ + '
        a切换托管
        c打开设置
        w切换不询问无懈
        暂停' + }, + placePoppedDialog:function(dialog,e){ + if(e.touches&&e.touches[0]){ + e=e.touches[0]; + } + dialog.style.height=Math.min(ui.window.offsetHeight-20,dialog.content.scrollHeight)+'px'; + if(e.clientXui.window.offsetHeight){ + idealtop=ui.window.offsetHeight-10-dialog.offsetHeight; + } + dialog.style.top=idealtop+'px'; + }, + setHover:function(node,func,hoveration,width){ + node._hoverfunc=func; + if(typeof hoveration=='number'){ + node._hoveration=hoveration; + } + if(typeof width=='number'){ + node._hoverwidth=width + } + node.addEventListener('mouseenter',ui.click.mouseenter); + node.addEventListener('mouseleave',ui.click.mouseleave); + node.addEventListener('mousedown',ui.click.mousedown); + node.addEventListener('mousemove',ui.click.mousemove); + return node; + }, + setLongPress:function(node,func){ + node.addEventListener('touchstart',ui.click.longpressdown); + node.addEventListener('touchend',ui.click.longpresscancel); + // node.addEventListener('mouseleave',ui.click.longpresscancel); + node._longpresscallback=func; + return node; + }, + updateCanvas:function(time){ + if(lib.canvasUpdates.length===0){ + lib.status.canvas=false; + return false; + } + ui.canvas.width=ui.arena.offsetWidth; + ui.canvas.height=ui.arena.offsetHeight; + var ctx=ui.ctx; + ctx.shadowBlur=5; + ctx.shadowColor='rgba(0,0,0,0.3)'; + ctx.fillStyle='white'; + ctx.strokeStyle='white'; + ctx.lineWidth=3; + ctx.save(); + for(var i=0;i10){ + if(config2[i]){ + lib.config.characters.add(i.slice(0,i.indexOf('_character'))); + } + else{ + lib.config.characters.remove(i.slice(0,i.indexOf('_character'))); + } + } + else if(i.indexOf('_card')==i.length-5&&i.length>5){ + if(config2[i]){ + lib.config.cards.add(i.slice(0,i.indexOf('_card'))); + } + else{ + lib.config.cards.remove(i.slice(0,i.indexOf('_card'))); + } + } + if(i.indexOf('_play')==i.length-5&&i.length>5){ + if(config2[i]){ + lib.config.plays.add(i.slice(0,i.indexOf('_play'))); + } + else{ + lib.config.plays.remove(i.slice(0,i.indexOf('_play'))); + } + } + else if(i.indexOf('_mode_config')!=-1&&i.substr(i.indexOf('_mode_config')+13)==lib.config.mode){ + lib.config.mode_config[lib.config.mode][i.substr(0,i.indexOf('_mode_config'))]=config2[i]; + } + } + } + for(var i in lib.config.translate){ + lib.translate[i]=lib.config.translate[i]; + } + lib.init.js('mode',lib.config.mode); + lib.init.js('card',lib.config.all.cards); + lib.init.js('character',lib.config.all.characters); + lib.init.js('play',lib.config.plays); + ui.css={}; + ui.css.layout=lib.init.css('layout/'+lib.config.layout,'layout'); + if(!lib.config.touchscreen){ + if(lib.config.show_scrollbar) ui.css.scrollbar=lib.init.css('layout/default','scrollbar'); + if(lib.config.vertical_scroll) lib.init.css('layout/default','vertical'); + } + if(lib.config.fold_card) ui.css.fold=lib.init.css('layout/default','fold'); + if(lib.config.threed_card) ui.css.threed=lib.init.css('layout/default','fold2'); + if(lib.config.blur_ui) ui.css.blur_ui=lib.init.css('layout/default','blur'); + ui.css.theme=lib.init.css('theme/'+lib.config.theme,'style'); + }, + css:function(path,file,before){ + var style = document.createElement("link"); + style.rel = "stylesheet"; + style.href = path+'/'+file+".css"; + if(before){ + document.head.insertBefore(style,before); + } + else{ + document.head.appendChild(style); + } + return style; + }, + js:function(path,file){ + if(typeof file=='object'){ + for(var i=0;i>6, 0x80 | cc&0x3f); + }); + strUtf = strUtf.replace( + /[\u0800-\uffff]/g,function(c) { + var cc = c.charCodeAt(0); + return String.fromCharCode(0xe0 | cc>>12, 0x80 | cc>>6&0x3F, 0x80 | cc&0x3f); + }); + return btoa(strUtf); + }, + decode:function(str){ + var strUtf=atob(str); + var strUni = strUtf.replace( + /[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,function(c) { + var cc = ((c.charCodeAt(0)&0x0f)<<12) | ((c.charCodeAt(1)&0x3f)<<6) | ( c.charCodeAt(2)&0x3f); + return String.fromCharCode(cc); + }); + strUni = strUni.replace( + /[\u00c0-\u00df][\u0080-\u00bf]/g,function(c){ + var cc = (c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f; + return String.fromCharCode(cc); + }); + return strUni; + } + }, + translate:{ + 'default':"默认", + heart:"♥︎", + diamond:"♦︎", + spade:"♠︎", + club:"♣︎", + heart2:"红桃", + diamond2:"方片", + spade2:"黑桃", + club2:"梅花", + red:'红色', + black:'黑色', + ok:"确定", + cancel:"取消", + restart:"重新开始", + setting:"设置", + start:"开始", + random:"随机", + _phasebegin:'回合开始', + _out:'无效', + agree:'同意', + refuse:'拒绝', + fire:"火", + thunder:"雷", + poison:"毒", + wei:'魏', + shu:'蜀', + wu:'吴', + qun:'群', + male:'男', + female:'女', + draw_card:'摸牌', + discard_card:'弃牌', + reset_character:'重置武将牌', + recover_hp:'回复体力', + lose_hp:'流失体力', + get_damage:'受伤害', + weiColor:"#b0d0e2", + shuColor:"#ffddb9", + wuColor:"#b2d9a9", + qunColor:"#f6f6f6", + basic:'基本', + equip:'装备', + trick:'锦囊', + delay:'延迟锦囊', + character:'角色', + revive:'复活', + equip1:'武器', + equip2:'防具', + equip3:'防御马', + equip4:'攻击马', + equip5:'宝物', + zero:'零', + one:'一', + two:'二', + three:'三', + four:'四', + five:'五', + six:'六', + seven:'七', + eight:'八', + nine:'九', + ten:'十', + }, + element:{ + playerproto:{ + phase:function(){ + "step 0" + player.phaseJudge(); + "step 1" + player.phaseDraw(); + game.delay(); + "step 2" + player.phaseUse(); + "step 3" + player.phaseDiscard() + game.delay(); + }, + phaseJudge:function(){ + "step 0" + if(player.node.judges.childElementCount){ + event.card=player.node.judges.firstChild; + player.lose(event.card); + var clone=event.card.copy('thrown',ui.arena).animate('judgestart'); + clone.style.opacity=0.6; + clone.style.left='calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*50+'px)'; + clone.style.top='calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*40+'px)'; + game.delay(); + game.linexy([ + clone.offsetLeft+clone.offsetWidth/2, + clone.offsetTop+clone.offsetHeight/2, + player.offsetLeft+player.offsetWidth/2, + player.offsetTop+player.offsetHeight/2 + ],{opacity:0.5,dashed:true}); + event.cancelled=false; + event.trigger('phaseJudge'); + } + else event.finish(); + "step 1" + if(!event.cancelled) player.judge(event.card); + "step 2" + var name=event.card.viewAs||event.card.name; + if(event.cancelled&&!event.direct){ + if(lib.card[name].cancel){ + var next=game.createEvent(name+'Cancelled'); + next.content=lib.card[name].cancel; + next.card=event.card; + next.player=player; + } + } + else{ + var next=game.createEvent(name); + next.content=lib.card[name].effect; + next._result=result; + next.card=event.card; + next.player=player; + } + ui.clear(); + event.goto(0); + }, + phaseDraw:function(){ + player.draw(event.num); + }, + phaseUse:function(){ + "step 0"; + player.chooseToUse(); + "step 1" + if(result.bool){ + event.goto(0); + } + }, + phaseDiscard:function(){ + "step 0" + event.num=player.num('h')-game.checkMod(player,player.hp,'maxHandcard',player.get('s')); + if(event.num<=0) event.finish(); + event.trigger('phaseDiscard'); + "step 1" + player.chooseToDiscard(num,true); + "step 2" + event.cards=result.cards; + }, + chooseToUse:function(){ + "step 0" + var ok=game.check(); + if(event.isMine()){ + if(!ok||!lib.config.auto_confirm){ + game.pause(); + } + if(typeof event.prompt=='string'){ + if(!ok) event.dialog=ui.create.dialog(event.prompt); + } + else if(event.prompt=='function'){ + if(!ok) event.dialog=ui.create.dialog(event.prompt(event)); + } + else if(event.prompt==undefined){ + var str; + if(typeof event.filterCard=='object'){ + str='请使用'+get.cnNumber(event.selectCard[0])+'张' + if(filter.name){ + str+=get.translation(filter.name); + } + else{ + str+='牌'; + } + } + else{ + str='请选择要使用的牌'; + } + if(!ok){ + if(event.openskilldialog){ + event.skillDialog=ui.create.dialog(event.openskilldialog); + delete event.openskilldialog; + event.dialog=str; + } + else if(typeof event.skillDialog!='string'){ + event.dialog=ui.create.dialog(str); + } + else{ + event.dialog=str; + } + } + } + } + else{ + if(ok){ + ui.click.ok(); + } + else if(ai.basic.chooseCard(event.ai1)){ + if(ai.basic.chooseTarget(event.ai2)){ + ui.click.ok(); + _status.event.aiexclude.length=0; + } + else{ + if(event.skill){ + var skill=event.skill; + ui.click.cancel(); + event.aiexclude.add(skill); + } + else{ + get.card().aiexclude(); + game.uncheck(); + } + event.redo(); + game.resume(); + } + } + else if(event.skill){ + var skill=event.skill; + ui.click.cancel(); + event.aiexclude.add(skill); + event.redo(); + game.resume(); + } + else{ + ui.click.cancel(); + } + } + "step 1" + if(event.skillDialog&&get.objtype(event.skillDialog)=='div'){ + event.skillDialog.close(); + } + if(event.result.bool){ + if(event.result.card||!event.result.skill){ + player.useCard(event.result.card,event.result.cards,event.result.targets,event.result.skill); + } + else if(event.result.skill){ + player.useSkill(event.result.skill,event.result.cards,event.result.targets); + } + } + if(event.dialog&&typeof event.dialog=='object') event.dialog.close(); + }, + chooseToRespond:function(){ + "step 0" + if(event.responded){ + delete event.dialog; + return; + } + if(event.autochoose&&event.autochoose()){ + event.result={bool:false}; + } + else{ + game.check(); + if(event.isMine()){ + game.pause(); + if(event.dialog) event.dialog=ui.create.dialog(event.dialog); + } + else{ + if(ai.basic.chooseCard(event.ai)||forced){ + ui.click.ok(); + } + else if(event.skill){ + var skill=event.skill; + ui.click.cancel(); + event.aiexclude.add(skill); + event.redo(); + game.resume(); + } + else{ + ui.click.cancel(); + } + } + } + "step 1" + if(event.result.bool){ + player.respond(event.result.cards,event.result.card,event.animate,event.result.skill,event.source); + } + if(event.dialog&&event.dialog.close) event.dialog.close(); + }, + chooseToDiscard:function(){ + "step 0" + if(event.autochoose()){ + event.result={ + bool:true, + cards:player.get(event.position||'h') + } + } + else{ + var range=get.select(event.selectCard); + game.check(); + if(event.isMine()){ + game.pause(); + if(range[1]>1){ + event.promptdiscard=ui.create.control('提示',function(){ + ai.basic.chooseCard(event.ai); + if(_status.event.custom.add.card){ + _status.event.custom.add.card(); + } + }); + } + if(event.prompt!=false){ + var str; + if(typeof(event.prompt)=='string') str=event.prompt; + else{ + str='请弃置'; + if(range[0]==range[1]) str+=get.cnNumber(range[0]); + else if(range[1]==Infinity) str+='至少'+get.cnNumber(range[0]); + else str+=get.cnNumber(range[0])+'至'+get.cnNumber(range[1]); + str+='张'; + if(event.position=='h'||event.position==undefined) str+='手'; + if(event.position=='e') str+='装备'; + str+='牌'; + } + event.dialog=ui.create.dialog(str); + event.dialog.add('0/'+event.selectCard[1]); + event.custom.add.card=function(){ + _status.event.dialog.content.childNodes[1].innerHTML= + ui.selected.cards.length+'/'+_status.event.selectCard[1]; + } + } + else if(get.itemtype(event.dialog)=='dialog'){ + event.dialog.open(); + } + } + else{ + if(ai.basic.chooseCard(event.ai)||forced){ + ui.click.ok(); + } + else if(event.skill){ + var skill=event.skill; + ui.click.cancel(); + event.aiexclude.add(skill); + event.redo(); + game.resume(); + } + else{ + ui.click.cancel(); + } + } + } + "step 1" + if(event.promptdiscard){ + event.promptdiscard.close(); + } + player.discard(event.result.cards); + if(event.dialog) event.dialog.close(); + }, + chooseToCompare:function(){ + "step 0" + if(player.num('h')==0||target.num('h')==0){ + event.result={cancelled:true,bool:false} + event.finish(); + return; + } + game.log(get.translation(player)+'对'+get.translation(target)+'发起拼点'); + player.chooseCard('请选择拼点牌',true).ai=event.ai; + "step 1" + event.card1=result.cards[0]; + target.chooseCard('请选择拼点牌',true).ai=event.ai; + "step 2" + event.card2=result.cards[0]; + player.lose(event.card1); + target.lose(event.card2); + "step 3" + player.$compare(event.card1,target,event.card2); + // player.$throw(event.card1); + // target.$throw(event.card2); + game.log(get.translation(player)+'的拼点牌为'+get.translation(event.card1)); + game.log(get.translation(target)+'的拼点牌为'+get.translation(event.card2)); + event.result={ + player:event.card1, + target:event.card2, + } + if(get.number(event.card1)>get.number(event.card2)){ + event.result.bool=true; + + setTimeout(function(){ + event.dialog=ui.create.dialog(get.translation(player.name)+'拼点成功'); + player.popup('胜'); + target.popup('负'); + game.resume(); + },1500); + } + else{ + event.result.bool=false; + if(get.number(event.card1)>get.number(event.card2)){ + event.result.tie=true; + setTimeout(function(){ + event.dialog=ui.create.dialog(get.translation(player.name)+'拼点失败'); + player.popup('平'); + target.popup('平'); + game.resume(); + },1500); + } + else{ + setTimeout(function(){ + event.dialog=ui.create.dialog(get.translation(player.name)+'拼点失败'); + player.popup('负'); + target.popup('胜'); + game.resume(); + },1500); + } + } + game.pause(); + "step 4" + game.delay(2); + "step 5" + if(typeof event.target.ai.shown=='number'&&event.target.ai.shown<=0.85){ + event.target.ai.shown+=0.1; + } + if(event.clear!==false) ui.clear(); + event.dialog.close(); + }, + chooseButton:function(){ + "step 0" + if(event.dialog==undefined) event.dialog=ui.dialog; + if(event.isMine()){ + event.dialog.open(); + } + game.check(); + if(event.isMine()){ + game.pause(); + } + else{ + if(ai.basic.chooseButton(event.ai)||forced) ui.click.ok(); + else ui.click.cancel(); + } + "step 1" + if(event.closeDialog){ + event.dialog.close(); + } + }, + chooseCard:function(){ + "step 0" + game.check(); + if(event.isMine()){ + game.pause(); + if(event.prompt!=false){ + var str; + if(typeof event.prompt=='string') str=event.prompt; + else{ + str='请选择' + var range=get.select(event.selectCard); + if(range[0]==range[1]) str+=get.cnNumber(range[0]); + else if(range[1]==Infinity) str+='至少'+get.cnNumber(range[0]); + else str+=get.cnNumber(range[0])+'至'+get.cnNumber(range[1]); + str+='张'; + if(event.position=='h'||event.position==undefined) str+='手'; + if(event.position=='e') str+='装备'; + str+='牌'; + } + event.dialog=ui.create.dialog(str); + event.dialog.add('0/'+event.selectCard[1]); + event.custom.add.card=function(){ + _status.event.dialog.content.childNodes[1].innerHTML= + ui.selected.cards.length+'/'+_status.event.selectCard[1]; + } + } + } + else{ + if(ai.basic.chooseCard(event.ai)||forced){ + ui.click.ok(); + } + else if(event.skill){ + var skill=event.skill; + ui.click.cancel(); + event.aiexclude.add(skill); + event.redo(); + game.resume(); + } + else{ + ui.click.cancel(); + } + } + "step 1" + if(event.dialog) event.dialog.close(); + }, + chooseTarget:function(){ + "step 0" + game.check(); + if(event.isMine()){ + game.pause(); + if(event.prompt!=false){ + var str; + if(typeof event.prompt=='string') str=event.prompt; + else{ + str='请选择' + var range=get.select(event.selectTarget); + if(range[0]==range[1]) str+=get.cnNumber(range[0]); + else if(range[1]==Infinity) str+='至少'+get.cnNumber(range[0]); + else str+=get.cnNumber(range[0])+'至'+get.cnNumber(range[1]); + str+='个目标'; + } + event.dialog=ui.create.dialog(str); + event.dialog.add('0/'+event.selectTarget[1]); + event.custom.add.target=function(){ + _status.event.dialog.content.childNodes[1].innerHTML= + ui.selected.targets.length+'/'+_status.event.selectTarget[1]; + } + } + else if(get.itemtype(event.dialog)=='dialog'){ + event.dialog.open(); + } + } + else{ + if(ai.basic.chooseTarget(event.ai)||forced){ + ui.click.ok(); + } + else{ + ui.click.cancel(); + } + } + "step 1" + if(event.result.bool){ + for(var i=0;i1&&!get.info(card).multiline){ + player.line2(targets,config); + } + else{ + player.line(targets,config); + } + } + player.$throw(cards); + } + event.trigger('useCard'); + if(get.type(card)!='equip'){ + var str=get.translation(player); + if(targets.length){ + str+='对'+(targets[0]==player?'自己':get.translation(targets[0])); + for(var i=1;i1||cards[0]!=card)){ + str+='('+get.translation(cards)+')'; + } + game.log(str); + } + if(event.addCount!=false){ + if(player.stat[player.stat.length-1].card[card.name]==undefined){ + player.stat[player.stat.length-1].card[card.name]=1; + } + else{ + player.stat[player.stat.length-1].card[card.name]++; + } + if(event.skill){ + if(player.stat[player.stat.length-1].skill[event.skill]==undefined){ + player.stat[player.stat.length-1].skill[event.skill]=1; + } + else{ + player.stat[player.stat.length-1].skill[event.skill]++; + } + } + } + "step 1" + if(get.info(card).contentBefore){ + var next=game.createEvent(card.name+'ContentBefore'); + next.content=get.info(card).contentBefore; + next.targets=targets; + next.card=card; + next.cards=cards; + next.player=player; + } + "step 2" + if(targets[num]&&targets[num].isDead()) return; + if(targets[num]&&targets[num].isOut()) return; + if(targets[num]&&targets[num].removed) return; + var info=get.info(card); + if(targets.length==0&&!info.notarget) return; + var next=game.createEvent(card.name); + next.content=info.content; + next.targets=targets; + next.card=card; + next.cards=cards; + next.player=player; + next.num=num; + next.type='card'; + next.skill=event.skill; + next.multitarget=info.multitarget; + if(num==0&&next.targets.length>1){ + if(!info.multitarget){ + lib.tempSortSeat=player; + targets.sort(lib.sort.seat); + delete lib.tempSortSeat; + for(var i=0;i1){ + // var ttt=next.target; + // setTimeout(function(){ttt.animate('target');},0.5*lib.config.duration); + } + else{ + next.target.animate('target'); + } + } + if(event.animate!=false||num>0){ + if(num==0)game.delay(); + else game.delay(0.5); + } + "step 3" + if(!get.info(event.card).multitarget&&num1){ + player.line2(targets,config); + } + else{ + player.line(targets,config); + } + } + var str=get.translation(player); + if(targets&&targets.length){ + str+='对'+(targets[0]==player?'自己':get.translation(targets[0])); + for(var i=1;i1){ + if(!info.multitarget){ + lib.tempSortSeat=player; + targets.sort(lib.sort.seat); + delete lib.tempSortSeat; + } + for(var i=0;i1){ + // var ttt=next.target; + // setTimeout(function(){ttt.animate('target');},0.5*lib.config.duration); + } + else{ + next.target.animate('target'); + } + } + if(num==0){ + if(typeof info.delay=='number') game.delay(info.delay); + else if(info.delay!==false&&info.delay!==0) game.delay(); + } + else game.delay(0.5); + if(!info.multitarget&&num1||cards[0].name!=card.name)){ + str+='('+get.translation(cards)+')'; + } + game.log(str); + for(var i=0;i0?player.node.handcards1:player.node.handcards2; + for(j=0;jlib.config.sort_card(position.childNodes[j])) break; + } + } + if(event.animate=='draw'){ + player.$draw(); + (function(card,position){ + setTimeout(function(){ + position.insertBefore(card,position.childNodes[j]); + },500); + }(cards[num],position)) + } + else if(event.animate=='draw2'){ + player.$draw(cards[num]); + (function(card,position){ + setTimeout(function(){ + position.insertBefore(card,position.childNodes[j]); + },500); + }(cards[num],position)) + } + else if(event.animate=='gain'){ + player.$gain(cards[num]); + (function(card,position){ + setTimeout(function(){ + position.insertBefore(card,position.childNodes[j]); + },700); + }(cards[num],position)) + } + else if(event.animate=='gain2'){ + player.$gain2(cards[num]); + (function(card,position){ + setTimeout(function(){ + position.insertBefore(card,position.childNodes[j]); + },500); + }(cards[num],position)) + } + else{ + position.insertBefore(cards[num],position.childNodes[j]); + } + } + else{ + if(sort>0) frag1.appendChild(cards[num]); + else frag2.appendChild(cards[num]); + } + } + if(!lib.config.strict_sort){ + if(event.animate=='draw'){ + player.$draw(cards.length); + game.delay(1,500); + setTimeout(function(){ + player.node.handcards1.insertBefore(frag1,player.node.handcards1.firstChild); + player.node.handcards2.insertBefore(frag2,player.node.handcards2.firstChild); + player.update(); + },500); + } + else if(event.animate=='gain'){ + player.$gain(cards); + game.delay(1,700); + setTimeout(function(){ + player.node.handcards1.insertBefore(frag1,player.node.handcards1.firstChild); + player.node.handcards2.insertBefore(frag2,player.node.handcards2.firstChild); + player.update(); + },700); + } + else if(event.animate=='gain2'||event.animate=='draw2'){ + player.$gain2(cards); + game.delay(1,500); + setTimeout(function(){ + player.node.handcards1.insertBefore(frag1,player.node.handcards1.firstChild); + player.node.handcards2.insertBefore(frag2,player.node.handcards2.firstChild); + player.update(); + },500); + } + else{ + player.node.handcards1.insertBefore(frag1,player.node.handcards1.firstChild); + player.node.handcards2.insertBefore(frag2,player.node.handcards2.firstChild); + player.update(); + } + } + }, + lose:function(){ + "step 0" + for(var i=0;i0;i--){ + if(player.node.handcards1.childNodes[i].classList.contains('removing')==false){ + player.node.handcards1.childNodes[i].animate('last'); + break; + } + } + for(var i=player.node.handcards2.childNodes.length-1;i>0;i--){ + if(player.node.handcards2.childNodes[i].classList.contains('removing')==false){ + player.node.handcards2.childNodes[i].animate('last'); + break; + } + } + event.num=0; + "step 1" + if(numplayer.maxHp-player.hp) num=player.maxHp-player.hp; + if(num>0){ + player.changeHp(num); + game.log(get.translation(player)+'回复了'+get.cnNumber(num)+'点体力') + } + }, + loseHp:function(){ + "step 0" + game.log(get.translation(player)+'失去了'+get.cnNumber(num)+'点体力') + player.changeHp(-num); + "step 1" + if(player.hp<=0){ + game.delay(); + player.dying(event); + } + }, + loseMaxHp:function(){ + "step 0" + var forced=false; + for(var i=0;iplayer.maxHp) player.hp=player.maxHp; + player.update(); + if(event.popup!==false){ + player.popup(num); + } + event.trigger('changeHp'); + }, + dying:function(){ + "step 0" + _status.dying=player; + event.trigger('dying'); + game.log(get.translation(player)+'濒死') + "step 1" + if(_status.dying==player) delete _status.dying; + if(player.hp<=0) player.die(event.reason); + }, + die:function(){ + if(source){ + game.log(get.translation(player)+'被'+get.translation(source)+'杀害'); + if(source.stat[source.stat.length-1].kill==undefined){ + source.stat[source.stat.length-1].kill=1; + } + else{ + source.stat[source.stat.length-1].kill++; + } + } + else{ + game.log(get.translation(player)+'遇难') + } + var i; + event.cards=player.get('hej'); + if(event.cards.length){ + for(i=0;i=equipNum){ + player.node.equips.insertBefore(card,player.node.equips.childNodes[i]); + equipped=true; + break; + } + } + if(!equipped){ + player.node.equips.appendChild(card); + } + player.node.equips.dataset.number=player.num('e'); + game.log(get.translation(player)+'装备了'+get.translation(card)) + "step 2" + var info=get.info(card); + if(info.onEquip&&(!info.filterEquip||info.filterEquip(card,player))){ + var next=game.createEvent('equip_'+card.name); + next.content=info.onEquip; + next.player=player; + next.card=card; + game.delay(); + } + delete player.equiping; + }, + addJudge:function(){ + "step 0" + if(cards&&get.owner(cards[0])) get.owner(cards[0]).lose(cards); + "step 1" + cards[0].fix(); + var viewAs=typeof card=='string'?card:card.name; + if(!lib.card[viewAs]||!lib.card[viewAs].effect){ + ui.discardPile.appendChild(cards[0]); + } + else{ + player.node.judges.insertBefore(cards[0],player.node.judges.firstChild); + player.$gain2(cards); + if(get.itemtype(card)!='card'){ + if(typeof card=='string') cards[0].viewAs=card; + else cards[0].viewAs=card.name; + } + else{ + delete cards[0].viewAs; + } + if(cards[0].viewAs&&cards[0].viewAs!=cards[0].name){ + game.log(get.translation(player)+'被贴上了'+get.translation(cards[0].viewAs)+'('+get.translation(cards)+')'); + } + else{ + game.log(get.translation(player)+'被贴上了'+get.translation(cards)); + } + } + }, + judge:function(){ + "step 0" + player.judging=get.cards()[0]; + event.node=player.judging.copy('thrown','center',ui.arena).animate('start'); + event.dialog=ui.create.dialog(get.translation(player)+'的'+event.judgestr+'判定'); + game.log(get.translation(player)+'进行'+event.judgestr+'判定,亮出的判定牌为'+get.translation(player.judging)); + game.delay(2); + event.trigger('judge'); + "step 1" + event.result={ + card:player.judging, + number:get.number(player.judging), + suit:get.suit(player.judging), + color:get.color(player.judging), + judge:event.judge(player.judging), + node:event.node, + }; + if(event.result.judge>0) event.result.bool=true; + if(event.result.judge<0) event.result.bool=false; + delete player.judging; + if(event.result.judge>0){ + player.popup('洗具'); + } + else if(event.result.judge<0){ + player.popup('杯具'); + } + if(event.clearArena!=false) ui.clear(); + event.dialog.close(); + game.log(get.translation(player)+'的判定结果为'+get.translation(event.result.card)); + if(!get.owner(event.result.card)) event.position.appendChild(event.result.card); + }, + turnOver:function(){ + game.log(get.translation(player)+'翻面'); + player.classList.toggle('turnedover'); + }, + link:function(){ + if(player.isLinked()){ + game.log(get.translation(player)+'解除连环'); + } + else{ + game.log(get.translation(player)+'被连环'); + } + player.classList.toggle('linked'); + }, + + }, + player:{ + init:function(character,character2,skill){ + if(character2==false){ + skill=false; + character2=null; + } + var info=lib.character[character]; + var skills=info[3]; + this.skills.length=0; + if(lib.config.layout=='newlayout'&&info[4]&&info[4].contains('fullskin')){ + this.classList.add('fullskin'); + this.node.avatar.style.backgroundImage='url("image/character/fullskin/'+character+'.jpg")'; + this.node.avatar.style.backgroundSize='cover'; + } + else{ + this.node.avatar.setBackground(character,'character'); + } + + this.node.avatar.show(); + this.node.count.show(); + this.name=character; + this.sex=info[0]; + this.group=info[1]; + this.hp=info[2]; + this.maxHp=info[2]; + // this.node.identity.style.backgroundColor=get.translation(this.group+'Color'); + this.node.intro.innerHTML=lib.config.intro; + if(lib.config.touchscreen){ + lib.setLongPress(this,ui.click.intro); + } + if(lib.config.right_info){ + this.oncontextmenu=ui.click.rightplayer; + } + if(lib.config.hover_all){ + lib.setHover(this,ui.click.hoverplayer); + } + var name=get.translation(character); + this.node.name.innerHTML=''; + if(!lib.config.show_name){ + this.node.name.style.display='none'; + } + for(var i=0;i'; + } + if(character2){ + var info2=lib.character[character2]; + + if(lib.config.layout=='newlayout'&&lib.config.only_fullskin){ + this.classList.add('fullskin2'); + this.node.avatar2.style.backgroundImage='url("image/character/fullskin/'+character2+'.jpg")'; + this.node.avatar2.style.backgroundSize='cover'; + } + else{ + this.node.avatar2.setBackground(character2,'character'); + } + + + + this.node.avatar2.show(); + this.name2=character2; + if(get.config('double_hp2')){ + this.hp=get.config('double_hp2')(info[2],info2[2]) + } + else{ + this.hp=info[2]+info2[2]-3; + } + this.maxHp=this.hp; + this.node.count.classList.add('p2'); + skills=skills.concat(info2[3]); + } + if(skill!=false){ + for(var i=0;i=this.maxHp) this.hp=this.maxHp; + var hp=this.node.hp; + hp.style.transition='none'; + if(lib.config.layout=='default'&&this.maxHp>14){ + hp.innerHTML=this.hp+'/'+this.maxHp; + hp.classList.add('text'); + } + else{ + hp.innerHTML=''; + hp.classList.remove('text'); + while(this.maxHp>hp.childNodes.length){ + ui.create.div(hp); + } + while(this.maxHp=9){ + if(this.maxHp>9){ + this.node.hp.classList.add('longlong'); + } + else{ + this.node.hp.classList.remove('longlong'); + this.node.hp.classList.add('long'); + } + } + else{ + this.node.hp.classList.remove('long'); + this.node.hp.classList.remove('longlong'); + } + } + + if(this.hp>Math.round(this.maxHp/2)||this.hp===this.maxHp){ + this.node.hp.dataset.condition='high'; + } + else if(this.hp>Math.floor(this.maxHp/3)){ + this.node.hp.dataset.condition='mid'; + } + else{ + this.node.hp.dataset.condition='low'; + } + + setTimeout(function(){ + hp.style.transition=''; + }); + var numh=this.num('h'); + if(numh>=10){ + numh=numh.toString(); + this.node.count.dataset.condition='low'; + this.node.count.innerHTML=numh[0]+'
        '+numh[1]; + } + else{ + if(numh>5){ + this.node.count.dataset.condition='higher'; + } + else if(numh>2){ + this.node.count.dataset.condition='high'; + } + else if(numh>0){ + this.node.count.dataset.condition='mid'; + } + else{ + this.node.count.dataset.condition='none'; + } + this.node.count.innerHTML=numh; + } + this.node.equips.dataset.number=this.num('e'); + if(this==game.me){ + this.node.handcards1.dataset.number=Math.min(6,this.node.handcards1.childNodes.length- + this.node.handcards1.getElementsByClassName('removing').length)-1; + this.node.handcards2.dataset.number=Math.min(6,this.node.handcards2.childNodes.length- + this.node.handcards2.getElementsByClassName('removing').length)-1; + } + if(this.updates){ + for(var i=0;i0){ + cards.splice(arg2); + } + else if(typeof arg2=='function'){ + for(i=0;i=this.player.num(this.position||'h'); + } + next.content=lib.element.playerproto.chooseToDiscard; + return next; + }, + chooseToCompare:function(target,check){ + var next=game.createEvent('chooseToCompare'); + next.player=this; + next.target=target; + if(check) next.ai=check; + else next.ai=function(card){ + var player=get.owner(card); + var event=_status.event.parent; + if(player==event.player){ + if(event.small){ + return -get.number(card)-ai.get.value(card)/2; + } + return get.number(card)-ai.get.value(card)/2; + } + if(ai.get.attitude(player,_status.event.parent.player)>0){ + if(event.small){ + return get.number(card)-ai.get.value(card)/2; + } + return -get.number(card)-ai.get.value(card)/2; + } + return get.number(card)-ai.get.value(card)/2; + } + next.content=lib.element.playerproto.chooseToCompare; + return next; + }, + chooseCardButton:function(){ + var cards,prompt,forced,select; + for(var i=0;i0) return -val; + return val; + }; + next.content=lib.element.playerproto.choosePlayerCard; + return next; + }, + discardPlayerCard:function(){ + var next=game.createEvent('discardPlayerCard'); + next.player=this; + for(var i=0;i0) return -val; + return val; + }; + next.content=lib.element.playerproto.discardPlayerCard; + return next; + }, + gainPlayerCard:function(){ + var next=game.createEvent('gainPlayerCard'); + next.player=this; + for(var i=0;i0) return -val; + return val; + }; + next.content=lib.element.playerproto.gainPlayerCard; + return next; + }, + showHandcards:function(){ + var next=game.createEvent('showHandcards'); + next.player=this; + next.content=lib.element.playerproto.showHandcards; + }, + showCards:function(cards){ + var next=game.createEvent('showCards'); + next.player=this; + if(get.itemtype(cards)=='card') next.cards=[cards]; + else if(get.itemtype(cards)=='cards') next.cards=cards; + else _status.event.next.remove(next); + next.content=lib.element.playerproto.showCards; + }, + viewHandcards:function(target){ + var next=game.createEvent('viewHandcards'); + next.player=this; + next.target=target; + next.content=lib.element.playerproto.viewHandcards; + }, + useCard:function(){ + var next=game.createEvent('useCard'); + next.player=this; + next.num=0; + for(var i=0;i=-1&&ai.get.attitude(this,next.targets[i])<0){ + if(!this.ai.tempIgnore) this.ai.tempIgnore=[]; + this.ai.tempIgnore.add(next.targets[i]); + } + } + if(typeof this.logAi=='function'){ + this.logAi(next.targets,next.card); + } + next.content=lib.element.playerproto.useCard; + return next; + }, + useSkill:function(){ + var next=game.createEvent('useSkill'); + next.player=this; + next.num=0; + for(var i=0;i=-1&&ai.get.attitude(this,next.targets[i])<0){ + if(!this.ai.tempIgnore) this.ai.tempIgnore=[]; + this.ai.tempIgnore.add(next.targets[i]); + } + } + if(typeof this.logAi=='function'){ + this.logAi(next.targets,next.skill); + } + } + else{ + next.targets=[]; + } + next.content=lib.element.playerproto.useSkill; + }, + draw:function(){ + var next=game.createEvent('draw'); + next.player=this; + for(var i=0;i'; + } + } + if(className){ + node.classList.add(className); + } + }, + popup:function(name,className){ + var name2=get.translation(name); + var node=ui.create.div('.popup',ui.arena); + node.dataset.position=this.dataset.position; + if(this.dataset.position==0||parseInt(this.dataset.position)==(game.players.length+game.dead.length)/2|| + typeof name2=='number'){ + node.innerHTML=name2; + } + else{ + for(var i=0;i'; + } + } + if(className){ + node.classList.add(className); + } + this.popups.push(node); + if(this.popups.length>1){ + node.hide(); + } + else{ + var that=this; + setTimeout(function(){that._popup();},1000); + } + }, + _popup:function(){ + if(this.popups.length){ + this.popups.shift().delete(); + if(this.popups.length){ + this.popups[0].show(); + var that=this; + setTimeout(function(){that._popup();},1000); + } + } + }, + markSkill:function(name,info,card){ + if(!info){ + if(this.marks[name]){ + return this; + } + if(lib.skill[name]){ + info=lib.skill[name].intro; + } + if(!info){ + return this; + } + } + if(this.marks[name]){ + this.marks[name].info=info; + } + else{ + if(card){ + this.marks[name]=this.mark(card,info,name); + } + else{ + this.marks[name]=this.mark(name,info); + } + } + return this; + }, + unmarkSkill:function(name){ + if(this.marks[name]){ + this.marks[name].delete(); + delete this.marks[name]; + var info=lib.skill[name]; + if(info&&info.intro&&info.intro.onunmark){ + info.intro.onunmark(this.storage[name],this); + } + } + }, + markCharacter:function(name,info,learn,learn2){ + if(typeof name=='object'){ + name=name.name; + } + if(!lib.character[name]) return this; + var node=ui.create.div('.card.mark',this.node.marks).setBackground(name,'character'); + node.name=name+'_charactermark'; + if(!info){ + info={}; + } + if(!info.name){ + info.name=get.translation(name); + } + if(!info.content){ + info.content=get.skillintro(name,learn,learn2) + } + node.info=info; + if(lib.config.touchscreen){ + lib.setLongPress(node,ui.click.intro); + } + if(lib.config.right_info){ + node.oncontextmenu=ui.click.rightplayer; + } + if(lib.config.hover_all){ + lib.setHover(node,ui.click.hoverplayer); + } + return node; + }, + mark:function(name,info,skill){ + if(get.itemtype(name)=='cards'){ + var marks=[]; + for(var i=0;i1){ + setTimeout(function(){ + if(cards){ + that.$draw(cards) + } + else{ + that.$draw(num-1) + } + },200); + } + }, + $compare:function(card1,target,card2){ + var player=this; + var node1=player.$throwxy(card1, + 'calc(50% - 114px)','calc(50% - 52px)' + ); + node1.classList.add('infohidden'); + node1.style.webkitTransform='perspective(600px) rotateY(180deg) translateX(0)'; + // ui.refresh(node1); + setTimeout(function(){ + setTimeout(function(){ + node1.style.transition='all ease-in 0.3s'; + node1.style.webkitTransform='perspective(600px) rotateY(270deg) translateX(52px)'; + node1.addEventListener('webkitTransitionEnd',function(){ + node1.classList.remove('infohidden'); + node1.classList.add('cardflip'); + node1.style.webkitTransform='none'; + node1.style.transition=''; + }); + },600); + + + var node2=target.$throwxy(card2, + 'calc(50% + 10px)','calc(50% - 52px)' + ); + node2.classList.add('infohidden'); + node2.style.webkitTransform='perspective(600px) rotateY(180deg) translateX(0)'; + // ui.refresh(node2); + setTimeout(function(){ + node2.style.transition='all ease-in 0.3s'; + node2.style.webkitTransform='perspective(600px) rotateY(270deg) translateX(52px)'; + node2.addEventListener('webkitTransitionEnd',function(){ + node2.classList.remove('infohidden'); + node2.classList.add('cardflip'); + node2.style.webkitTransform='none'; + node2.style.transition=''; + }); + },700); + + },200); + }, + $throw:function(card,time){ + if(get.itemtype(card)=='cards'){ + for(var i=0;i1){ + if(log!=false){ + game.log(get.translation(this)+'获得了'+get.cnNumber(card)+'张牌'); + } + for(var i=0;i0) left=-left; + if(source.offsetTop-this.offsetTop>0) top=-top; + if(this.isLinked()&&lib.config.layout=='newlayout'){ + this.style.webkitTransform='translate('+left+'px,'+top+'px) rotate(-90deg)'; + } + else{ + this.style.webkitTransform='translate('+left+'px,'+top+'px)'; + } + } + else{ + if(this.isLinked()&&lib.config.layout=='newlayout'){ + this.style.webkitTransform='scale(0.95) rotate(-90deg)'; + } + else{ + this.style.webkitTransform='scale(0.95)'; + } + } + this.queue(); + }, + $die:function(){ + var top0=ui.window.offsetHeight/2; + var left0=ui.window.offsetWidth/2; + var ratio=(left0-this.offsetLeft)/(top0-this.offsetTop); + var left=Math.abs(50*ratio/Math.sqrt(1+ratio*ratio)); + var top=Math.abs(50/Math.sqrt(1+ratio*ratio)); + if(left0-this.offsetLeft>0) left=-left; + if(top0-this.offsetTop>0) top=-top; + this.style.webkitTransform='translate('+left+'px,'+top+'px) '+ + 'rotate('+(Math.random()*20-10)+'deg) '+ + ((Math.random()-0.5<0)?'rotateX(180deg)':'rotateY(180deg)'); + this.queue(false); + }, + }, + card:{ + init:function(card){ + var bg=card[2]; + if(!lib.config.hide_card_image&&lib.card[card[2]].fullskin){ + this.classList.add('fullskin'); + this.node.image.style.backgroundImage='url("image/card/'+card[2]+'.png")' + } + else if(lib.card[card[2]].image=='background'){ + if(card[3]) this.node.background.setBackground(bg+'_'+card[3],'card'); + else this.node.background.setBackground(bg,'card'); + } + else if(lib.card[card[2]].image=='card'){ + if(card[3]) this.setBackground(bg+'_'+card[3],'card'); + else this.setBackground(bg,'card'); + } + else if(typeof lib.card[card[2]].image=='string'){ + this.setBackground(lib.card[card[2]].image); + } + else{ + this.node.background.innerHTML=lib.translate[bg+'_bg']||get.translation(bg)[0]; + // this.node.background.style.fontFamily=lib.config.card_font; + if(this.node.background.innerHTML.length>1) this.node.background.classList.add('tight'); + else this.node.background.classList.remove('tight'); + } + if(lib.card[card[2]].color){ + this.style.color=lib.card[card[2]].color; + } + if(lib.card[card[2]].textShadow){ + this.style.textShadow=lib.card[card[2]].textShadow; + } + if(lib.card[card[2]].opacity){ + this.node.info.style.opacity=lib.card[card[2]].opacity; + this.node.name.style.opacity=lib.card[card[2]].opacity; + } + this.node.info.innerHTML=get.translation(card[0])+' '+card[1]; + if(card[0]=='heart'||card[0]=='diamond'){ + this.node.info.classList.add('red'); + } + this.node.name.innerHTML=''; + var name=get.translation(card[2]); + if(card[2]=='sha'){ + if(card[3]=='fire'){ + name='火'+name; + this.node.image.classList.add('fire'); + } + else if(card[3]=='thunder'){ + name='雷'+name; + this.node.image.classList.add('thunder'); + } + } + for(var i=0;i'; + } + if(lib.card[card[2]].subtype=='equip3'){ + this.node.name.innerHTML+='+'; + } + else if(lib.card[card[2]].subtype=='equip4'){ + this.node.name.innerHTML+='-'; + } + this.node.name2.innerHTML=get.translation(card[0])+card[1]+' '+name; + this.suit=card[0]; + this.number=card[1]; + this.name=card[2]; + this.classList.add('card'); + if(card[3]){ + if(lib.nature.contains(card[3])) this.nature=card[3]; + this.classList.add(card[3]); + } + if(lib.card[card[2]].subtype) this.classList.add(lib.card[card[2]].subtype); + if(this.inits){ + for(var i=0;i