diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000000..e72bfddabc1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. 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 +them 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 prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. 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. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey 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; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If 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 convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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 that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + 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. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +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. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + 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 +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 3 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, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program 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, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU 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. But first, please read +. \ No newline at end of file diff --git a/forge-ai/pom.xml b/forge-ai/pom.xml index b84adeea7d5..eb808066d02 100644 --- a/forge-ai/pom.xml +++ b/forge-ai/pom.xml @@ -6,7 +6,7 @@ forge forge - 1.6.28-SNAPSHOT + 1.6.29-SNAPSHOT forge-ai diff --git a/forge-ai/src/main/java/forge/ai/AIOption.java b/forge-ai/src/main/java/forge/ai/AIOption.java index 3eea52dfc7e..66925e7f6b8 100644 --- a/forge-ai/src/main/java/forge/ai/AIOption.java +++ b/forge-ai/src/main/java/forge/ai/AIOption.java @@ -1,5 +1,5 @@ package forge.ai; public enum AIOption { - USE_SIMULATION; + USE_SIMULATION } diff --git a/forge-ai/src/main/java/forge/ai/AiAttackController.java b/forge-ai/src/main/java/forge/ai/AiAttackController.java index 1a374d80660..c309b41ac01 100644 --- a/forge-ai/src/main/java/forge/ai/AiAttackController.java +++ b/forge-ai/src/main/java/forge/ai/AiAttackController.java @@ -1021,7 +1021,7 @@ public class AiAttackController { } // stay at home to block if ( LOG_AI_ATTACKS ) - System.out.println(String.valueOf(this.aiAggression) + " = ai aggression"); + System.out.println(this.aiAggression + " = ai aggression"); // **************** // Evaluation the end @@ -1457,7 +1457,7 @@ public class AiAttackController { if (artifact != null) { return artifact; } - return null; //should never get here + return null;//should never get here } private void doLightmineFieldAttackLogic(List attackersLeft, int numForcedAttackers, boolean playAggro) { diff --git a/forge-ai/src/main/java/forge/ai/AiBlockController.java b/forge-ai/src/main/java/forge/ai/AiBlockController.java index e948d3cebfc..82df82ef46f 100644 --- a/forge-ai/src/main/java/forge/ai/AiBlockController.java +++ b/forge-ai/src/main/java/forge/ai/AiBlockController.java @@ -859,7 +859,7 @@ public class AiBlockController { damageToPW += ComputerUtilCombat.predictDamageTo((Card) def, pwatkr.getNetCombatDamage(), pwatkr, true); } } - if ((!onlyIfLethal && damageToPW > 0) || damageToPW >= ((Card) def).getCounters(CounterType.LOYALTY)) { + if ((!onlyIfLethal && damageToPW > 0) || damageToPW >= def.getCounters(CounterType.LOYALTY)) { threatenedPWs.add((Card) def); } } @@ -879,7 +879,7 @@ public class AiBlockController { if (!chumpPWDefenders.isEmpty()) { for (final Card attacker : attackers) { GameEntity def = combat.getDefenderByAttacker(attacker); - if (def instanceof Card && threatenedPWs.contains((Card) def)) { + if (def instanceof Card && threatenedPWs.contains(def)) { if (attacker.hasKeyword(Keyword.TRAMPLE)) { // don't bother trying to chump a trampling creature continue; @@ -914,7 +914,7 @@ public class AiBlockController { pwDefenders.addAll(combat.getBlockers(pwAtk)); } else { isFullyBlocked = false; - damageToPW += ComputerUtilCombat.predictDamageTo((Card) pw, pwAtk.getNetCombatDamage(), pwAtk, true); + damageToPW += ComputerUtilCombat.predictDamageTo(pw, pwAtk.getNetCombatDamage(), pwAtk, true); } } if (!isFullyBlocked && damageToPW >= pw.getCounters(CounterType.LOYALTY)) { @@ -1329,13 +1329,9 @@ public class AiBlockController { && ((Card) combat.getDefenderByAttacker(attacker)).isPlaneswalker(); boolean wantToTradeDownToSavePW = chanceToTradeDownToSaveWalker > 0; - if (((evalBlk <= evalAtk + 1) || (wantToSavePlaneswalker && wantToTradeDownToSavePW)) // "1" accounts for tapped. + return ((evalBlk <= evalAtk + 1) || (wantToSavePlaneswalker && wantToTradeDownToSavePW)) // "1" accounts for tapped. && powerParityOrHigher && (creatureParityOrAllowedDiff || wantToTradeWithCreatInHand) - && (MyRandom.percentTrue(chance) || wantToSavePlaneswalker)) { - return true; - } - - return false; + && (MyRandom.percentTrue(chance) || wantToSavePlaneswalker); } } diff --git a/forge-ai/src/main/java/forge/ai/AiCardMemory.java b/forge-ai/src/main/java/forge/ai/AiCardMemory.java index e0794076723..9e203710dd9 100644 --- a/forge-ai/src/main/java/forge/ai/AiCardMemory.java +++ b/forge-ai/src/main/java/forge/ai/AiCardMemory.java @@ -137,7 +137,7 @@ public class AiCardMemory { Set memorySet = getMemorySet(set); - return memorySet == null ? false : memorySet.contains(c); + return memorySet != null && memorySet.contains(c); } /** @@ -291,7 +291,7 @@ public class AiCardMemory { * @return true, if the given memory set contains no remembered cards. */ public boolean isMemorySetEmpty(MemorySet set) { - return set == null ? true : getMemorySet(set).isEmpty(); + return set == null || getMemorySet(set).isEmpty(); } /** diff --git a/forge-ai/src/main/java/forge/ai/AiController.java b/forge-ai/src/main/java/forge/ai/AiController.java index bc548e7079f..a027cc9ea1c 100644 --- a/forge-ai/src/main/java/forge/ai/AiController.java +++ b/forge-ai/src/main/java/forge/ai/AiController.java @@ -1645,7 +1645,6 @@ public class AiController { // For non-converted triggers (such as Cumulative Upkeep) that don't have costs or targets to worry about return true; } - return false; } @@ -1690,16 +1689,11 @@ public class AiController { left = AbilityUtils.calculateAmount(hostCard, svarToCheck, sa); } System.out.println("aiShouldRun?" + left + comparator + compareTo); - if (Expressions.compare(left, comparator, compareTo)) { - return true; - } + return Expressions.compare(left, comparator, compareTo); } else if (effect.getMapParams().containsKey("AICheckDredge")) { return player.getCardsIn(ZoneType.Library).size() > 8 || player.isCardInPlay("Laboratory Maniac"); - } else if (sa != null && doTrigger(sa, false)) { - return true; - } + } else return sa != null && doTrigger(sa, false); - return false; } public List chooseSaToActivateFromOpeningHand(List usableFromOpeningHand) { @@ -2078,9 +2072,7 @@ public class AiController { // AI-specific restrictions specified as activation parameters in spell abilities if (sa.hasParam("AILifeThreshold")) { - if (player.getLife() <= Integer.parseInt(sa.getParam("AILifeThreshold"))) { - return false; - } + return player.getLife() > Integer.parseInt(sa.getParam("AILifeThreshold")); } return true; diff --git a/forge-ai/src/main/java/forge/ai/AiCostDecision.java b/forge-ai/src/main/java/forge/ai/AiCostDecision.java index c5ae2738f94..47dfbbd4d4b 100644 --- a/forge-ai/src/main/java/forge/ai/AiCostDecision.java +++ b/forge-ai/src/main/java/forge/ai/AiCostDecision.java @@ -56,7 +56,7 @@ public class AiCostDecision extends CostDecisionMakerBase { @Override public PaymentDecision visit(CostChooseCreatureType cost) { String choice = player.getController().chooseSomeType("Creature", ability, CardType.getAllCreatureTypes(), - Lists.newArrayList()); + Lists.newArrayList()); return PaymentDecision.type(choice); } @@ -475,7 +475,7 @@ public class AiCostDecision extends CostDecisionMakerBase { if (ability.getPayCosts().hasTapCost() && typeList.contains(ability.getHostCard())) { c--; } - source.setSVar("ChosenX", "Number$" + Integer.toString(c)); + source.setSVar("ChosenX", "Number$" + c); } else { if (!isVehicle) { c = AbilityUtils.calculateAmount(source, amount, ability); @@ -809,7 +809,7 @@ public class AiCostDecision extends CostDecisionMakerBase { final String sVar = ability.getSVar(amount); if (sVar.equals("XChoice")) { c = AbilityUtils.calculateAmount(source, "ChosenX", ability); - source.setSVar("ChosenX", "Number$" + String.valueOf(c)); + source.setSVar("ChosenX", "Number$" + c); } else if (amount.equals("All")) { c = source.getCounters(cost.counter); } else if (sVar.equals("Targeted$CardManaCost")) { @@ -865,7 +865,7 @@ public class AiCostDecision extends CostDecisionMakerBase { } typeList = CardLists.filter(typeList, Presets.TAPPED); c = typeList.size(); - source.setSVar("ChosenX", "Number$" + Integer.toString(c)); + source.setSVar("ChosenX", "Number$" + c); } else { c = AbilityUtils.calculateAmount(source, amount, ability); } diff --git a/forge-ai/src/main/java/forge/ai/AiPlayDecision.java b/forge-ai/src/main/java/forge/ai/AiPlayDecision.java index c3c41cd20ba..692badb6bd8 100644 --- a/forge-ai/src/main/java/forge/ai/AiPlayDecision.java +++ b/forge-ai/src/main/java/forge/ai/AiPlayDecision.java @@ -17,5 +17,5 @@ public enum AiPlayDecision { WouldBecomeZeroToughnessCreature, WouldDestroyWorldEnchantment, BadEtbEffects, - CurseEffects; + CurseEffects } \ No newline at end of file diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtil.java b/forge-ai/src/main/java/forge/ai/ComputerUtil.java index baf97df8181..f3172be4a43 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtil.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtil.java @@ -423,7 +423,7 @@ public class ComputerUtil { int mana = ComputerUtilMana.getAvailableManaEstimate(ai, false); boolean cantAffordSoon = activate.getCMC() > mana + 1; - boolean wrongColor = !activate.determineColor().hasNoColorsExcept(ColorSet.fromNames(ComputerUtilCost.getAvailableManaColors(ai, ImmutableList.of())).getColor()); + boolean wrongColor = !activate.determineColor().hasNoColorsExcept(ColorSet.fromNames(ComputerUtilCost.getAvailableManaColors(ai, ImmutableList.of())).getColor()); // Only do this for spells, not activated abilities // We can't pay for this spell even if we play another land, or have wrong colors @@ -524,7 +524,7 @@ public class ComputerUtil { typeList = CardLists.filter(typeList, CardPredicates.canBeSacrificedBy(ability)); - if ((target != null) && target.getController() == ai && typeList.contains(target)) { + if ((target != null) && target.getController() == ai) { typeList.remove(target); // don't sacrifice the card we're pumping } @@ -554,7 +554,7 @@ public class ComputerUtil { final Card target, final int amount) { CardCollection typeList = CardLists.getValidCards(ai.getCardsIn(zone), type.split(";"), activate.getController(), activate, null); - if ((target != null) && target.getController() == ai && typeList.contains(target)) { + if ((target != null) && target.getController() == ai) { typeList.remove(target); // don't exile the card we're pumping } @@ -575,7 +575,7 @@ public class ComputerUtil { final Card target, final int amount) { CardCollection typeList = CardLists.getValidCards(ai.getCardsIn(zone), type.split(";"), activate.getController(), activate, null); - if ((target != null) && target.getController() == ai && typeList.contains(target)) { + if ((target != null) && target.getController() == ai) { typeList.remove(target); // don't move the card we're pumping } @@ -704,7 +704,7 @@ public class ComputerUtil { public static CardCollection chooseReturnType(final Player ai, final String type, final Card activate, final Card target, final int amount) { final CardCollection typeList = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), type.split(";"), activate.getController(), activate, null); - if ((target != null) && target.getController() == ai && typeList.contains(target)) { + if ((target != null) && target.getController() == ai) { // don't bounce the card we're pumping typeList.remove(target); } @@ -794,11 +794,11 @@ public class ComputerUtil { if (c.hasSVar("SacMe") || ComputerUtilCard.evaluateCreature(c) < sacThreshold) { return true; } - + if (ComputerUtilCard.hasActiveUndyingOrPersist(c)) { return true; } - + return false; } }); @@ -1925,9 +1925,9 @@ public class ComputerUtil { if (predictThreatenedObjects(ai, null).contains(source)) { return true; } - if (game.getPhaseHandler().inCombat() && - ComputerUtilCombat.combatantWouldBeDestroyed(ai, source, game.getCombat())) { - return true; + if (game.getPhaseHandler().inCombat() && + ComputerUtilCombat.combatantWouldBeDestroyed(ai, source, game.getCombat())) { + return true; } } else if (zone.getZoneType() == ZoneType.Exile && sa.getMayPlay() != null) { // play cards in exile that can only be played that turn @@ -1967,11 +1967,8 @@ public class ComputerUtil { final CardCollectionView lands = CardLists.filter(handList, new Predicate() { @Override public boolean apply(final Card c) { - if (c.getManaCost().getCMC() > 0 || c.hasSVar("NeedsToPlay") - || (!c.getType().isLand() && !c.getType().isArtifact())) { - return false; - } - return true; + return c.getManaCost().getCMC() <= 0 && !c.hasSVar("NeedsToPlay") + && (c.getType().isLand() || c.getType().isArtifact()); } }); @@ -1986,10 +1983,7 @@ public class ComputerUtil { final CardCollectionView castables = CardLists.filter(handList, new Predicate() { @Override public boolean apply(final Card c) { - if (c.getManaCost().getCMC() > 0 && c.getManaCost().getCMC() <= landSize) { - return false; - } - return true; + return c.getManaCost().getCMC() <= 0 || c.getManaCost().getCMC() > landSize; } }); @@ -2186,10 +2180,7 @@ public class ComputerUtil { CardCollection goodChoices = CardLists.filter(validCards, new Predicate() { @Override public boolean apply(final Card c) { - if (c.hasSVar("DiscardMeByOpp") || c.hasSVar("DiscardMe")) { - return false; - } - return true; + return !c.hasSVar("DiscardMeByOpp") && !c.hasSVar("DiscardMe"); } }); if (goodChoices.isEmpty()) { @@ -2225,7 +2216,7 @@ public class ComputerUtil { public static String chooseSomeType(Player ai, String kindOfType, String logic, List invalidTypes) { if (invalidTypes == null) { - invalidTypes = ImmutableList.of(); + invalidTypes = ImmutableList.of(); } final Game game = ai.getGame(); @@ -2546,8 +2537,7 @@ public class ComputerUtil { @Override public boolean apply(final Card c) { if (c.getController() == ai) { - if (c.getSVar("Targeting").equals("Dies") || c.getSVar("Targeting").equals("Counter")) - return false; + return !c.getSVar("Targeting").equals("Dies") && !c.getSVar("Targeting").equals("Counter"); } return true; } @@ -2875,7 +2865,6 @@ public class ComputerUtil { } else if (Iterables.any(list, CardTraitPredicates.hasParam("AiLogic", "LichDraw"))) { return false; } - return true; } diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java b/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java index f562e7a3a01..21197757d99 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java @@ -368,7 +368,7 @@ public class ComputerUtilCard { } if (hasEnchantmants || hasArtifacts) { - final List ae = CardLists.filter(list, Predicates.and(Predicates.or(CardPredicates.Presets.ARTIFACTS, CardPredicates.Presets.ENCHANTMENTS), new Predicate() { + final List ae = CardLists.filter(list, Predicates.and(Predicates.or(CardPredicates.Presets.ARTIFACTS, CardPredicates.Presets.ENCHANTMENTS), new Predicate() { @Override public boolean apply(Card card) { return !card.hasSVar("DoNotDiscardIfAble"); @@ -1301,7 +1301,7 @@ public class ComputerUtilCard { combatTrick = true; final List kws = sa.hasParam("KW") ? Arrays.asList(sa.getParam("KW").split(" & ")) - : Lists.newArrayList(); + : Lists.newArrayList(); for (String kw : kws) { if (!kw.equals("Trample") && !kw.equals("First Strike") && !kw.equals("Double Strike")) { combatTrick = false; @@ -1601,8 +1601,8 @@ public class ComputerUtilCard { } pumped.addNewPT(c.getCurrentPower(), c.getCurrentToughness(), timestamp); - pumped.addTempPowerBoost(c.getTempPowerBoost() + power + berserkPower); - pumped.addTempToughnessBoost(c.getTempToughnessBoost() + toughness); + pumped.setPTBoost(c.getPTBoostMap()); + pumped.addPTBoost(power + berserkPower, toughness, timestamp); pumped.addChangedCardKeywords(kws, null, false, false, timestamp); Set types = c.getCounters().keySet(); for(CounterType ct : types) { @@ -1648,6 +1648,8 @@ public class ComputerUtilCard { } list.add(vCard); // account for the static abilities that may be present on the card itself for (final Card c : list) { + // remove old boost that might be copied + vCard.removePTBoost(c.getTimestamp()); for (final StaticAbility stAb : c.getStaticAbilities()) { final Map params = stAb.getMapParams(); if (!params.get("Mode").equals("Continuous")) { @@ -1663,26 +1665,25 @@ public class ComputerUtilCard { if (!vCard.isValid(valid, c.getController(), c, null)) { continue; } + int att = 0; if (params.containsKey("AddPower")) { String addP = params.get("AddPower"); - int att = 0; if (addP.equals("AffectedX")) { att = CardFactoryUtil.xCount(vCard, AbilityUtils.getSVar(stAb, addP)); } else { att = AbilityUtils.calculateAmount(c, addP, stAb); } - vCard.addTempPowerBoost(att); } + int def = 0; if (params.containsKey("AddToughness")) { String addT = params.get("AddToughness"); - int def = 0; if (addT.equals("AffectedY")) { def = CardFactoryUtil.xCount(vCard, AbilityUtils.getSVar(stAb, addT)); } else { def = AbilityUtils.calculateAmount(c, addT, stAb); } - vCard.addTempToughnessBoost(def); } + vCard.addPTBoost(att, def, c.getTimestamp()); } } } diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilCombat.java b/forge-ai/src/main/java/forge/ai/ComputerUtilCombat.java index 4a38704d130..9c030f3a2d4 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilCombat.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilCombat.java @@ -84,7 +84,7 @@ public class ComputerUtilCombat { return Iterables.any(defenders, new Predicate() { @Override public boolean apply(final GameEntity input) { return ComputerUtilCombat.canAttackNextTurn(attacker, input); - }; + } }); } // canAttackNextTurn(Card) @@ -119,11 +119,7 @@ public class ComputerUtilCombat { } // The creature won't untap next turn - if (atacker.isTapped() && !Untap.canUntap(atacker)) { - return false; - } - - return true; + return !atacker.isTapped() || Untap.canUntap(atacker); } // canAttackNextTurn(Card, GameEntity) /** @@ -883,20 +879,19 @@ public class ComputerUtilCombat { } else if (mode == TriggerType.DamageDone) { willTrigger = true; if (trigParams.containsKey("ValidSource")) { - if (CardTraitBase.matchesValid(defender, trigParams.get("ValidSource").split(","), source) + if (!(CardTraitBase.matchesValid(defender, trigParams.get("ValidSource").split(","), source) && defender.getNetCombatDamage() > 0 && (!trigParams.containsKey("ValidTarget") - || CardTraitBase.matchesValid(attacker, trigParams.get("ValidTarget").split(","), source))) { - return true; + || CardTraitBase.matchesValid(attacker, trigParams.get("ValidTarget").split(","), source)))) { + return false; } - if (CardTraitBase.matchesValid(attacker, trigParams.get("ValidSource").split(","), source) + if (!(CardTraitBase.matchesValid(attacker, trigParams.get("ValidSource").split(","), source) && attacker.getNetCombatDamage() > 0 && (!trigParams.containsKey("ValidTarget") - || CardTraitBase.matchesValid(defender, trigParams.get("ValidTarget").split(","), source))) { - return true; + || CardTraitBase.matchesValid(defender, trigParams.get("ValidTarget").split(","), source)))) { + return false; } } - return false; } return willTrigger; @@ -1414,7 +1409,7 @@ public class ComputerUtilCombat { if (att.matches("[0-9][0-9]?") || att.matches("-" + "[0-9][0-9]?")) { power += Integer.parseInt(att); } else { - String bonus = new String(source.getSVar(att)); + String bonus = source.getSVar(att); if (bonus.contains("TriggerCount$NumBlockers")) { bonus = TextUtil.fastReplace(bonus, "TriggerCount$NumBlockers", "Number$1"); } else if (bonus.contains("TriggeredPlayersDefenders$Amount")) { // for Melee @@ -1655,7 +1650,7 @@ public class ComputerUtilCombat { if (def.matches("[0-9][0-9]?") || def.matches("-" + "[0-9][0-9]?")) { toughness += Integer.parseInt(def); } else { - String bonus = new String(source.getSVar(def)); + String bonus = source.getSVar(def); if (bonus.contains("TriggerCount$NumBlockers")) { bonus = TextUtil.fastReplace(bonus, "TriggerCount$NumBlockers", "Number$1"); } else if (bonus.contains("TriggeredPlayersDefenders$Amount")) { // for Melee @@ -1948,7 +1943,7 @@ public class ComputerUtilCombat { return defenderDamage >= attackerLife; } // defender no double strike - return false; // should never arrive here + return false;// should never arrive here } // canDestroyAttacker // For AI safety measures like Regeneration @@ -2195,7 +2190,7 @@ public class ComputerUtilCombat { return attackerDamage >= defenderLife; } // attacker no double strike - return false; // should never arrive here + return false;// should never arrive here } // canDestroyBlocker diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilCost.java b/forge-ai/src/main/java/forge/ai/ComputerUtilCost.java index 43c942f94a2..bdbf2abf61c 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilCost.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilCost.java @@ -424,7 +424,7 @@ public class ComputerUtilCost { continue; } final int remainingLife = ai.getLife(); - final int lifeCost = ((CostPayLife) part).convertAmount(); + final int lifeCost = part.convertAmount(); if ((remainingLife - lifeCost) < 10) { return false; //Don't pay life if it would put AI under 10 life } else if ((remainingLife / lifeCost) < 4) { @@ -552,7 +552,7 @@ public class ComputerUtilCost { final Card source = sa.getHostCard(); final String aiLogic = sa.getParam("UnlessAI"); boolean payForOwnOnly = "OnlyOwn".equals(aiLogic); - boolean payOwner = sa.hasParam("UnlessAI") ? aiLogic.startsWith("Defined") : false; + boolean payOwner = sa.hasParam("UnlessAI") && aiLogic.startsWith("Defined"); boolean payNever = "Never".equals(aiLogic); boolean shockland = "Shockland".equals(aiLogic); boolean isMine = sa.getActivatingPlayer().equals(payer); diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java index 7aae37dc721..8e9c0f84e2d 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java @@ -880,10 +880,12 @@ public class ComputerUtilMana { // For combat tricks, always obey mana reservation if (curPhase == PhaseType.COMBAT_DECLARE_BLOCKERS || curPhase == PhaseType.CLEANUP) { - AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_DECLBLK); - } else if (!(ai.getGame().getPhaseHandler().isPlayerTurn(ai)) && (curPhase == PhaseType.COMBAT_DECLARE_BLOCKERS || curPhase == PhaseType.CLEANUP)) { - AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_ENEMY_DECLBLK); - AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.CHOSEN_FOG_EFFECT); + if (!(ai.getGame().getPhaseHandler().isPlayerTurn(ai))) { + AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_ENEMY_DECLBLK); + AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.CHOSEN_FOG_EFFECT); + } + else + AiCardMemory.clearMemorySet(ai, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_DECLBLK); } else { if ((AiCardMemory.isRememberedCard(ai, sourceCard, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_DECLBLK)) || (AiCardMemory.isRememberedCard(ai, sourceCard, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_ENEMY_DECLBLK))) { diff --git a/forge-ai/src/main/java/forge/ai/GameState.java b/forge-ai/src/main/java/forge/ai/GameState.java index a7477639ce4..deb1a7d021b 100644 --- a/forge-ai/src/main/java/forge/ai/GameState.java +++ b/forge-ai/src/main/java/forge/ai/GameState.java @@ -1061,7 +1061,7 @@ public abstract class GameState { } private void applyCountersToGameEntity(GameEntity entity, String counterString) { - entity.setCounters(Maps.newEnumMap(CounterType.class)); + entity.setCounters(Maps.newEnumMap(CounterType.class)); String[] allCounterStrings = counterString.split(","); for (final String counterPair : allCounterStrings) { String[] pair = counterPair.split("=", 2); @@ -1107,7 +1107,7 @@ public abstract class GameState { Map counters = c.getCounters(); // Note: Not clearCounters() since we want to keep the counters // var as-is. - c.setCounters(Maps.newEnumMap(CounterType.class)); + c.setCounters(Maps.newEnumMap(CounterType.class)); if (c.isAura()) { // dummy "enchanting" to indicate that the card will be force-attached elsewhere // (will be overridden later, so the actual value shouldn't matter) diff --git a/forge-ai/src/main/java/forge/ai/PlayerControllerAi.java b/forge-ai/src/main/java/forge/ai/PlayerControllerAi.java index 529df9a08c8..7e4923d8c9d 100644 --- a/forge-ai/src/main/java/forge/ai/PlayerControllerAi.java +++ b/forge-ai/src/main/java/forge/ai/PlayerControllerAi.java @@ -492,7 +492,7 @@ public class PlayerControllerAi extends PlayerController { Card toDiscard = Aggregates.itemWithMin(cardsOfType, CardPredicates.Accessors.fnGetCmc); return new CardCollection(toDiscard); } - return getAi().getCardsToDiscard(num, (String[])null, sa); + return getAi().getCardsToDiscard(num, null, sa); } @@ -612,7 +612,7 @@ public class PlayerControllerAi extends PlayerController { @Override public CardCollection chooseCardsToDiscardToMaximumHandSize(int numDiscard) { - return brains.getCardsToDiscard(numDiscard, (String[])null, null); + return brains.getCardsToDiscard(numDiscard, null, null); } @Override @@ -669,7 +669,7 @@ public class PlayerControllerAi extends PlayerController { throw new InvalidParameterException("SA is not api-based, this is not supported yet"); } return SpellApiToAi.Converter.get(api).chooseNumber(player, sa, min, max, params); - }; + } @Override public int chooseNumber(SpellAbility sa, String title, List options, Player relatedPlayer) { diff --git a/forge-ai/src/main/java/forge/ai/SpecialCardAi.java b/forge-ai/src/main/java/forge/ai/SpecialCardAi.java index 1b3afb1d8c1..27700e2455b 100644 --- a/forge-ai/src/main/java/forge/ai/SpecialCardAi.java +++ b/forge-ai/src/main/java/forge/ai/SpecialCardAi.java @@ -94,12 +94,8 @@ public class SpecialCardAi { int minCMC = isLowCMCDeck ? 3 : 4; // probably not worth wasting a lotus on a low-CMC spell (<4 CMC), except in low-CMC decks, where 3 CMC may be fine int paidCMC = cost.getConvertedManaCost(); if (paidCMC < minCMC) { - if (paidCMC == 3 && numManaSrcs < 3) { - // if it's a CMC 3 spell and we're more than one mana source short for it, might be worth it anyway - return true; - } - - return false; + // if it's a CMC 3 spell and we're more than one mana source short for it, might be worth it anyway + return paidCMC == 3 && numManaSrcs < 3; } return true; @@ -218,11 +214,7 @@ public class SpecialCardAi { } } - if (ai.getLife() <= sa.getHostCard().getNetPower() && !hasUsefulBlocker) { - return true; - } else { - return false; - } + return ai.getLife() <= sa.getHostCard().getNetPower() && !hasUsefulBlocker; } public static int getSacThreshold() { @@ -335,7 +327,7 @@ public class SpecialCardAi { boolean canTrample = source.hasKeyword(Keyword.TRAMPLE); if (!isBlocking && combat.getDefenderByAttacker(source) instanceof Card) { - int loyalty = ((Card)combat.getDefenderByAttacker(source)).getCounters(CounterType.LOYALTY); + int loyalty = combat.getDefenderByAttacker(source).getCounters(CounterType.LOYALTY); int totalDamageToPW = 0; for (Card atk : (combat.getAttackersOf(combat.getDefenderByAttacker(source)))) { if (combat.isUnblocked(atk)) { @@ -411,11 +403,7 @@ public class SpecialCardAi { Pair predictedPT = getPumpedPT(ai, source.getNetCombatDamage(), source.getNetToughness()); int oppT = Aggregates.sum(potentialBlockers, CardPredicates.Accessors.fnGetNetToughness); - if (potentialBlockers.isEmpty() || (source.hasKeyword(Keyword.TRAMPLE) && predictedPT.getLeft() - oppT >= oppLife)) { - return true; - } - - return false; + return potentialBlockers.isEmpty() || (source.hasKeyword(Keyword.TRAMPLE) && predictedPT.getLeft() - oppT >= oppLife); } public static Pair getPumpedPT(Player ai, int power, int toughness) { @@ -522,7 +510,7 @@ public class SpecialCardAi { best.add(sp); // these SAs are prioritized since the AI sees a reason to play them now } final List keywords = sp.hasParam("KW") ? Arrays.asList(sp.getParam("KW").split(" & ")) - : Lists.newArrayList(); + : Lists.newArrayList(); for (String kw : keywords) { if (!tgtCard.hasKeyword(kw)) { if ("Indestructible".equals(kw) && ai.getOpponents().getCreaturesInPlay().isEmpty()) { @@ -568,10 +556,7 @@ public class SpecialCardAi { @Override public boolean apply(final Card c) { // Don't enchant creatures that can survive - if (!c.canBeDestroyed() || c.getNetCombatDamage() < c.getNetToughness() || c.isEnchantedBy("Guilty Conscience")) { - return false; - } - return true; + return c.canBeDestroyed() && c.getNetCombatDamage() >= c.getNetToughness() && !c.isEnchantedBy("Guilty Conscience"); } }); chosen = ComputerUtilCard.getBestCreatureAI(creatures); @@ -911,15 +896,14 @@ public class SpecialCardAi { } } else if (blackViseOTB && computerHandSize + exiledWithNecro - 1 >= 4) { // try not to overdraw in presence of Black Vise - return false; + return false; } else if (computerHandSize + exiledWithNecro - 1 >= maxHandSize) { // Only draw until we reach max hand size return false; } else if (!ph.isPlayerTurn(ai) || !ph.is(PhaseType.MAIN2)) { // Only activate in AI's own turn (sans the exception above) return false; - } - + } return true; } } @@ -941,11 +925,7 @@ public class SpecialCardAi { } // Maybe use it for some important high-impact spells even if there are more cards in hand? - if (ai.getCardsIn(ZoneType.Hand).size() > 1 && !hasEnsnaringBridgeEffect) { - return false; - } - - return true; + return ai.getCardsIn(ZoneType.Hand).size() <= 1 || hasEnsnaringBridgeEffect; } } @@ -1310,12 +1290,8 @@ public class SpecialCardAi { } } - if (aiHandSize < HAND_SIZE_THRESHOLD || maxOppHandSize - aiHandSize > HAND_SIZE_THRESHOLD) { - // use in case we're getting low on cards or if we're significantly behind our opponent in cards in hand - return true; - } - - return false; + // use in case we're getting low on cards or if we're significantly behind our opponent in cards in hand + return aiHandSize < HAND_SIZE_THRESHOLD || maxOppHandSize - aiHandSize > HAND_SIZE_THRESHOLD; } } @@ -1342,9 +1318,7 @@ public class SpecialCardAi { if (topGY == null || !topGY.isCreature() || ComputerUtilCard.evaluateCreature(creatHand) > ComputerUtilCard.evaluateCreature(topGY) + 80) { - if (numCreatsInHand > 1 || !ComputerUtilMana.canPayManaCost(creatHand.getSpellPermanent(), ai, 0)) { - return true; - } + return numCreatsInHand > 1 || !ComputerUtilMana.canPayManaCost(creatHand.getSpellPermanent(), ai, 0); } } @@ -1465,8 +1439,7 @@ public class SpecialCardAi { } else if (!ph.isPlayerTurn(ai)) { // Only activate in AI's own turn (sans the exception above) return false; - } - + } return true; } } diff --git a/forge-ai/src/main/java/forge/ai/ability/ActivateAbilityAi.java b/forge-ai/src/main/java/forge/ai/ability/ActivateAbilityAi.java index 44780ec2e94..18029dd4d7f 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ActivateAbilityAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ActivateAbilityAi.java @@ -56,12 +56,9 @@ public class ActivateAbilityAi extends SpellAbilityAi { } else { final List defined = AbilityUtils.getDefinedPlayers(source, sa.getParam("Defined"), sa); - if (!defined.contains(opp)) { - return false; - } + return defined.contains(opp); } - return true; } else { sa.resetTargets(); sa.getTargets().add(opp); diff --git a/forge-ai/src/main/java/forge/ai/ability/AddTurnAi.java b/forge-ai/src/main/java/forge/ai/ability/AddTurnAi.java index 243edf2c3f7..f20a3f2f7fd 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AddTurnAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AddTurnAi.java @@ -67,10 +67,8 @@ public class AddTurnAi extends SpellAbilityAi { return false; } } - if (!StringUtils.isNumeric(sa.getParam("NumTurns"))) { - // TODO: improve ai for Sage of Hours - return false; - } + // TODO: improve ai for Sage of Hours + return StringUtils.isNumeric(sa.getParam("NumTurns")); // not sure if the AI should be playing with cards that give the // Human more turns. } diff --git a/forge-ai/src/main/java/forge/ai/ability/AmassAi.java b/forge-ai/src/main/java/forge/ai/ability/AmassAi.java index 0c98f2b65c6..7699259abd1 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AmassAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AmassAi.java @@ -23,9 +23,7 @@ public class AmassAi extends SpellAbilityAi { final Game game = ai.getGame(); if (!aiArmies.isEmpty()) { - if (CardLists.count(aiArmies, CardPredicates.canReceiveCounters(CounterType.P1P1)) <= 0) { - return false; - } + return CardLists.count(aiArmies, CardPredicates.canReceiveCounters(CounterType.P1P1)) > 0; } else { final String tokenScript = "b_0_0_zombie_army"; final int amount = AbilityUtils.calculateAmount(host, sa.getParamOrDefault("Num", "1"), sa); @@ -57,12 +55,9 @@ public class AmassAi extends SpellAbilityAi { //reset static abilities game.getAction().checkStaticAbilities(false); - if (!result) { - return false; - } + return result; } - return true; } @Override diff --git a/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java b/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java index 0ba446e250e..17748584c9f 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java @@ -207,21 +207,16 @@ public class AnimateAi extends SpellAbilityAi { return bFlag; // All of the defined stuff is animated, not very useful } else { sa.resetTargets(); - if (!animateTgtAI(sa)) { - return false; - } + return animateTgtAI(sa); } - return true; } @Override public boolean chkAIDrawback(SpellAbility sa, Player aiPlayer) { if (sa.usesTargeting()) { sa.resetTargets(); - if (!animateTgtAI(sa)) { - return false; - } + return animateTgtAI(sa); } return true; diff --git a/forge-ai/src/main/java/forge/ai/ability/AnimateAllAi.java b/forge-ai/src/main/java/forge/ai/ability/AnimateAllAi.java index 8e126db8ae8..79770568fd3 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AnimateAllAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AnimateAllAi.java @@ -8,11 +8,7 @@ public class AnimateAllAi extends SpellAbilityAi { @Override protected boolean canPlayAI(Player aiPlayer, SpellAbility sa) { - if ("Always".equals(sa.getParam("AILogic"))) { - return true; - } - - return false; + return "Always".equals(sa.getParam("AILogic")); } // end animateAllCanPlayAI() @Override diff --git a/forge-ai/src/main/java/forge/ai/ability/AttachAi.java b/forge-ai/src/main/java/forge/ai/ability/AttachAi.java index ae728a26dc7..16fe3ec0936 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AttachAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AttachAi.java @@ -123,9 +123,7 @@ public class AttachAi extends SpellAbilityAi { return !(c.hasProtectionFrom(source) || c.hasKeyword(Keyword.SHROUD) || c.hasKeyword(Keyword.HEXPROOF)); } }); - if (targets.isEmpty()) { - return false; - } + return !targets.isEmpty(); } return true; @@ -239,9 +237,7 @@ public class AttachAi extends SpellAbilityAi { return false; } - if (!(combat.isAttacking(attachTarget) || combat.isBlocking(attachTarget))) { - return false; - } + return combat.isAttacking(attachTarget) || combat.isBlocking(attachTarget); } return true; @@ -987,9 +983,7 @@ public class AttachAi extends SpellAbilityAi { return false; } // don't equip creatures that don't gain anything - if (card.hasSVar("NonStackingAttachEffect") && newTarget.isEquippedBy(card.getName())) { - return false; - } + return !card.hasSVar("NonStackingAttachEffect") || !newTarget.isEquippedBy(card.getName()); } } @@ -1218,10 +1212,10 @@ public class AttachAi extends SpellAbilityAi { if (isUsefulAttachKeyword(keyword, c, sa, pow)) { return true; } - if (c.hasKeyword(Keyword.INFECT) && pow >= 2) { - // consider +2 power a significant bonus on Infect creatures - return true; - } + } + if (c.hasKeyword(Keyword.INFECT) && pow >= 2) { + // consider +2 power a significant bonus on Infect creatures + return true; } return false; } @@ -1353,7 +1347,7 @@ public class AttachAi extends SpellAbilityAi { CardCollection prefList = list; // Filter AI-specific targets if provided - prefList = ComputerUtil.filterAITgts(sa, aiPlayer, (CardCollection)list, true); + prefList = ComputerUtil.filterAITgts(sa, aiPlayer, list, true); Card c = attachGeneralAI(aiPlayer, sa, prefList, mandatory, attachSource, sa.getParam("AILogic")); @@ -1557,86 +1551,55 @@ public class AttachAi extends SpellAbilityAi { } if (evasive) { - if (card.getNetCombatDamage() + powerBonus <= 0 - || !ComputerUtilCombat.canAttackNextTurn(card) - || !canBeBlocked) { - return false; - } + return card.getNetCombatDamage() + powerBonus > 0 + && ComputerUtilCombat.canAttackNextTurn(card) + && canBeBlocked; } else if (keyword.equals("Haste")) { - if (!card.hasSickness() || !ph.isPlayerTurn(sa.getActivatingPlayer()) || card.isTapped() - || card.getNetCombatDamage() + powerBonus <= 0 - || card.hasKeyword("CARDNAME can attack as though it had haste.") - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || !ComputerUtilCombat.canAttackNextTurn(card)) { - return false; - } + return card.hasSickness() && ph.isPlayerTurn(sa.getActivatingPlayer()) && !card.isTapped() + && card.getNetCombatDamage() + powerBonus > 0 + && !card.hasKeyword("CARDNAME can attack as though it had haste.") + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && ComputerUtilCombat.canAttackNextTurn(card); } else if (keyword.endsWith("Indestructible")) { return true; } else if (keyword.endsWith("Deathtouch") || keyword.endsWith("Wither")) { - if (card.getNetCombatDamage() + powerBonus <= 0 - || ((!canBeBlocked || !ComputerUtilCombat.canAttackNextTurn(card)) - && !CombatUtil.canBlock(card, true))) { - return false; - } + return card.getNetCombatDamage() + powerBonus > 0 + && ((canBeBlocked && ComputerUtilCombat.canAttackNextTurn(card)) + || CombatUtil.canBlock(card, true)); } else if (keyword.equals("Double Strike") || keyword.equals("Lifelink")) { - if (card.getNetCombatDamage() + powerBonus <= 0 - || (!ComputerUtilCombat.canAttackNextTurn(card) && !CombatUtil.canBlock(card, true))) { - return false; - } + return card.getNetCombatDamage() + powerBonus > 0 + && (ComputerUtilCombat.canAttackNextTurn(card) || CombatUtil.canBlock(card, true)); } else if (keyword.equals("First Strike")) { - if (card.getNetCombatDamage() + powerBonus <= 0 || card.hasKeyword(Keyword.DOUBLE_STRIKE) - || (!ComputerUtilCombat.canAttackNextTurn(card) && !CombatUtil.canBlock(card, true))) { - return false; - } + return card.getNetCombatDamage() + powerBonus > 0 && !card.hasKeyword(Keyword.DOUBLE_STRIKE) + && (ComputerUtilCombat.canAttackNextTurn(card) || CombatUtil.canBlock(card, true)); } else if (keyword.startsWith("Flanking")) { - if (card.getNetCombatDamage() + powerBonus <= 0 - || !ComputerUtilCombat.canAttackNextTurn(card) - || !canBeBlocked) { - return false; - } + return card.getNetCombatDamage() + powerBonus > 0 + && ComputerUtilCombat.canAttackNextTurn(card) + && canBeBlocked; } else if (keyword.startsWith("Bushido")) { - if ((!canBeBlocked || !ComputerUtilCombat.canAttackNextTurn(card)) - && !CombatUtil.canBlock(card, true)) { - return false; - } + return (canBeBlocked && ComputerUtilCombat.canAttackNextTurn(card)) + || CombatUtil.canBlock(card, true); } else if (keyword.equals("Trample")) { - if (card.getNetCombatDamage() + powerBonus <= 1 - || !canBeBlocked - || !ComputerUtilCombat.canAttackNextTurn(card)) { - return false; - } + return card.getNetCombatDamage() + powerBonus > 1 + && canBeBlocked + && ComputerUtilCombat.canAttackNextTurn(card); } else if (keyword.equals("Infect")) { - if (card.getNetCombatDamage() + powerBonus <= 0 - || !ComputerUtilCombat.canAttackNextTurn(card)) { - return false; - } + return card.getNetCombatDamage() + powerBonus > 0 + && ComputerUtilCombat.canAttackNextTurn(card); } else if (keyword.equals("Vigilance")) { - if (card.getNetCombatDamage() + powerBonus <= 0 - || !ComputerUtilCombat.canAttackNextTurn(card) - || !CombatUtil.canBlock(card, true)) { - return false; - } + return card.getNetCombatDamage() + powerBonus > 0 + && ComputerUtilCombat.canAttackNextTurn(card) + && CombatUtil.canBlock(card, true); } else if (keyword.equals("Reach")) { - if (card.hasKeyword(Keyword.FLYING) || !CombatUtil.canBlock(card, true)) { - return false; - } + return !card.hasKeyword(Keyword.FLYING) && CombatUtil.canBlock(card, true); } else if (keyword.endsWith("CARDNAME can block an additional creature each combat.")) { - if (!CombatUtil.canBlock(card, true) || card.hasKeyword("CARDNAME can block any number of creatures.") - || card.hasKeyword("CARDNAME can block an additional ninety-nine creatures each combat.")) { - return false; - } + return CombatUtil.canBlock(card, true) && !card.hasKeyword("CARDNAME can block any number of creatures.") + && !card.hasKeyword("CARDNAME can block an additional ninety-nine creatures each combat."); } else if (keyword.equals("CARDNAME can attack as though it didn't have defender.")) { - if (!card.hasKeyword(Keyword.DEFENDER) || card.getNetCombatDamage() + powerBonus <= 0) { - return false; - } + return card.hasKeyword(Keyword.DEFENDER) && card.getNetCombatDamage() + powerBonus > 0; } else if (keyword.equals("Shroud") || keyword.equals("Hexproof")) { - if (card.hasKeyword(Keyword.SHROUD) || card.hasKeyword(Keyword.HEXPROOF)) { - return false; - } - } else if (keyword.equals("Defender")) { - return false; - } - return true; + return !card.hasKeyword(Keyword.SHROUD) && !card.hasKeyword(Keyword.HEXPROOF); + } else return !keyword.equals("Defender"); } /** @@ -1657,17 +1620,11 @@ public class AttachAi extends SpellAbilityAi { if (keyword.endsWith("CARDNAME can't attack.") || keyword.equals("Defender") || keyword.endsWith("CARDNAME can't attack or block.")) { - if (!ComputerUtilCombat.canAttackNextTurn(card) || card.getNetCombatDamage() < 1) { - return false; - } + return ComputerUtilCombat.canAttackNextTurn(card) && card.getNetCombatDamage() >= 1; } else if (keyword.endsWith("CARDNAME attacks each turn if able.") || keyword.endsWith("CARDNAME attacks each combat if able.")) { - if (!ComputerUtilCombat.canAttackNextTurn(card) || !CombatUtil.canBlock(card, true) || ai.getCreaturesInPlay().isEmpty()) { - return false; - } + return ComputerUtilCombat.canAttackNextTurn(card) && CombatUtil.canBlock(card, true) && !ai.getCreaturesInPlay().isEmpty(); } else if (keyword.endsWith("CARDNAME can't block.") || keyword.contains("CantBlock")) { - if (!CombatUtil.canBlock(card, true)) { - return false; - } + return CombatUtil.canBlock(card, true); } else if (keyword.endsWith("CARDNAME's activated abilities can't be activated.")) { for (SpellAbility ability : card.getSpellAbilities()) { if (ability.isAbility()) { @@ -1676,18 +1633,12 @@ public class AttachAi extends SpellAbilityAi { } return false; } else if (keyword.endsWith("Prevent all combat damage that would be dealt by CARDNAME.")) { - if (!ComputerUtilCombat.canAttackNextTurn(card) || card.getNetCombatDamage() < 1) { - return false; - } + return ComputerUtilCombat.canAttackNextTurn(card) && card.getNetCombatDamage() >= 1; } else if (keyword.endsWith("Prevent all combat damage that would be dealt to and dealt by CARDNAME.") || keyword.endsWith("Prevent all damage that would be dealt to and dealt by CARDNAME.")) { - if (!ComputerUtilCombat.canAttackNextTurn(card) || card.getNetCombatDamage() < 2) { - return false; - } + return ComputerUtilCombat.canAttackNextTurn(card) && card.getNetCombatDamage() >= 2; } else if (keyword.endsWith("CARDNAME doesn't untap during your untap step.")) { - if (card.isUntapped()) { - return false; - } + return !card.isUntapped(); } return true; } @@ -1711,12 +1662,8 @@ public class AttachAi extends SpellAbilityAi { return true; } - if (sa.getHostCard().isEquipment() && ComputerUtilCard.isUselessCreature(ai, c)) { - // useless to equip a creature that can't attack or block. - return false; - } - - return true; + // useless to equip a creature that can't attack or block. + return !sa.getHostCard().isEquipment() || !ComputerUtilCard.isUselessCreature(ai, c); } public static Card doPumpOrCurseAILogic(final Player ai, final SpellAbility sa, final List list, final String type) { diff --git a/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAi.java b/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAi.java index a2906c96b88..93163475b87 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAi.java @@ -355,9 +355,7 @@ public class ChangeZoneAi extends SpellAbilityAi { @Override public boolean apply(final Card c) { if (c.getType().isLegendary()) { - if (ai.isCardInPlay(c.getName())) { - return false; - } + return !ai.isCardInPlay(c.getName()); } return true; } @@ -738,11 +736,7 @@ public class ChangeZoneAi extends SpellAbilityAi { } final AbilitySub subAb = sa.getSubAbility(); - if (subAb != null && !SpellApiToAi.Converter.get(subAb.getApi()).chkDrawbackWithSubs(ai, subAb)) { - return false; - } - - return true; + return subAb == null || SpellApiToAi.Converter.get(subAb.getApi()).chkDrawbackWithSubs(ai, subAb); } /* @@ -864,7 +858,7 @@ public class ChangeZoneAi extends SpellAbilityAi { list = CardLists.getTargetableCards(list, sa); // Filter AI-specific targets if provided - list = ComputerUtil.filterAITgts(sa, ai, (CardCollection)list, true); + list = ComputerUtil.filterAITgts(sa, ai, list, true); if (sa.hasParam("AITgtsOnlyBetterThanSelf")) { list = CardLists.filter(list, new Predicate() { @Override @@ -995,11 +989,7 @@ public class ChangeZoneAi extends SpellAbilityAi { @Override public boolean apply(final Card c) { for (Card aura : c.getEnchantedBy()) { - if (aura.getController().isOpponentOf(ai)) { - return true; - } else { - return false; - } + return aura.getController().isOpponentOf(ai); } if (blink) { return c.isToken(); @@ -1471,16 +1461,12 @@ public class ChangeZoneAi extends SpellAbilityAi { if (!list.isEmpty()) { final Card attachedTo = list.get(0); // This code is for the Dragon auras - if (attachedTo.getController().isOpponentOf(ai)) { - return false; - } + return !attachedTo.getController().isOpponentOf(ai); } } } else if (isPreferredTarget(ai, sa, mandatory, true)) { // do nothing - } else if (!isUnpreferredTarget(ai, sa, mandatory)) { - return false; - } + } else return isUnpreferredTarget(ai, sa, mandatory); return true; } @@ -1532,9 +1518,7 @@ public class ChangeZoneAi extends SpellAbilityAi { @Override public boolean apply(final Card c) { if (c.getType().isLegendary()) { - if (decider.isCardInPlay(c.getName())) { - return false; - } + return !decider.isCardInPlay(c.getName()); } return true; } @@ -1543,10 +1527,7 @@ public class ChangeZoneAi extends SpellAbilityAi { fetchList = CardLists.filter(fetchList, new Predicate() { @Override public boolean apply(final Card c) { - if (ComputerUtilCard.isCardRemAIDeck(c) || ComputerUtilCard.isCardRemRandomDeck(c)) { - return false; - } - return true; + return !ComputerUtilCard.isCardRemAIDeck(c) && !ComputerUtilCard.isCardRemRandomDeck(c); } }); } @@ -1718,9 +1699,7 @@ public class ChangeZoneAi extends SpellAbilityAi { @Override public boolean apply(final Card c) { if (c.getType().isLegendary()) { - if (ai.isCardInPlay(c.getName())) { - return false; - } + return !ai.isCardInPlay(c.getName()); } return true; } @@ -1826,20 +1805,16 @@ public class ChangeZoneAi extends SpellAbilityAi { && "Battlefield".equals(causeSub.getParam("Destination"))) { // A blink effect implemented using ChangeZone API return false; - } else if (subApi == ApiType.DelayedTrigger) { + } else // This is an intrinsic effect that blinks the card (e.g. Obzedat, Ghost Council), no need to + // return the commander to the Command zone. + if (subApi == ApiType.DelayedTrigger) { SpellAbility exec = causeSub.getAdditionalAbility("Execute"); if (exec != null && exec.getApi() == ApiType.ChangeZone) { - if ("Exile".equals(exec.getParam("Origin")) && "Battlefield".equals(exec.getParam("Destination"))) { - // A blink effect implemented using a delayed trigger - return false; - } + // A blink effect implemented using a delayed trigger + return !"Exile".equals(exec.getParam("Origin")) || !"Battlefield".equals(exec.getParam("Destination")); } - } else if (causeSa.getHostCard() != null && causeSa.getHostCard().equals((Card)sa.getReplacingObject("Card")) - && causeSa.getActivatingPlayer().equals(aiPlayer)) { - // This is an intrinsic effect that blinks the card (e.g. Obzedat, Ghost Council), no need to - // return the commander to the Command zone. - return false; - } + } else return causeSa.getHostCard() == null || !causeSa.getHostCard().equals(sa.getReplacingObject("Card")) + || !causeSa.getActivatingPlayer().equals(aiPlayer); } // Normally we want the commander back in Command zone to recast him later diff --git a/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAllAi.java b/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAllAi.java index c17506d37b2..fcf0733bf0d 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAllAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAllAi.java @@ -335,11 +335,8 @@ public class ChangeZoneAllAi extends SpellAbilityAi { return true; // if AI creature is better than Human Creature - if (ComputerUtilCard.evaluateCreatureList(aiCards) >= ComputerUtilCard - .evaluateCreatureList(humanCards)) { - return true; - } - return false; + return ComputerUtilCard.evaluateCreatureList(aiCards) >= ComputerUtilCard + .evaluateCreatureList(humanCards); } return true; } @@ -441,29 +438,21 @@ public class ChangeZoneAllAi extends SpellAbilityAi { if (sa.getParam("GainControl") != null) { // Check if the cards are valuable enough if ((CardLists.getNotType(humanType, "Creature").size() == 0) && (CardLists.getNotType(computerType, "Creature").size() == 0)) { - if ((ComputerUtilCard.evaluateCreatureList(computerType) + ComputerUtilCard - .evaluateCreatureList(humanType)) < 1) { - return false; - } + return (ComputerUtilCard.evaluateCreatureList(computerType) + ComputerUtilCard + .evaluateCreatureList(humanType)) >= 1; } // otherwise evaluate both lists by CMC and pass only if human // permanents are less valuable - else if ((ComputerUtilCard.evaluatePermanentList(computerType) + ComputerUtilCard - .evaluatePermanentList(humanType)) < 1) { - return false; - } + else return (ComputerUtilCard.evaluatePermanentList(computerType) + ComputerUtilCard + .evaluatePermanentList(humanType)) >= 1; } else { // don't activate if human gets more back than AI does if ((CardLists.getNotType(humanType, "Creature").isEmpty()) && (CardLists.getNotType(computerType, "Creature").isEmpty())) { - if (ComputerUtilCard.evaluateCreatureList(computerType) <= ComputerUtilCard - .evaluateCreatureList(humanType)) { - return false; - } + return ComputerUtilCard.evaluateCreatureList(computerType) > ComputerUtilCard + .evaluateCreatureList(humanType); } // otherwise evaluate both lists by CMC and pass only if human // permanents are less valuable - else if (ComputerUtilCard.evaluatePermanentList(computerType) <= ComputerUtilCard - .evaluatePermanentList(humanType)) { - return false; - } + else return ComputerUtilCard.evaluatePermanentList(computerType) > ComputerUtilCard + .evaluatePermanentList(humanType); } } diff --git a/forge-ai/src/main/java/forge/ai/ability/ChooseCardAi.java b/forge-ai/src/main/java/forge/ai/ability/ChooseCardAi.java index 6d0cee69a14..1beefd77b09 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ChooseCardAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ChooseCardAi.java @@ -71,21 +71,15 @@ public class ChooseCardAi extends SpellAbilityAi { choices = CardLists.filterControlledBy(choices, ai.getOpponents()); } if (aiLogic.equals("AtLeast1") || aiLogic.equals("OppPreferred")) { - if (choices.isEmpty()) { - return false; - } + return !choices.isEmpty(); } else if (aiLogic.equals("AtLeast2") || aiLogic.equals("BestBlocker")) { - if (choices.size() < 2) { - return false; - } + return choices.size() >= 2; } else if (aiLogic.equals("Clone") || aiLogic.equals("Vesuva")) { final String filter = aiLogic.equals("Clone") ? "Permanent.YouDontCtrl,Permanent.nonLegendary" : "Permanent.YouDontCtrl+notnamedVesuva,Permanent.nonLegendary+notnamedVesuva"; choices = CardLists.getValidCards(choices, filter, host.getController(), host); - if (choices.isEmpty()) { - return false; - } + return !choices.isEmpty(); } else if (aiLogic.equals("Never")) { return false; } else if (aiLogic.equals("NeedsPrevention")) { @@ -103,9 +97,7 @@ public class ChooseCardAi extends SpellAbilityAi { return ComputerUtilCombat.damageIfUnblocked(c, ai, combat, true) > ref; } }); - if (choices.isEmpty()) { - return false; - } + return !choices.isEmpty(); } else if (aiLogic.equals("Ashiok")) { final int loyalty = host.getCounters(CounterType.LOYALTY) - 1; for (int i = loyalty; i >= 0; i--) { @@ -117,13 +109,9 @@ public class ChooseCardAi extends SpellAbilityAi { } } - if (choices.isEmpty()) { - return false; - } + return !choices.isEmpty(); } else if (aiLogic.equals("RandomNonLand")) { - if (CardLists.getValidCards(choices, "Card.nonLand", host.getController(), host).isEmpty()) { - return false; - } + return !CardLists.getValidCards(choices, "Card.nonLand", host.getController(), host).isEmpty(); } else if (aiLogic.equals("Duneblast")) { CardCollection aiCreatures = ai.getCreaturesInPlay(); CardCollection oppCreatures = ai.getWeakestOpponent().getCreaturesInPlay(); @@ -139,10 +127,8 @@ public class ChooseCardAi extends SpellAbilityAi { aiCreatures.remove(chosen); int minGain = 200; - if ((ComputerUtilCard.evaluateCreatureList(aiCreatures) + minGain) >= ComputerUtilCard - .evaluateCreatureList(oppCreatures)) { - return false; - } + return (ComputerUtilCard.evaluateCreatureList(aiCreatures) + minGain) < ComputerUtilCard + .evaluateCreatureList(oppCreatures); } return true; } diff --git a/forge-ai/src/main/java/forge/ai/ability/ChooseColorAi.java b/forge-ai/src/main/java/forge/ai/ability/ChooseColorAi.java index 8ba40274dcd..2633899924b 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ChooseColorAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ChooseColorAi.java @@ -52,10 +52,7 @@ public class ChooseColorAi extends SpellAbilityAi { } if ("Addle".equals(sourceName)) { - if (ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS) || ai.getWeakestOpponent().getCardsIn(ZoneType.Hand).isEmpty()) { - return false; - } - return true; + return !ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS) && !ai.getWeakestOpponent().getCardsIn(ZoneType.Hand).isEmpty(); } if (logic.equals("MostExcessOpponentControls")) { diff --git a/forge-ai/src/main/java/forge/ai/ability/ChooseDirectionAi.java b/forge-ai/src/main/java/forge/ai/ability/ChooseDirectionAi.java index 3480f561d70..b3ae74d5274 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ChooseDirectionAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ChooseDirectionAi.java @@ -33,9 +33,7 @@ public class ChooseDirectionAi extends SpellAbilityAi { CardCollection right = CardLists.filterControlledBy(all, game.getNextPlayerAfter(ai, Direction.Right)); int leftValue = Aggregates.sum(left, CardPredicates.Accessors.fnGetCmc); int rightValue = Aggregates.sum(right, CardPredicates.Accessors.fnGetCmc); - if (aiValue > leftValue || aiValue > rightValue) { - return false; - } + return aiValue <= leftValue && aiValue <= rightValue; } } return true; diff --git a/forge-ai/src/main/java/forge/ai/ability/ChooseGenericEffectAi.java b/forge-ai/src/main/java/forge/ai/ability/ChooseGenericEffectAi.java index 2b608b2acbd..4ecfec696df 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ChooseGenericEffectAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ChooseGenericEffectAi.java @@ -385,9 +385,7 @@ public class ChooseGenericEffectAi extends SpellAbilityAi { final Player opp = player.getWeakestOpponent(); if (opp != null) { // TODO add predict Combat Damage? - if (opp.getLife() < copy.getNetPower()) { - return true; - } + return opp.getLife() < copy.getNetPower(); } // haste might not be good enough? diff --git a/forge-ai/src/main/java/forge/ai/ability/ChooseSourceAi.java b/forge-ai/src/main/java/forge/ai/ability/ChooseSourceAi.java index 3478e74b73b..f7a694e0c67 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ChooseSourceAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ChooseSourceAi.java @@ -97,10 +97,7 @@ public class ChooseSourceAi extends SpellAbilityAi { return false; } int dmg = AbilityUtils.calculateAmount(threatSource, topStack.getParam("NumDmg"), topStack); - if (ComputerUtilCombat.predictDamageTo(ai, dmg, threatSource, false) <= 0) { - return false; - } - return true; + return ComputerUtilCombat.predictDamageTo(ai, dmg, threatSource, false) > 0; } if (game.getPhaseHandler().getPhase() != PhaseType.COMBAT_DECLARE_BLOCKERS) { return false; @@ -119,9 +116,7 @@ public class ChooseSourceAi extends SpellAbilityAi { return ComputerUtilCombat.damageIfUnblocked(c, ai, combat, true) > 0; } }); - if (choices.isEmpty()) { - return false; - } + return !choices.isEmpty(); } } diff --git a/forge-ai/src/main/java/forge/ai/ability/CloneAi.java b/forge-ai/src/main/java/forge/ai/ability/CloneAi.java index 3f49d12fac9..3d6870d033d 100644 --- a/forge-ai/src/main/java/forge/ai/ability/CloneAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/CloneAi.java @@ -244,9 +244,6 @@ public class CloneAi extends SpellAbilityAi { } // don't activate during main2 unless this effect is permanent - if (ph.is(PhaseType.MAIN2) && !sa.hasParam("Permanent")) { - return false; - } - return true; + return !ph.is(PhaseType.MAIN2) || sa.hasParam("Permanent"); } } diff --git a/forge-ai/src/main/java/forge/ai/ability/ControlGainAi.java b/forge-ai/src/main/java/forge/ai/ability/ControlGainAi.java index eb6e3ed5d9b..630548b00bd 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ControlGainAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ControlGainAi.java @@ -84,9 +84,7 @@ public class ControlGainAi extends SpellAbilityAi { if (sa.hasParam("AllValid")) { CardCollectionView tgtCards = CardLists.filterControlledBy(game.getCardsIn(ZoneType.Battlefield), opponents); tgtCards = AbilityUtils.filterListByType(tgtCards, sa.getParam("AllValid"), sa); - if (tgtCards.isEmpty()) { - return false; - } + return !tgtCards.isEmpty(); } return true; } else { @@ -247,7 +245,7 @@ public class ControlGainAi extends SpellAbilityAi { break; } } - }; + } if (t != null) { sa.getTargets().add(t); @@ -296,15 +294,12 @@ public class ControlGainAi extends SpellAbilityAi { lose.addAll(Lists.newArrayList(sa.getParam("LoseControl").split(","))); } - if (lose.contains("EOT") - && game.getPhaseHandler().getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS)) { - return false; - } + return !lose.contains("EOT") + || !game.getPhaseHandler().getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS); } else { return this.canPlayAI(ai, sa); } - return true; } // pumpDrawbackAI() @Override diff --git a/forge-ai/src/main/java/forge/ai/ability/CountersMoveAi.java b/forge-ai/src/main/java/forge/ai/ability/CountersMoveAi.java index 34827a4a273..bf142184a33 100644 --- a/forge-ai/src/main/java/forge/ai/ability/CountersMoveAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/CountersMoveAi.java @@ -90,9 +90,7 @@ public class CountersMoveAi extends SpellAbilityAi { } // for Simic Fluxmage and other - if (!ph.getNextTurn().equals(ai) || ph.getPhase().isBefore(PhaseType.END_OF_TURN)) { - return false; - } + return ph.getNextTurn().equals(ai) && !ph.getPhase().isBefore(PhaseType.END_OF_TURN); } else if (CounterType.P1P1.equals(cType) && sa.hasParam("Defined")) { // something like Cyptoplast Root-kin @@ -107,9 +105,7 @@ public class CountersMoveAi extends SpellAbilityAi { } // Make sure that removing the last counter doesn't kill the creature if ("Self".equals(sa.getParam("Source"))) { - if (host != null && host.getNetToughness() - 1 <= 0) { - return false; - } + return host == null || host.getNetToughness() - 1 > 0; } } return true; @@ -193,9 +189,7 @@ public class CountersMoveAi extends SpellAbilityAi { // check for some specific AI preferences if ("DontMoveCounterIfLethal".equals(sa.getParam("AILogic"))) { - if (cType == CounterType.P1P1 && src.getNetToughness() - src.getTempToughnessBoost() - 1 <= 0) { - return false; - } + return cType != CounterType.P1P1 || src.getNetToughness() - src.getTempToughnessBoost() - 1 > 0; } } // no target @@ -207,9 +201,7 @@ public class CountersMoveAi extends SpellAbilityAi { public boolean chkAIDrawback(SpellAbility sa, Player ai) { if (sa.usesTargeting()) { sa.resetTargets(); - if (!moveTgtAI(ai, sa)) { - return false; - } + return moveTgtAI(ai, sa); } return true; @@ -287,10 +279,7 @@ public class CountersMoveAi extends SpellAbilityAi { // do not steal a P1P1 from Undying if it would die // this way if (CounterType.P1P1.equals(cType) && srcCardCpy.getNetToughness() <= 0) { - if (srcCardCpy.getCounters(cType) > 0 || !card.hasKeyword(Keyword.UNDYING) || card.isToken()) { - return true; - } - return false; + return srcCardCpy.getCounters(cType) > 0 || !card.hasKeyword(Keyword.UNDYING) || card.isToken(); } return true; } diff --git a/forge-ai/src/main/java/forge/ai/ability/CountersMultiplyAi.java b/forge-ai/src/main/java/forge/ai/ability/CountersMultiplyAi.java index 53b7c4b2619..b20e99ace3b 100644 --- a/forge-ai/src/main/java/forge/ai/ability/CountersMultiplyAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/CountersMultiplyAi.java @@ -48,6 +48,7 @@ public class CountersMultiplyAi extends SpellAbilityAi { if (!c.canReceiveCounters(counterType)) { return false; } + } else { for (Map.Entry e : c.getCounters().entrySet()) { // has negative counter it would double @@ -96,10 +97,7 @@ public class CountersMultiplyAi extends SpellAbilityAi { @Override protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) { - if (sa.usesTargeting() && !setTargets(ai, sa) && !mandatory) { - return false; - } - return true; + return !sa.usesTargeting() || setTargets(ai, sa) || mandatory; } private CounterType getCounterType(SpellAbility sa) { diff --git a/forge-ai/src/main/java/forge/ai/ability/CountersProliferateAi.java b/forge-ai/src/main/java/forge/ai/ability/CountersProliferateAi.java index f108106dce3..52538a0827c 100644 --- a/forge-ai/src/main/java/forge/ai/ability/CountersProliferateAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/CountersProliferateAi.java @@ -83,12 +83,9 @@ public class CountersProliferateAi extends SpellAbilityAi { } })); } - - if (cperms.isEmpty() && hperms.isEmpty() && !opponentPoison && !allyExpOrEnergy) { - return false; - } - return true; + + return !cperms.isEmpty() || !hperms.isEmpty() || opponentPoison || allyExpOrEnergy; } @Override diff --git a/forge-ai/src/main/java/forge/ai/ability/CountersPutAi.java b/forge-ai/src/main/java/forge/ai/ability/CountersPutAi.java index c636ea7b560..d139920d0a4 100644 --- a/forge-ai/src/main/java/forge/ai/ability/CountersPutAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/CountersPutAi.java @@ -469,7 +469,7 @@ public class CountersPutAi extends SpellAbilityAi { int left = amount; for (Card c : list) { if (ComputerUtilCard.shouldPumpCard(ai, sa, c, i, i, - Lists.newArrayList())) { + Lists.newArrayList())) { sa.getTargets().add(c); abTgt.addDividedAllocation(c, i); left -= i; @@ -506,7 +506,7 @@ public class CountersPutAi extends SpellAbilityAi { if (type.equals("P1P1") && !SpellAbilityAi.isSorcerySpeed(sa)) { for (Card c : list) { if (ComputerUtilCard.shouldPumpCard(ai, sa, c, amount, amount, - Lists.newArrayList())) { + Lists.newArrayList())) { choice = c; break; } @@ -595,7 +595,7 @@ public class CountersPutAi extends SpellAbilityAi { if (ComputerUtil.waitForBlocking(sa)) { return false; } - + return true; } diff --git a/forge-ai/src/main/java/forge/ai/ability/CountersRemoveAi.java b/forge-ai/src/main/java/forge/ai/ability/CountersRemoveAi.java index 4a2ab325af7..863e3b53c21 100644 --- a/forge-ai/src/main/java/forge/ai/ability/CountersRemoveAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/CountersRemoveAi.java @@ -101,7 +101,7 @@ public class CountersRemoveAi extends SpellAbilityAi { } // Filter AI-specific targets if provided - list = ComputerUtil.filterAITgts(sa, ai, (CardCollection)list, false); + list = ComputerUtil.filterAITgts(sa, ai, list, false); boolean noLegendary = game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule); diff --git a/forge-ai/src/main/java/forge/ai/ability/DamageAiBase.java b/forge-ai/src/main/java/forge/ai/ability/DamageAiBase.java index d894b2f7a79..fada6ed260e 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DamageAiBase.java +++ b/forge-ai/src/main/java/forge/ai/ability/DamageAiBase.java @@ -37,9 +37,7 @@ public abstract class DamageAiBase extends SpellAbilityAi { } if ("SelfDamage".equals(sa.getParam("AILogic"))) { if (comp.getLife() * 0.75 < enemy.getLife()) { - if (!lifelink) { - return true; - } + return !lifelink; } } return false; diff --git a/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java b/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java index f00dffe3205..f4af5ec56dc 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java @@ -80,10 +80,7 @@ public class DamageDealAi extends DamageAiBase { dmg--; // the card will be spent casting the spell, so actual damage is 1 less } } - if (!this.damageTargetAI(ai, sa, dmg, true)) { - return false; - } - return true; + return this.damageTargetAI(ai, sa, dmg, true); } @Override @@ -490,9 +487,7 @@ public class DamageDealAi extends DamageAiBase { for (final Object o : objects) { if (o instanceof Card) { final Card c = (Card) o; - if (hPlay.contains(c)) { - hPlay.remove(c); - } + hPlay.remove(c); } } hPlay = CardLists.getTargetableCards(hPlay, sa); @@ -952,9 +947,7 @@ public class DamageDealAi extends DamageAiBase { final TargetRestrictions tgt = sa.getTargetRestrictions(); if (tgt == null) { // If it's not mandatory check a few things - if (!mandatory && !this.damageChooseNontargeted(ai, sa, dmg)) { - return false; - } + return mandatory || this.damageChooseNontargeted(ai, sa, dmg); } else { if (!this.damageChoosingTargets(ai, sa, tgt, dmg, mandatory, true) && !mandatory) { return false; diff --git a/forge-ai/src/main/java/forge/ai/ability/DebuffAi.java b/forge-ai/src/main/java/forge/ai/ability/DebuffAi.java index ca3fae2f3a8..6f5047d533a 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DebuffAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DebuffAi.java @@ -124,7 +124,7 @@ public class DebuffAi extends SpellAbilityAi { final TargetRestrictions tgt = sa.getTargetRestrictions(); sa.resetTargets(); - CardCollection list = getCurseCreatures(ai, sa, kws == null ? Lists.newArrayList() : kws); + CardCollection list = getCurseCreatures(ai, sa, kws == null ? Lists.newArrayList() : kws); list = CardLists.getValidCards(list, tgt.getValidTgts(), sa.getActivatingPlayer(), sa.getHostCard(), sa); // several uses here: diff --git a/forge-ai/src/main/java/forge/ai/ability/DelayedTriggerAi.java b/forge-ai/src/main/java/forge/ai/ability/DelayedTriggerAi.java index cbe954cd663..c5b17785e61 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DelayedTriggerAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DelayedTriggerAi.java @@ -27,7 +27,7 @@ public class DelayedTriggerAi extends SpellAbilityAi { trigsa.setActivatingPlayer(ai); if (trigsa instanceof AbilitySub) { - return SpellApiToAi.Converter.get(((AbilitySub) trigsa).getApi()).chkDrawbackWithSubs(ai, (AbilitySub)trigsa); + return SpellApiToAi.Converter.get(trigsa.getApi()).chkDrawbackWithSubs(ai, (AbilitySub)trigsa); } else { return AiPlayDecision.WillPlay == ((PlayerControllerAi)ai.getController()).getAi().canPlaySa(trigsa); } diff --git a/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java b/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java index cede308bfc7..69c5bf22fc0 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java @@ -48,7 +48,7 @@ public class DestroyAi extends SpellAbilityAi { return false; } - hasXCost = abCost.getCostMana() != null ? abCost.getCostMana().getAmountOfX() > 0 : false; + hasXCost = abCost.getCostMana() != null && abCost.getCostMana().getAmountOfX() > 0; } if ("AtOpponentsCombatOrAfter".equals(sa.getParam("AILogic"))) { @@ -132,7 +132,7 @@ public class DestroyAi extends SpellAbilityAi { } // Filter AI-specific targets if provided - list = ComputerUtil.filterAITgts(sa, ai, (CardCollection)list, true); + list = ComputerUtil.filterAITgts(sa, ai, list, true); list = CardLists.getNotKeyword(list, Keyword.INDESTRUCTIBLE); if (CardLists.getNotType(list, "Creature").isEmpty()) { @@ -296,8 +296,8 @@ public class DestroyAi extends SpellAbilityAi { } if (list.isEmpty() - || !CardLists.filterControlledBy(list, ai).isEmpty() - || CardLists.getNotKeyword(list, Keyword.INDESTRUCTIBLE).isEmpty()) { + || !CardLists.filterControlledBy(list, ai).isEmpty() + || CardLists.getNotKeyword(list, Keyword.INDESTRUCTIBLE).isEmpty()) { return false; } } @@ -342,7 +342,7 @@ public class DestroyAi extends SpellAbilityAi { } // Filter AI-specific targets if provided - preferred = ComputerUtil.filterAITgts(sa, ai, (CardCollection)preferred, true); + preferred = ComputerUtil.filterAITgts(sa, ai, preferred, true); for (final Card c : preferred) { list.remove(c); @@ -400,16 +400,11 @@ public class DestroyAi extends SpellAbilityAi { } } - if (sa.getTargets().getNumTargeted() < tgt.getMinTargets(sa.getHostCard(), sa)) { - return false; - } + return sa.getTargets().getNumTargeted() >= tgt.getMinTargets(sa.getHostCard(), sa); } else { - if (!mandatory) { - return false; - } + return mandatory; } - return true; } public boolean doLandForLandRemovalLogic(SpellAbility sa, Player ai, Card tgtLand, String logic) { diff --git a/forge-ai/src/main/java/forge/ai/ability/DestroyAllAi.java b/forge-ai/src/main/java/forge/ai/ability/DestroyAllAi.java index 16d426c7f62..a84aa9d8643 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DestroyAllAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DestroyAllAi.java @@ -147,7 +147,7 @@ public class DestroyAllAi extends SpellAbilityAi { block.assignBlockersForCombat(combat); if (ComputerUtilCombat.lifeInSeriousDanger(ai, combat)) { - return true; + return true; } return false; } // only lands involved @@ -171,7 +171,6 @@ public class DestroyAllAi extends SpellAbilityAi { else if ((ComputerUtilCard.evaluatePermanentList(ailist) + 3) >= ComputerUtilCard.evaluatePermanentList(opplist)) { return false; } - return true; } } diff --git a/forge-ai/src/main/java/forge/ai/ability/DrainManaAi.java b/forge-ai/src/main/java/forge/ai/ability/DrainManaAi.java index f6745d73c39..fbb96a1dc91 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DrainManaAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DrainManaAi.java @@ -51,12 +51,9 @@ public class DrainManaAi extends SpellAbilityAi { } else { final List defined = AbilityUtils.getDefinedPlayers(source, sa.getParam("Defined"), sa); - if (!defined.contains(opp)) { - return false; - } + return defined.contains(opp); } - return true; } else { sa.resetTargets(); sa.getTargets().add(opp); diff --git a/forge-ai/src/main/java/forge/ai/ability/DrawAi.java b/forge-ai/src/main/java/forge/ai/ability/DrawAi.java index 094ebe558a1..212f0bbdab6 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DrawAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DrawAi.java @@ -69,7 +69,7 @@ public class DrawAi extends SpellAbilityAi { } if (!canLoot(ai, sa)) { - return false; + return false; } return true; } diff --git a/forge-ai/src/main/java/forge/ai/ability/EffectAi.java b/forge-ai/src/main/java/forge/ai/ability/EffectAi.java index 4b83190cc6f..92e8422c41c 100644 --- a/forge-ai/src/main/java/forge/ai/ability/EffectAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/EffectAi.java @@ -283,11 +283,7 @@ public class EffectAi extends SpellAbilityAi { return false; } final SpellAbility topStack = game.getStack().peekAbility(); - if (topStack.getActivatingPlayer().isOpponentOf(ai) && topStack.getApi() == ApiType.GainLife) { - return true; - } else { - return false; - } + return topStack.getActivatingPlayer().isOpponentOf(ai) && topStack.getApi() == ApiType.GainLife; } else if (logic.equals("Fight")) { return FightAi.canFightAi(ai, sa, 0, 0); } else if (logic.equals("Burn")) { @@ -301,11 +297,9 @@ public class EffectAi extends SpellAbilityAi { return false; } if (logic.contains(":")) { - String k[] = logic.split(":"); + String[] k = logic.split(":"); Integer i = Integer.valueOf(k[1]); - if (ai.getCreaturesInPlay().size() < i) { - return false; - } + return ai.getCreaturesInPlay().size() >= i; } return true; } else if (logic.equals("CastFromGraveThisTurn")) { diff --git a/forge-ai/src/main/java/forge/ai/ability/FightAi.java b/forge-ai/src/main/java/forge/ai/ability/FightAi.java index 8486fb0ab46..9a3b0965c42 100644 --- a/forge-ai/src/main/java/forge/ai/ability/FightAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/FightAi.java @@ -273,10 +273,10 @@ public class FightAi extends SpellAbilityAi { if (!canKill(opponent, fighter, -pumpDefense)) { // can survive return true; } else { - if (MyRandom.getRandom().nextInt(20)<(opponent.getCMC() - fighter.getCMC())) { // trade - return true; - } - } + if (MyRandom.getRandom().nextInt(20)<(opponent.getCMC() - fighter.getCMC())) { // trade + return true; + } + } } return false; } diff --git a/forge-ai/src/main/java/forge/ai/ability/FlipACoinAi.java b/forge-ai/src/main/java/forge/ai/ability/FlipACoinAi.java index 4792fbf0c05..7d61025c40d 100644 --- a/forge-ai/src/main/java/forge/ai/ability/FlipACoinAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/FlipACoinAi.java @@ -20,9 +20,9 @@ public class FlipACoinAi extends SpellAbilityAi { if (AILogic.equals("Never")) { return false; } else if (AILogic.equals("PhaseOut")) { - if (!ComputerUtil.predictThreatenedObjects(sa.getActivatingPlayer(), sa).contains(sa.getHostCard())) { + if (!ComputerUtil.predictThreatenedObjects(sa.getActivatingPlayer(), sa).contains(sa.getHostCard())) { return false; - } + } } else if (AILogic.equals("KillOrcs")) { if (ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.END_OF_TURN) ) { return false; diff --git a/forge-ai/src/main/java/forge/ai/ability/GameWinAi.java b/forge-ai/src/main/java/forge/ai/ability/GameWinAi.java index f5dd9e62318..9586916f190 100644 --- a/forge-ai/src/main/java/forge/ai/ability/GameWinAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/GameWinAi.java @@ -11,9 +11,7 @@ public class GameWinAi extends SpellAbilityAi { */ @Override protected boolean canPlayAI(Player ai, SpellAbility sa) { - if (ai.cantWin()) { - return false; - } + return !ai.cantWin(); // TODO Check conditions are met on card (e.g. Coalition Victory) @@ -21,7 +19,6 @@ public class GameWinAi extends SpellAbilityAi { // In general, don't return true. // But this card wins the game, I can make an exception for that - return true; } @Override diff --git a/forge-ai/src/main/java/forge/ai/ability/LifeGainAi.java b/forge-ai/src/main/java/forge/ai/ability/LifeGainAi.java index 353d84b606e..41751f85882 100644 --- a/forge-ai/src/main/java/forge/ai/ability/LifeGainAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/LifeGainAi.java @@ -106,13 +106,9 @@ public class LifeGainAi extends SpellAbilityAi { return false; } - if (!lifeCritical && !activateForCost - && (!ph.getNextTurn().equals(ai) || ph.getPhase().isBefore(PhaseType.END_OF_TURN)) - && !sa.hasParam("PlayerTurn") && !SpellAbilityAi.isSorcerySpeed(sa)) { - return false; - } - - return true; + return lifeCritical || activateForCost + || (ph.getNextTurn().equals(ai) && !ph.getPhase().isBefore(PhaseType.END_OF_TURN)) + || sa.hasParam("PlayerTurn") || SpellAbilityAi.isSorcerySpeed(sa); } /* @@ -304,9 +300,7 @@ public class LifeGainAi extends SpellAbilityAi { hasTgt = true; } } - if (!hasTgt) { - return false; - } + return hasTgt; } return true; } diff --git a/forge-ai/src/main/java/forge/ai/ability/LifeLoseAi.java b/forge-ai/src/main/java/forge/ai/ability/LifeLoseAi.java index 96fc5d4f195..087261271c2 100644 --- a/forge-ai/src/main/java/forge/ai/ability/LifeLoseAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/LifeLoseAi.java @@ -53,9 +53,7 @@ public class LifeLoseAi extends SpellAbilityAi { } if (sa.usesTargeting()) { - if (!doTgt(ai, sa, false)) { - return false; - } + return doTgt(ai, sa, false); } return true; @@ -187,12 +185,8 @@ public class LifeLoseAi extends SpellAbilityAi { ? new FCollection(sa.getTargets().getTargetPlayers()) : AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("Defined"), sa); - if (!mandatory && tgtPlayers.contains(ai) && amount > 0 && amount + 3 > ai.getLife()) { - // For cards like Foul Imp, ETB you lose life - return false; - } - - return true; + // For cards like Foul Imp, ETB you lose life + return mandatory || !tgtPlayers.contains(ai) || amount <= 0 || amount + 3 <= ai.getLife(); } protected boolean doTgt(Player ai, SpellAbility sa, boolean mandatory) { diff --git a/forge-ai/src/main/java/forge/ai/ability/ManaEffectAi.java b/forge-ai/src/main/java/forge/ai/ability/ManaEffectAi.java index 868f69fd185..60eaeef180f 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ManaEffectAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ManaEffectAi.java @@ -80,12 +80,9 @@ public class ManaEffectAi extends SpellAbilityAi { if (sa.hasParam("AILogic")) { return true; // handled elsewhere, does not meet the standard requirements } - - if (!(sa.getPayCosts() != null && sa.getPayCosts().hasNoManaCost() && sa.getPayCosts().isReusuableResource() - && sa.getSubAbility() == null && ComputerUtil.playImmediately(ai, sa))) { - return false; - } - return true; + + return sa.getPayCosts() != null && sa.getPayCosts().hasNoManaCost() && sa.getPayCosts().isReusuableResource() + && sa.getSubAbility() == null && ComputerUtil.playImmediately(ai, sa); // return super.checkApiLogic(ai, sa); } diff --git a/forge-ai/src/main/java/forge/ai/ability/ManifestAi.java b/forge-ai/src/main/java/forge/ai/ability/ManifestAi.java index 7adea756b2e..57e70f7fe58 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ManifestAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ManifestAi.java @@ -185,10 +185,7 @@ public class ManifestAi extends SpellAbilityAi { CardCollection filtered = CardLists.filter(options, new Predicate() { @Override public boolean apply(Card input) { - if (shouldManyfest(input, ai, sa)) { - return false; - } - return true; + return !shouldManyfest(input, ai, sa); } }); if (!filtered.isEmpty()) { diff --git a/forge-ai/src/main/java/forge/ai/ability/MillAi.java b/forge-ai/src/main/java/forge/ai/ability/MillAi.java index c975d894c29..3656226ee06 100644 --- a/forge-ai/src/main/java/forge/ai/ability/MillAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/MillAi.java @@ -31,19 +31,13 @@ public class MillAi extends SpellAbilityAi { PhaseHandler ph = ai.getGame().getPhaseHandler(); if (aiLogic.equals("Main1")) { - if (ph.getPhase().isBefore(PhaseType.MAIN2) && !sa.hasParam("ActivationPhases") - && !ComputerUtil.castSpellInMain1(ai, sa)) { - return false; - } + return !ph.getPhase().isBefore(PhaseType.MAIN2) || sa.hasParam("ActivationPhases") + || ComputerUtil.castSpellInMain1(ai, sa); } else if (aiLogic.equals("EndOfOppTurn")) { - if (!(ph.is(PhaseType.END_OF_TURN) && ph.getNextTurn().equals(ai))) { - return false; - } + return ph.is(PhaseType.END_OF_TURN) && ph.getNextTurn().equals(ai); } else if (aiLogic.equals("LilianaMill")) { // Only mill if a "Raise Dead" target is available, in case of control decks with few creatures - if (CardLists.filter(ai.getCardsIn(ZoneType.Graveyard), CardPredicates.Presets.CREATURES).size() < 1) { - return false; - } + return CardLists.filter(ai.getCardsIn(ZoneType.Graveyard), CardPredicates.Presets.CREATURES).size() >= 1; } return true; } @@ -62,11 +56,9 @@ public class MillAi extends SpellAbilityAi { } } if (sa.getHostCard().isCreature() && sa.getPayCosts().hasTapCost()) { - if (!(ph.is(PhaseType.END_OF_TURN) && ph.getNextTurn().equals(ai))) { - // creatures with a tap cost to mill (e.g. Doorkeeper) should be activated at the opponent's end step - // because they are also potentially useful for combat - return false; - } + // creatures with a tap cost to mill (e.g. Doorkeeper) should be activated at the opponent's end step + // because they are also potentially useful for combat + return ph.is(PhaseType.END_OF_TURN) && ph.getNextTurn().equals(ai); } return true; } @@ -100,9 +92,7 @@ public class MillAi extends SpellAbilityAi { // Set PayX here to maximum value. final int cardsToDiscard = getNumToDiscard(ai, sa); source.setSVar("PayX", Integer.toString(cardsToDiscard)); - if (cardsToDiscard <= 0) { - return false; - } + return cardsToDiscard > 0; } return true; } diff --git a/forge-ai/src/main/java/forge/ai/ability/PeekAndRevealAi.java b/forge-ai/src/main/java/forge/ai/ability/PeekAndRevealAi.java index 7a7c0bdb732..bd6dedc12ec 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PeekAndRevealAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PeekAndRevealAi.java @@ -24,10 +24,10 @@ public class PeekAndRevealAi extends SpellAbilityAi { return false; } if ("Main2".equals(sa.getParam("AILogic"))) { - if (aiPlayer.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2)) { - return false; - } - } + if (aiPlayer.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2)) { + return false; + } + } // So far this only appears on Triggers, but will expand // once things get converted from Dig + NoMove return true; diff --git a/forge-ai/src/main/java/forge/ai/ability/PermanentAi.java b/forge-ai/src/main/java/forge/ai/ability/PermanentAi.java index 14a3f8160c5..62012507864 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PermanentAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PermanentAi.java @@ -38,10 +38,7 @@ public class PermanentAi extends SpellAbilityAi { } // Wait for Main2 if possible - if (ph.is(PhaseType.MAIN1) && ph.isPlayerTurn(ai) && !ComputerUtil.castPermanentInMain1(ai, sa) && !sa.hasParam("WithoutManaCost")) { - return false; - } - return true; + return !ph.is(PhaseType.MAIN1) || !ph.isPlayerTurn(ai) || ComputerUtil.castPermanentInMain1(ai, sa) || sa.hasParam("WithoutManaCost"); } /** @@ -259,9 +256,7 @@ public class PermanentAi extends SpellAbilityAi { } } - if (dontCast) { - return false; - } + return !dontCast; } return true; diff --git a/forge-ai/src/main/java/forge/ai/ability/PermanentCreatureAi.java b/forge-ai/src/main/java/forge/ai/ability/PermanentCreatureAi.java index 1fa1a224098..fff79b466d4 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PermanentCreatureAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PermanentCreatureAi.java @@ -40,9 +40,7 @@ public class PermanentCreatureAi extends PermanentAi { ComputerUtilCard.applyStaticContPT(game, copy, null); - if (copy.getNetToughness() <= 0) { - return false; - } + return copy.getNetToughness() > 0; } return true; } @@ -225,13 +223,9 @@ public class PermanentCreatureAi extends PermanentAi { */ final Card copy = CardUtil.getLKICopy(sa.getHostCard()); ComputerUtilCard.applyStaticContPT(game, copy, null); - if (copy.getNetToughness() <= 0 && !copy.hasStartOfKeyword("etbCounter") && mana.countX() == 0 - && !copy.hasETBTrigger(false) && !copy.hasETBReplacement() && !copy.hasSVar("NoZeroToughnessAI")) { - // AiPlayDecision.WouldBecomeZeroToughnessCreature - return false; - } - - return true; + // AiPlayDecision.WouldBecomeZeroToughnessCreature + return copy.getNetToughness() > 0 || copy.hasStartOfKeyword("etbCounter") || mana.countX() != 0 + || copy.hasETBTrigger(false) || copy.hasETBReplacement() || copy.hasSVar("NoZeroToughnessAI"); } } diff --git a/forge-ai/src/main/java/forge/ai/ability/PermanentNoncreatureAi.java b/forge-ai/src/main/java/forge/ai/ability/PermanentNoncreatureAi.java index a4569fb1c2e..bd7db42f43f 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PermanentNoncreatureAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PermanentNoncreatureAi.java @@ -19,10 +19,7 @@ public class PermanentNoncreatureAi extends PermanentAi { @Override protected boolean checkAiLogic(final Player ai, final SpellAbility sa, final String aiLogic) { - if ("Never".equals(aiLogic) || "DontCast".equals(aiLogic)) { - return false; - } - return true; + return !"Never".equals(aiLogic) && !"DontCast".equals(aiLogic); } /** @@ -54,10 +51,8 @@ public class PermanentNoncreatureAi extends PermanentAi { // TODO: consider replacing the condition with host.hasSVar("OblivionRing") targets = CardLists.filterControlledBy(targets, ai.getOpponents()); } - if (targets.isEmpty()) { - // AiPlayDecision.AnotherTime - return false; - } + // AiPlayDecision.AnotherTime + return !targets.isEmpty(); } return true; } diff --git a/forge-ai/src/main/java/forge/ai/ability/PhasesAi.java b/forge-ai/src/main/java/forge/ai/ability/PhasesAi.java index dffcc09e823..ca9dcd4e57c 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PhasesAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PhasesAi.java @@ -33,9 +33,7 @@ public class PhasesAi extends SpellAbilityAi { if (tgtCards.contains(source)) { // Protect it from something final boolean isThreatened = ComputerUtil.predictThreatenedObjects(aiPlayer, null, true).contains(source); - if (isThreatened) { - return true; - } + return isThreatened; } else { // Card def = tgtCards.get(0); // Phase this out if it might attack me, or before it can be diff --git a/forge-ai/src/main/java/forge/ai/ability/PlayAi.java b/forge-ai/src/main/java/forge/ai/ability/PlayAi.java index f023a718fb1..96c22f1d519 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PlayAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PlayAi.java @@ -178,11 +178,7 @@ public class PlayAi extends SpellAbilityAi { // Before accepting, see if the spell has a valid number of targets (it should at this point). // Proceeding past this point if the spell is not correctly targeted will result // in "Failed to add to stack" error and the card disappearing from the game completely. - if (!spell.isTargetNumberValid()) { - return false; - } - - return true; + return spell.isTargetNumberValid(); } } return false; diff --git a/forge-ai/src/main/java/forge/ai/ability/PoisonAi.java b/forge-ai/src/main/java/forge/ai/ability/PoisonAi.java index a66326ac4e2..0eba3082f50 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PoisonAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PoisonAi.java @@ -24,11 +24,8 @@ public class PoisonAi extends SpellAbilityAi { */ @Override protected boolean checkPhaseRestrictions(final Player ai, final SpellAbility sa, final PhaseHandler ph) { - if (ph.getPhase().isBefore(PhaseType.MAIN2) - && !sa.hasParam("ActivationPhases")) { - return false; - } - return true; + return !ph.getPhase().isBefore(PhaseType.MAIN2) + || sa.hasParam("ActivationPhases"); } /* @@ -83,7 +80,6 @@ public class PoisonAi extends SpellAbilityAi { return false; } } - return true; } @@ -99,7 +95,6 @@ public class PoisonAi extends SpellAbilityAi { } else if (!input.canReceiveCounters(CounterType.POISON)) { return false; } - return true; } @@ -132,10 +127,7 @@ public class PoisonAi extends SpellAbilityAi { if (input.cantLose()) { return true; } - if (!input.canReceiveCounters(CounterType.POISON)) { - return true; - } - return false; + return !input.canReceiveCounters(CounterType.POISON); } }); diff --git a/forge-ai/src/main/java/forge/ai/ability/ProtectAi.java b/forge-ai/src/main/java/forge/ai/ability/ProtectAi.java index 513b8689a0c..13ed8ff2e51 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ProtectAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ProtectAi.java @@ -162,11 +162,8 @@ public class ProtectAi extends SpellAbilityAi { @Override protected boolean checkPhaseRestrictions(final Player ai, final SpellAbility sa, final PhaseHandler ph) { final boolean notAiMain1 = !(ph.getPlayerTurn() == ai && ph.getPhase() == PhaseType.MAIN1); - if (SpellAbilityAi.isSorcerySpeed(sa) && notAiMain1) { - // sorceries can only give protection in order to create an unblockable attacker - return false; - } - return true; + // sorceries can only give protection in order to create an unblockable attacker + return !SpellAbilityAi.isSorcerySpeed(sa) || !notAiMain1; } @Override @@ -177,9 +174,7 @@ public class ProtectAi extends SpellAbilityAi { return false; } else if (cards.size() == 1) { // Affecting single card - if ((getProtectCreatures(ai, sa)).contains(cards.get(0))) { - return true; - } + return (getProtectCreatures(ai, sa)).contains(cards.get(0)); } /* * when this happens we need to expand AI to consider if its ok diff --git a/forge-ai/src/main/java/forge/ai/ability/PumpAi.java b/forge-ai/src/main/java/forge/ai/ability/PumpAi.java index 3ab163edddc..d29e5c39c0d 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PumpAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PumpAi.java @@ -92,10 +92,7 @@ public class PumpAi extends PumpAiBase { return true; } - if (!ph.getNextTurn().equals(ai) || ph.getPhase().isBefore(PhaseType.END_OF_TURN)) { - return false; - } - return true; + return ph.getNextTurn().equals(ai) && !ph.getPhase().isBefore(PhaseType.END_OF_TURN); } else if (logic.equals("Aristocrat")) { final boolean isThreatened = ComputerUtil.predictThreatenedObjects(ai, null, true).contains(sa.getHostCard()); if (!ph.is(PhaseType.COMBAT_DECLARE_BLOCKERS) && !isThreatened) { @@ -121,9 +118,7 @@ public class PumpAi extends PumpAiBase { || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS))) { // Instant-speed pumps should not be cast outside of combat when the // stack is empty - if (!sa.isCurse() && !SpellAbilityAi.isSorcerySpeed(sa) && !main1Preferred) { - return false; - } + return sa.isCurse() || SpellAbilityAi.isSorcerySpeed(sa) || main1Preferred; } return true; } @@ -134,7 +129,7 @@ public class PumpAi extends PumpAiBase { final Card source = sa.getHostCard(); final String sourceName = ComputerUtilAbility.getAbilitySourceName(sa); final List keywords = sa.hasParam("KW") ? Arrays.asList(sa.getParam("KW").split(" & ")) - : Lists.newArrayList(); + : Lists.newArrayList(); final String numDefense = sa.hasParam("NumDef") ? sa.getParam("NumDef") : ""; final String numAttack = sa.hasParam("NumAtt") ? sa.getParam("NumAtt") : ""; @@ -191,11 +186,8 @@ public class PumpAi extends PumpAiBase { srcCardCpy.setCounters(cType, srcCardCpy.getCounters(cType) - amount); if (CounterType.P1P1.equals(cType) && srcCardCpy.getNetToughness() <= 0) { - if (srcCardCpy.getCounters(cType) > 0 || !card.hasKeyword(Keyword.UNDYING) - || card.isToken()) { - return true; - } - return false; + return srcCardCpy.getCounters(cType) > 0 || !card.hasKeyword(Keyword.UNDYING) + || card.isToken(); } return false; } @@ -244,11 +236,8 @@ public class PumpAi extends PumpAiBase { srcCardCpy.setCounters(cType, srcCardCpy.getCounters(cType) - amount); if (CounterType.P1P1.equals(cType) && srcCardCpy.getNetToughness() <= 0) { - if (srcCardCpy.getCounters(cType) > 0 || !card.hasKeyword(Keyword.UNDYING) - || card.isToken()) { - return true; - } - return false; + return srcCardCpy.getCounters(cType) > 0 || !card.hasKeyword(Keyword.UNDYING) + || card.isToken(); } return true; } @@ -395,9 +384,7 @@ public class PumpAi extends PumpAiBase { Card pumped = ComputerUtilCard.getPumpedCreature(ai, sa, card, 0, 0, keywords); if (game.getPhaseHandler().is(PhaseType.COMBAT_DECLARE_ATTACKERS, ai) || game.getPhaseHandler().is(PhaseType.COMBAT_BEGIN, ai)) { - if (!ComputerUtilCard.doesSpecifiedCreatureAttackAI(ai, pumped)) { - return false; - } + return ComputerUtilCard.doesSpecifiedCreatureAttackAI(ai, pumped); } return true; @@ -432,7 +419,7 @@ public class PumpAi extends PumpAiBase { private boolean pumpTgtAI(final Player ai, final SpellAbility sa, final int defense, final int attack, final boolean mandatory, boolean immediately) { final List keywords = sa.hasParam("KW") ? Arrays.asList(sa.getParam("KW").split(" & ")) - : Lists.newArrayList(); + : Lists.newArrayList(); final Game game = ai.getGame(); final Card source = sa.getHostCard(); final boolean isFight = "Fight".equals(sa.getParam("AILogic")) || "PowerDmg".equals(sa.getParam("AILogic")); @@ -555,7 +542,7 @@ public class PumpAi extends PumpAiBase { } // Filter AI-specific targets if provided - list = ComputerUtil.filterAITgts(sa, ai, (CardCollection)list, true); + list = ComputerUtil.filterAITgts(sa, ai, list, true); if (list.isEmpty()) { if (ComputerUtil.activateForCost(sa, ai)) { @@ -788,15 +775,11 @@ public class PumpAi extends PumpAiBase { if (!source.hasKeyword(Keyword.INDESTRUCTIBLE) && source.getNetToughness() + defense <= source.getDamage()) { return false; } - if (source.getNetToughness() + defense <= 0) { - return false; - } + return source.getNetToughness() + defense > 0; } } else { //Targeted - if (!pumpTgtAI(ai, sa, defense, attack, false, true)) { - return false; - } + return pumpTgtAI(ai, sa, defense, attack, false, true); } return true; @@ -849,9 +832,7 @@ public class PumpAi extends PumpAiBase { } } ); - if (sacFodder.size() >= numCreatsToSac) { - return true; - } + return sacFodder.size() >= numCreatsToSac; } } diff --git a/forge-ai/src/main/java/forge/ai/ability/PumpAiBase.java b/forge-ai/src/main/java/forge/ai/ability/PumpAiBase.java index 3ccc5b81605..3f178539be2 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PumpAiBase.java +++ b/forge-ai/src/main/java/forge/ai/ability/PumpAiBase.java @@ -56,24 +56,17 @@ public abstract class PumpAiBase extends SpellAbilityAi { if (!CardUtil.isStackingKeyword(keyword) && card.hasKeyword(keyword)) { return false; } else if (keyword.equals("Defender") || keyword.endsWith("CARDNAME can't attack.")) { - if (!ph.isPlayerTurn(card.getController()) || !CombatUtil.canAttack(card, ai) - || (card.getNetCombatDamage() <= 0) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS)) { - return false; - } + return ph.isPlayerTurn(card.getController()) && CombatUtil.canAttack(card, ai) + && (card.getNetCombatDamage() > 0) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS); } else if (keyword.endsWith("CARDNAME can't attack or block.")) { if (sa.hasParam("UntilYourNextTurn")) { - if (CombatUtil.canAttack(card, ai) || CombatUtil.canBlock(card, true)) { - return true; - } - return false; + return CombatUtil.canAttack(card, ai) || CombatUtil.canBlock(card, true); } if (!ph.isPlayerTurn(ai)) { - if (!CombatUtil.canAttack(card, ai) - || (card.getNetCombatDamage() <= 0) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS)) { - return false; - } + return CombatUtil.canAttack(card, ai) + && (card.getNetCombatDamage() > 0) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS); } else { if (ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS) || ph.getPhase().isBefore(PhaseType.MAIN1)) { @@ -90,9 +83,7 @@ public abstract class PumpAiBase extends SpellAbilityAi { return CombatUtil.canAttack(c, card.getController()) || (combat != null && combat.isAttacking(c)); } }); - if (!CombatUtil.canBlockAtLeastOne(card, attackers)) { - return false; - } + return CombatUtil.canBlockAtLeastOne(card, attackers); } } else if (keyword.endsWith("CARDNAME can't block.")) { if (!ph.isPlayerTurn(ai) || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS) @@ -112,24 +103,18 @@ public abstract class PumpAiBase extends SpellAbilityAi { && card.getController().equals(combat.getDefenderPlayerByAttacker(c))); } }); - if (!CombatUtil.canBlockAtLeastOne(card, attackers)) { - return false; - } + return CombatUtil.canBlockAtLeastOne(card, attackers); } else if (keyword.endsWith("CantBlockCardUIDSource")) { // can't block CARDNAME this turn if (!ph.isPlayerTurn(ai) || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS) || ph.getPhase().isBefore(PhaseType.MAIN1) || !CombatUtil.canBlock(sa.getHostCard(), card)) { return false; } // target needs to be a creature, controlled by the player which is attacked - if (sa.getHostCard().isTapped() && (combat == null || !combat.isAttacking(sa.getHostCard()) - || !card.getController().equals(combat.getDefenderPlayerByAttacker(sa.getHostCard())))) { - return false; - } + return !sa.getHostCard().isTapped() || (combat != null && combat.isAttacking(sa.getHostCard()) + && card.getController().equals(combat.getDefenderPlayerByAttacker(sa.getHostCard()))); } else if (keyword.endsWith("This card doesn't untap during your next untap step.")) { - if (ph.getPhase().isBefore(PhaseType.MAIN2) || card.isUntapped() || !ph.isPlayerTurn(ai) - || !Untap.canUntap(card)) { - return false; - } + return !ph.getPhase().isBefore(PhaseType.MAIN2) && !card.isUntapped() && ph.isPlayerTurn(ai) + && Untap.canUntap(card); } else if (keyword.endsWith("Prevent all combat damage that would be dealt by CARDNAME.") || keyword.endsWith("Prevent all damage that would be dealt by CARDNAME.")) { if (ph.isPlayerTurn(ai) && (!(CombatUtil.canBlock(card) || combat != null && combat.isBlocking(card)) @@ -139,28 +124,18 @@ public abstract class PumpAiBase extends SpellAbilityAi { || CardLists.getNotKeyword(ai.getCreaturesInPlay(), Keyword.DEFENDER).isEmpty())) { return false; } - if (!ph.isPlayerTurn(ai) && (combat == null || !combat.isAttacking(card) || card.getNetCombatDamage() <= 0)) { - return false; - } + return ph.isPlayerTurn(ai) || (combat != null && combat.isAttacking(card) && card.getNetCombatDamage() > 0); } else if (keyword.endsWith("CARDNAME attacks each turn if able.") || keyword.endsWith("CARDNAME attacks each combat if able.")) { - if (ph.isPlayerTurn(ai) || !CombatUtil.canAttack(card, ai) || !CombatUtil.canBeBlocked(card, ai) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS)) { - return false; - } + return !ph.isPlayerTurn(ai) && CombatUtil.canAttack(card, ai) && CombatUtil.canBeBlocked(card, ai) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS); } else if (keyword.endsWith("CARDNAME can't be regenerated.")) { if (card.getShieldCount() > 0) { return true; } - if (card.hasKeyword("If CARDNAME would be destroyed, regenerate it.") && combat != null - && (combat.isBlocked(card) || combat.isBlocking(card))) { - return true; - } - return false; - } else if (keyword.endsWith("CARDNAME's activated abilities can't be activated.")) { - return false; //too complex - } - return true; + return card.hasKeyword("If CARDNAME would be destroyed, regenerate it.") && combat != null + && (combat.isBlocked(card) || combat.isBlocking(card)); + } else return !keyword.endsWith("CARDNAME's activated abilities can't be activated."); //too complex } /** @@ -187,12 +162,10 @@ public abstract class PumpAiBase extends SpellAbilityAi { final boolean evasive = (keyword.endsWith("Unblockable") || keyword.endsWith("Shadow") || keyword.startsWith("CantBeBlockedBy")); // give evasive keywords to creatures that can or do attack if (evasive) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || newPower <= 0 - || CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && newPower > 0 + && !CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty(); } else if (keyword.endsWith("Flying")) { CardCollectionView attackingFlyer = CardCollection.EMPTY; if (combat != null) { @@ -221,13 +194,11 @@ public abstract class PumpAiBase extends SpellAbilityAi { } } } - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || newPower <= 0 - || !Iterables.any(CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)), - Predicates.not(flyingOrReach))) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && newPower > 0 + && Iterables.any(CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)), + Predicates.not(flyingOrReach)); } else if (keyword.endsWith("Horsemanship")) { if (ph.isPlayerTurn(opp) && ph.getPhase().equals(PhaseType.COMBAT_DECLARE_ATTACKERS) @@ -236,46 +207,35 @@ public abstract class PumpAiBase extends SpellAbilityAi { && ComputerUtilCombat.lifeInDanger(ai, game.getCombat())) { return true; } - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || newPower <= 0 - || CardLists.getNotKeyword(CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)), - Keyword.HORSEMANSHIP).isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && newPower > 0 + && !CardLists.getNotKeyword(CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)), + Keyword.HORSEMANSHIP).isEmpty(); } else if (keyword.endsWith("Intimidate")) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || newPower <= 0 - || CardLists.getNotType(CardLists.filter( - opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)), "Artifact").isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && newPower > 0 + && !CardLists.getNotType(CardLists.filter( + opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)), "Artifact").isEmpty(); } else if (keyword.endsWith("Fear")) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || newPower <= 0 - || CardLists.getNotColor(CardLists.getNotType(CardLists.filter( - opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)), "Artifact"), MagicColor.BLACK).isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && newPower > 0 + && !CardLists.getNotColor(CardLists.getNotType(CardLists.filter( + opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)), "Artifact"), MagicColor.BLACK).isEmpty(); } else if (keyword.endsWith("Haste")) { - if (!card.hasSickness() || ph.isPlayerTurn(opp) || card.isTapped() - || newPower <= 0 - || card.hasKeyword("CARDNAME can attack as though it had haste.") - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || !ComputerUtilCombat.canAttackNextTurn(card)) { - return false; - } + return card.hasSickness() && !ph.isPlayerTurn(opp) && !card.isTapped() + && newPower > 0 + && !card.hasKeyword("CARDNAME can attack as though it had haste.") + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && ComputerUtilCombat.canAttackNextTurn(card); } else if (keyword.endsWith("Indestructible")) { // Predicting threatened objects in relevant non-combat situations happens elsewhere, // so we are only worrying about combat relevance of Indestructible at this point. - if (combat == null - || !((combat.isBlocked(card) || combat.isBlocking(card)) - && ComputerUtilCombat.combatantWouldBeDestroyed(ai, card, combat))) { - return false; - } - return true; + return combat != null + && ((combat.isBlocked(card) || combat.isBlocking(card)) + && ComputerUtilCombat.combatantWouldBeDestroyed(ai, card, combat)); } else if (keyword.endsWith("Deathtouch")) { if (ph.isPlayerTurn(opp) && ph.getPhase().equals(PhaseType.COMBAT_DECLARE_ATTACKERS)) { List attackers = combat.getAttackers(); @@ -297,12 +257,10 @@ public abstract class PumpAiBase extends SpellAbilityAi { } return false; } else if (keyword.equals("Bushido")) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS) - || opp.getCreaturesInPlay().isEmpty() - || CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS) + && !opp.getCreaturesInPlay().isEmpty() + && !CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty(); } else if (keyword.equals("First Strike")) { if (card.hasKeyword(Keyword.DOUBLE_STRIKE)) { return false; @@ -321,40 +279,31 @@ public abstract class PumpAiBase extends SpellAbilityAi { if (!ComputerUtilCombat.canDestroyAttacker(ai, attacker, card, combat, true) && ComputerUtilCombat.canDestroyAttacker(ai, attacker, card, combat, false)) return true; - if (ComputerUtilCombat.canDestroyBlocker(ai, card, attacker, combat, true) - && !ComputerUtilCombat.canDestroyBlocker(ai, card, attacker, combat, false)) - return true; + return ComputerUtilCombat.canDestroyBlocker(ai, card, attacker, combat, true) + && !ComputerUtilCombat.canDestroyBlocker(ai, card, attacker, combat, false); } return false; } else if (keyword.equals("Double Strike")) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || newPower <= 0 - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS)) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && newPower > 0 + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS); } else if (keyword.startsWith("Rampage")) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || newPower <= 0 - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).size() < 2) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && newPower > 0 + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).size() >= 2; } else if (keyword.startsWith("Flanking")) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || newPower <= 0 - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || CardLists.getNotKeyword(CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)), - Keyword.FLANKING).isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && newPower > 0 + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && !CardLists.getNotKeyword(CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)), + Keyword.FLANKING).isEmpty(); } else if (keyword.startsWith("Trample")) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || !CombatUtil.canBeBlocked(card, opp) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || newPower <= 1 - || CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && CombatUtil.canBeBlocked(card, opp) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && newPower > 1 + && !CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty(); } else if (keyword.equals("Infect")) { if (newPower <= 0) { return false; @@ -362,11 +311,9 @@ public abstract class PumpAiBase extends SpellAbilityAi { if (combat != null && combat.isBlocking(card) && !card.hasKeyword(Keyword.WITHER)) { return true; } - if ((ph.isPlayerTurn(opp)) - || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS)) { - return false; - } + return (!ph.isPlayerTurn(opp)) + && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS); } else if (keyword.endsWith("Wither")) { if (newPower <= 0 || card.hasKeyword(Keyword.INFECT)) { return false; @@ -378,20 +325,16 @@ public abstract class PumpAiBase extends SpellAbilityAi { } return combat != null && ( combat.isAttacking(card) || combat.isBlocking(card) ); } else if (keyword.equals("Vigilance")) { - if (ph.isPlayerTurn(opp) || !CombatUtil.canAttack(card, opp) - || newPower <= 0 - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || CardLists.getNotKeyword(opp.getCreaturesInPlay(), Keyword.DEFENDER).isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && CombatUtil.canAttack(card, opp) + && newPower > 0 + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && !CardLists.getNotKeyword(opp.getCreaturesInPlay(), Keyword.DEFENDER).isEmpty(); } else if (keyword.equals("Reach")) { - if (ph.isPlayerTurn(ai) - || !ph.getPhase().equals(PhaseType.COMBAT_DECLARE_ATTACKERS) - || CardLists.getKeyword(game.getCombat().getAttackers(), Keyword.FLYING).isEmpty() - || card.hasKeyword(Keyword.FLYING) - || !CombatUtil.canBlock(card)) { - return false; - } + return !ph.isPlayerTurn(ai) + && ph.getPhase().equals(PhaseType.COMBAT_DECLARE_ATTACKERS) + && !CardLists.getKeyword(game.getCombat().getAttackers(), Keyword.FLYING).isEmpty() + && !card.hasKeyword(Keyword.FLYING) + && CombatUtil.canBlock(card); } else if (keyword.endsWith("CARDNAME can block an additional creature each combat.")) { if (ph.isPlayerTurn(ai) || !ph.getPhase().equals(PhaseType.COMBAT_DECLARE_ATTACKERS)) { @@ -407,63 +350,43 @@ public abstract class PumpAiBase extends SpellAbilityAi { } } } - if (possibleBlockNum <= canBlockNum) { - return false; - } + return possibleBlockNum > canBlockNum; } else if (keyword.equals("Shroud") || keyword.equals("Hexproof")) { - if (!ComputerUtil.predictThreatenedObjects(sa.getActivatingPlayer(), sa).contains(card)) { - return false; - } + return ComputerUtil.predictThreatenedObjects(sa.getActivatingPlayer(), sa).contains(card); } else if (keyword.equals("Persist")) { - if (card.getBaseToughness() <= 1 || card.hasKeyword(Keyword.UNDYING)) { - return false; - } + return card.getBaseToughness() > 1 && !card.hasKeyword(Keyword.UNDYING); } else if (keyword.equals("Islandwalk")) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || newPower <= 0 - || CardLists.getType(opp.getLandsInPlay(), "Island").isEmpty() - || CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && newPower > 0 + && !CardLists.getType(opp.getLandsInPlay(), "Island").isEmpty() + && !CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty(); } else if (keyword.equals("Swampwalk")) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || newPower <= 0 - || CardLists.getType(opp.getLandsInPlay(), "Swamp").isEmpty() - || CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && newPower > 0 + && !CardLists.getType(opp.getLandsInPlay(), "Swamp").isEmpty() + && !CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty(); } else if (keyword.equals("Mountainwalk")) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || newPower <= 0 - || CardLists.getType(opp.getLandsInPlay(), "Mountain").isEmpty() - || CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && newPower > 0 + && !CardLists.getType(opp.getLandsInPlay(), "Mountain").isEmpty() + && !CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty(); } else if (keyword.equals("Forestwalk")) { - if (ph.isPlayerTurn(opp) || !(CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) - || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) - || newPower <= 0 - || CardLists.getType(opp.getLandsInPlay(), "Forest").isEmpty() - || CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty()) { - return false; - } + return !ph.isPlayerTurn(opp) && (CombatUtil.canAttack(card, opp) || (combat != null && combat.isAttacking(card))) + && !ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) + && newPower > 0 + && !CardLists.getType(opp.getLandsInPlay(), "Forest").isEmpty() + && !CardLists.filter(opp.getCreaturesInPlay(), CardPredicates.possibleBlockers(card)).isEmpty(); } else if (keyword.endsWith("CARDNAME can attack as though it didn't have defender.")) { - if (!ph.isPlayerTurn(ai) || !card.hasKeyword(Keyword.DEFENDER) - || ph.getPhase().isAfter(PhaseType.COMBAT_BEGIN) - || card.isTapped() || newPower <= 0) { - return false; - } + return ph.isPlayerTurn(ai) && card.hasKeyword(Keyword.DEFENDER) + && !ph.getPhase().isAfter(PhaseType.COMBAT_BEGIN) + && !card.isTapped() && newPower > 0; } else if (keyword.equals("Prevent all combat damage that would be dealt to CARDNAME.")) { - if (combat == null || !(combat.isBlocking(card) || combat.isBlocked(card))) { - return false; - } + return combat != null && (combat.isBlocking(card) || combat.isBlocked(card)); } else if (keyword.equals("Menace")) { - if (combat == null || !combat.isAttacking(card)) { - return false; - } + return combat != null && combat.isAttacking(card); } return true; } @@ -547,10 +470,7 @@ public abstract class PumpAiBase extends SpellAbilityAi { return true; } //Don't waste a -7/-0 spell on a 1/1 creature - if (c.getNetPower() + attack > -2 || c.getNetPower() > 3) { - return true; - } - return false; + return c.getNetPower() + attack > -2 || c.getNetPower() > 3; } }); } else { diff --git a/forge-ai/src/main/java/forge/ai/ability/PumpAllAi.java b/forge-ai/src/main/java/forge/ai/ability/PumpAllAi.java index 7f03f31ddf4..9f1a6c7b159 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PumpAllAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PumpAllAi.java @@ -141,10 +141,7 @@ public class PumpAllAi extends PumpAiBase { // evaluate both lists and pass only if human creatures are more // valuable - if ((ComputerUtilCard.evaluateCreatureList(comp) + 200) >= ComputerUtilCard.evaluateCreatureList(human)) { - return false; - } - return true; + return (ComputerUtilCard.evaluateCreatureList(comp) + 200) < ComputerUtilCard.evaluateCreatureList(human); } // end Curse return !CardLists.getValidCards(getPumpCreatures(ai, sa, defense, power, keywords, false), valid, source.getController(), source).isEmpty(); diff --git a/forge-ai/src/main/java/forge/ai/ability/RemoveFromCombatAi.java b/forge-ai/src/main/java/forge/ai/ability/RemoveFromCombatAi.java index 6c498f1e764..5d1abd1e177 100644 --- a/forge-ai/src/main/java/forge/ai/ability/RemoveFromCombatAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/RemoveFromCombatAi.java @@ -18,9 +18,7 @@ public class RemoveFromCombatAi extends SpellAbilityAi { // AI should only activate this during Human's turn if ("RemoveBestAttacker".equals(sa.getParam("AILogic"))) { - if (aiPlayer.getGame().getCombat() != null && aiPlayer.getGame().getCombat().getDefenders().contains(aiPlayer)) { - return true; - } + return aiPlayer.getGame().getCombat() != null && aiPlayer.getGame().getCombat().getDefenders().contains(aiPlayer); } // TODO - implement AI diff --git a/forge-ai/src/main/java/forge/ai/ability/RepeatAi.java b/forge-ai/src/main/java/forge/ai/ability/RepeatAi.java index 08059c5cace..7a37733b284 100644 --- a/forge-ai/src/main/java/forge/ai/ability/RepeatAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/RepeatAi.java @@ -32,9 +32,7 @@ public class RepeatAi extends SpellAbilityAi { // Set PayX here to maximum value. final int max = ComputerUtilMana.determineLeftoverMana(sa, ai); source.setSVar("PayX", Integer.toString(max)); - if (max <= 0) { - return false; - } + return max > 0; } return true; } diff --git a/forge-ai/src/main/java/forge/ai/ability/RepeatEachAi.java b/forge-ai/src/main/java/forge/ai/ability/RepeatEachAi.java index 7ef2f78aef4..8ba1494b666 100644 --- a/forge-ai/src/main/java/forge/ai/ability/RepeatEachAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/RepeatEachAi.java @@ -35,9 +35,7 @@ public class RepeatEachAi extends SpellAbilityAi { List humTokenCreats = CardLists.filter(aiPlayer.getOpponents().getCreaturesInPlay(), Presets.TOKEN); List compTokenCreats = CardLists.filter(aiPlayer.getCreaturesInPlay(), Presets.TOKEN); - if (compTokenCreats.size() <= humTokenCreats.size()) { - return false; - } + return compTokenCreats.size() > humTokenCreats.size(); } else if ("BalanceLands".equals(logic)) { if (CardLists.filter(aiPlayer.getCardsIn(ZoneType.Battlefield), Presets.LANDS).size() >= 5) { return false; @@ -111,9 +109,7 @@ public class RepeatEachAi extends SpellAbilityAi { } } // would not hit oppoent, don't do that - if (!hitOpp) { - return false; - } + return hitOpp; } // TODO Add some normal AI variability here diff --git a/forge-ai/src/main/java/forge/ai/ability/RevealHandAi.java b/forge-ai/src/main/java/forge/ai/ability/RevealHandAi.java index 841a0cdedca..b2484c99f30 100644 --- a/forge-ai/src/main/java/forge/ai/ability/RevealHandAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/RevealHandAi.java @@ -30,11 +30,7 @@ public class RevealHandAi extends RevealAiBase { @Override protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) { - if (!revealHandTargetAI(ai, sa/*, false, mandatory*/)) { - return false; - } - - return true; + return revealHandTargetAI(ai, sa/*, false, mandatory*/); } } diff --git a/forge-ai/src/main/java/forge/ai/ability/RollPlanarDiceAi.java b/forge-ai/src/main/java/forge/ai/ability/RollPlanarDiceAi.java index 4dd60206601..09d3859a5c5 100644 --- a/forge-ai/src/main/java/forge/ai/ability/RollPlanarDiceAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/RollPlanarDiceAi.java @@ -144,7 +144,7 @@ public class RollPlanarDiceAi extends SpellAbilityAi { } } - return decideToRoll ? true : false; + return decideToRoll; } /* (non-Javadoc) diff --git a/forge-ai/src/main/java/forge/ai/ability/SacrificeAi.java b/forge-ai/src/main/java/forge/ai/ability/SacrificeAi.java index f5f1c587075..94e36b479da 100644 --- a/forge-ai/src/main/java/forge/ai/ability/SacrificeAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/SacrificeAi.java @@ -136,9 +136,7 @@ public class SacrificeAi extends SpellAbilityAi { // Since all of the cards have AI:RemoveDeck:All, I enabled 1 for 1 // (or X for X) trades for special decks - if (humanList.size() < amount) { - return false; - } + return humanList.size() >= amount; } else if (defined.equals("You")) { List computerList = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), valid.split(","), sa.getActivatingPlayer(), sa.getHostCard(), sa); diff --git a/forge-ai/src/main/java/forge/ai/ability/ScryAi.java b/forge-ai/src/main/java/forge/ai/ability/ScryAi.java index ea10f386b9e..cf01c1d8026 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ScryAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ScryAi.java @@ -145,10 +145,10 @@ public class ScryAi extends SpellAbilityAi { if (maxToRemove <= 0) { return false; } - sa.setSVar("ChosenX", "Number$" + Integer.toString(maxToRemove)); + sa.setSVar("ChosenX", "Number$" + maxToRemove); } else { // no Instant or Sorceries anymore, just scry - sa.setSVar("ChosenX", "Number$" + Integer.toString(Math.min(counterNum, libsize))); + sa.setSVar("ChosenX", "Number$" + Math.min(counterNum, libsize)); } } return true; diff --git a/forge-ai/src/main/java/forge/ai/ability/SetStateAi.java b/forge-ai/src/main/java/forge/ai/ability/SetStateAi.java index dc5c4f5e635..79104d062a6 100644 --- a/forge-ai/src/main/java/forge/ai/ability/SetStateAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/SetStateAi.java @@ -92,9 +92,7 @@ public class SetStateAi extends SpellAbilityAi { } } - if (sa.getTargets().getNumTargeted() < tgt.getMinTargets(source, sa)) { - return false; - } + return sa.getTargets().getNumTargeted() >= tgt.getMinTargets(source, sa); } } else if ("TurnFace".equals(mode)) { if (!sa.usesTargeting()) { @@ -123,9 +121,7 @@ public class SetStateAi extends SpellAbilityAi { } } - if (sa.getTargets().getNumTargeted() < tgt.getMinTargets(source, sa)) { - return false; - } + return sa.getTargets().getNumTargeted() >= tgt.getMinTargets(source, sa); } } return true; @@ -254,9 +250,7 @@ public class SetStateAi extends SpellAbilityAi { // for legendary KI counter creatures if (othercard.getCounters(CounterType.KI) >= source.getCounters(CounterType.KI)) { // if the other legendary is useless try to replace it - if (!ComputerUtilCard.isUselessCreature(aiPlayer, othercard)) { - return false; - } + return ComputerUtilCard.isUselessCreature(aiPlayer, othercard); } } } @@ -266,10 +260,6 @@ public class SetStateAi extends SpellAbilityAi { public boolean confirmAction(Player player, SpellAbility sa, PlayerActionConfirmMode mode, String message) { // TODO: improve the AI for when it may want to transform something that's optional to transform - if (!isSafeToTransformIntoLegendary(player, sa.getHostCard())) { - return false; - } - - return true; + return isSafeToTransformIntoLegendary(player, sa.getHostCard()); } } diff --git a/forge-ai/src/main/java/forge/ai/ability/SkipTurnAi.java b/forge-ai/src/main/java/forge/ai/ability/SkipTurnAi.java index 23f55ec9544..14cae9165fc 100644 --- a/forge-ai/src/main/java/forge/ai/ability/SkipTurnAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/SkipTurnAi.java @@ -11,10 +11,7 @@ public class SkipTurnAi extends SpellAbilityAi { */ @Override protected boolean canPlayAI(Player aiPlayer, SpellAbility sa) { - if ("Always".equals(sa.getParam("AILogic"))) { - return true; - } - return false; + return "Always".equals(sa.getParam("AILogic")); } /* (non-Javadoc) diff --git a/forge-ai/src/main/java/forge/ai/ability/SurveilAi.java b/forge-ai/src/main/java/forge/ai/ability/SurveilAi.java index 23069294e94..eb2beab480b 100644 --- a/forge-ai/src/main/java/forge/ai/ability/SurveilAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/SurveilAi.java @@ -76,9 +76,7 @@ public class SurveilAi extends SpellAbilityAi { if ("Never".equals(aiLogic)) { return false; } else if ("Once".equals(aiLogic)) { - if (AiCardMemory.isRememberedCard(ai, source, AiCardMemory.MemorySet.ACTIVATED_THIS_TURN)) { - return false; - } + return !AiCardMemory.isRememberedCard(ai, source, AiCardMemory.MemorySet.ACTIVATED_THIS_TURN); } // TODO: add card-specific Surveil AI logic here when/if necessary diff --git a/forge-ai/src/main/java/forge/ai/ability/TapAi.java b/forge-ai/src/main/java/forge/ai/ability/TapAi.java index 82b55dce044..a4eb933dbe4 100644 --- a/forge-ai/src/main/java/forge/ai/ability/TapAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/TapAi.java @@ -64,9 +64,7 @@ public class TapAi extends TapAiBase { bFlag |= c.isUntapped(); } - if (!bFlag) { - return false; - } + return bFlag; } else { if ("TapForXCounters".equals(sa.getParam("AILogic"))) { // e.g. Waxmane Baku @@ -83,12 +81,9 @@ public class TapAi extends TapAiBase { } sa.resetTargets(); - if (!tapPrefTargeting(ai, source, tgt, sa, false)) { - return false; - } + return tapPrefTargeting(ai, source, tgt, sa, false); } - return true; } } diff --git a/forge-ai/src/main/java/forge/ai/ability/TapAiBase.java b/forge-ai/src/main/java/forge/ai/ability/TapAiBase.java index 77f83383db6..6a408821cbe 100644 --- a/forge-ai/src/main/java/forge/ai/ability/TapAiBase.java +++ b/forge-ai/src/main/java/forge/ai/ability/TapAiBase.java @@ -248,12 +248,8 @@ public abstract class TapAiBase extends SpellAbilityAi { sa.getTargets().add(choice); } - if (sa.getTargets().getNumTargeted() == 0) { - // Nothing was ever targeted, so we need to bail. - return false; - } - - return true; + // Nothing was ever targeted, so we need to bail. + return sa.getTargets().getNumTargeted() != 0; } /** @@ -307,11 +303,7 @@ public abstract class TapAiBase extends SpellAbilityAi { // just tap whatever we can tapList = list; - if (tapTargetList(ai, sa, tapList, mandatory)) { - return true; - } - - return false; + return tapTargetList(ai, sa, tapList, mandatory); } @Override diff --git a/forge-ai/src/main/java/forge/ai/ability/TapAllAi.java b/forge-ai/src/main/java/forge/ai/ability/TapAllAi.java index baf1842e4e0..8361e437dcd 100644 --- a/forge-ai/src/main/java/forge/ai/ability/TapAllAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/TapAllAi.java @@ -93,9 +93,7 @@ public class TapAllAi extends SpellAbilityAi { return CombatUtil.canAttack(c) && ComputerUtilCombat.canAttackNextTurn(c); } }); - if(!any) { - return false; - } + return any; } return true; } diff --git a/forge-ai/src/main/java/forge/ai/ability/TokenAi.java b/forge-ai/src/main/java/forge/ai/ability/TokenAi.java index cee492ffb3c..6704b41e46b 100644 --- a/forge-ai/src/main/java/forge/ai/ability/TokenAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/TokenAi.java @@ -103,12 +103,9 @@ public class TokenAi extends SpellAbilityAi { if (actualToken == null) { final AbilitySub sub = sa.getSubAbility(); - if (pwPlus || (sub != null && SpellApiToAi.Converter.get(sub.getApi()).chkAIDrawback(sub, ai))) { - return true; // planeswalker plus ability or sub-ability is - // useful - } else { - return false; // no token created - } + // useful + // no token created + return pwPlus || (sub != null && SpellApiToAi.Converter.get(sub.getApi()).chkAIDrawback(sub, ai)); // planeswalker plus ability or sub-ability is } // X-cost spells @@ -154,10 +151,7 @@ public class TokenAi extends SpellAbilityAi { && !haste && !pwMinus) { return false; } - if ((ph.getPhase().isAfter(PhaseType.COMBAT_BEGIN) || !ph.isPlayerTurn(ai)) && oneShot) { - return false; - } - return true; + return (!ph.getPhase().isAfter(PhaseType.COMBAT_BEGIN) && ph.isPlayerTurn(ai)) || !oneShot; } @Override @@ -269,10 +263,8 @@ public class TokenAi extends SpellAbilityAi { list.add(token); list = CardLists.getValidCards(list, valid.split(","), ai.getWeakestOpponent(), topStack.getHostCard(), sa); list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(topStack)); - if (ComputerUtilCard.evaluateCreature(token) < ComputerUtilCard.evaluateCreature(list.get(0)) - && list.contains(token)) { - return true; - } + return ComputerUtilCard.evaluateCreature(token) < ComputerUtilCard.evaluateCreature(list.get(0)) + && list.contains(token); } return false; } diff --git a/forge-ai/src/main/java/forge/ai/ability/UnattachAllAi.java b/forge-ai/src/main/java/forge/ai/ability/UnattachAllAi.java index 6b7ad4eefbe..4f3292f58d4 100644 --- a/forge-ai/src/main/java/forge/ai/ability/UnattachAllAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/UnattachAllAi.java @@ -82,9 +82,7 @@ public class UnattachAllAi extends SpellAbilityAi { //don't equip a worse creature if (card.isEquipping()) { Card oldTarget = card.getEquipping(); - if (ComputerUtilCard.evaluateCreature(oldTarget) > ComputerUtilCard.evaluateCreature(newTarget)) { - return false; - } + return ComputerUtilCard.evaluateCreature(oldTarget) <= ComputerUtilCard.evaluateCreature(newTarget); } } diff --git a/forge-ai/src/main/java/forge/ai/ability/UntapAi.java b/forge-ai/src/main/java/forge/ai/ability/UntapAi.java index 48884ee524f..5e2659fdacc 100644 --- a/forge-ai/src/main/java/forge/ai/ability/UntapAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/UntapAi.java @@ -45,11 +45,7 @@ public class UntapAi extends SpellAbilityAi { return false; } - if (!ComputerUtilCost.checkDiscardCost(ai, cost, sa.getHostCard())) { - return false; - } - - return true; + return ComputerUtilCost.checkDiscardCost(ai, cost, sa.getHostCard()); } @Override @@ -63,16 +59,11 @@ public class UntapAi extends SpellAbilityAi { if (tgt == null) { final List pDefined = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa); - if (pDefined != null && pDefined.get(0).isUntapped() && pDefined.get(0).getController() == ai) { - return false; - } + return pDefined == null || !pDefined.get(0).isUntapped() || pDefined.get(0).getController() != ai; } else { - if (!untapPrefTargeting(ai, tgt, sa, false)) { - return false; - } + return untapPrefTargeting(ai, tgt, sa, false); } - return true; } @Override @@ -86,11 +77,7 @@ public class UntapAi extends SpellAbilityAi { // TODO: use Defined to determine, if this is an unfavorable result final List pDefined = AbilityUtils.getDefinedCards(sa.getHostCard(), sa.getParam("Defined"), sa); - if (pDefined != null && pDefined.get(0).isUntapped() && pDefined.get(0).getController() == ai) { - return false; - } - - return true; + return pDefined == null || !pDefined.get(0).isUntapped() || pDefined.get(0).getController() != ai; } else { if (untapPrefTargeting(ai, tgt, sa, mandatory)) { return true; @@ -271,11 +258,7 @@ public class UntapAi extends SpellAbilityAi { // just tap whatever we can tapList = list; - if (untapTargetList(source, tgt, sa, mandatory, tapList)) { - return true; - } - - return false; + return untapTargetList(source, tgt, sa, mandatory, tapList); } private boolean untapTargetList(final Card source, final TargetRestrictions tgt, final SpellAbility sa, final boolean mandatory, @@ -438,13 +421,10 @@ public class UntapAi extends SpellAbilityAi { // no harm in doing this past declare blockers during the opponent's turn and right before our turn, // maybe we'll serendipitously untap into something like a removal spell or burn spell that'll help - if (ph.getNextTurn() == ai - && (ph.is(PhaseType.COMBAT_DECLARE_BLOCKERS) || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS))) { - return true; - } + return ph.getNextTurn() == ai + && (ph.is(PhaseType.COMBAT_DECLARE_BLOCKERS) || ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS)); // haven't found any immediate playable options - return false; } } diff --git a/forge-ai/src/main/java/forge/ai/simulation/GameCopier.java b/forge-ai/src/main/java/forge/ai/simulation/GameCopier.java index b04ba570a51..8cd20c54a26 100644 --- a/forge-ai/src/main/java/forge/ai/simulation/GameCopier.java +++ b/forge-ai/src/main/java/forge/ai/simulation/GameCopier.java @@ -277,10 +277,7 @@ public class GameCopier { // TODO: Copy the full list with timestamps. newCard.addNewPT(setPower, setToughness, newGame.getNextTimestamp()); } - newCard.addTempPowerBoost(c.getTempPowerBoost()); - newCard.setSemiPermanentPowerBoost(c.getSemiPermanentPowerBoost()); - newCard.addTempToughnessBoost(c.getTempToughnessBoost()); - newCard.setSemiPermanentToughnessBoost(c.getSemiPermanentToughnessBoost()); + newCard.setPTBoost(c.getPTBoostMap()); newCard.setDamage(c.getDamage()); newCard.setChangedCardTypes(c.getChangedCardTypesMap()); diff --git a/forge-ai/src/main/java/forge/ai/simulation/GameStateEvaluator.java b/forge-ai/src/main/java/forge/ai/simulation/GameStateEvaluator.java index e32de189652..3ee4521d4ba 100644 --- a/forge-ai/src/main/java/forge/ai/simulation/GameStateEvaluator.java +++ b/forge-ai/src/main/java/forge/ai/simulation/GameStateEvaluator.java @@ -161,17 +161,6 @@ public class GameStateEvaluator { } return super.addValue(value, text); } - - @Override - protected int getEffectivePower(final Card c) { - Card.StatBreakdown breakdown = c.getNetCombatDamageBreakdown(); - return breakdown.getTotal() - breakdown.tempBoost; - } - @Override - protected int getEffectiveToughness(final Card c) { - Card.StatBreakdown breakdown = c.getNetToughnessBreakdown(); - return breakdown.getTotal() - breakdown.tempBoost; - } } public static class Score { diff --git a/forge-ai/src/main/java/forge/ai/simulation/PossibleTargetSelector.java b/forge-ai/src/main/java/forge/ai/simulation/PossibleTargetSelector.java index fcaf0ad073f..3aa48b72945 100644 --- a/forge-ai/src/main/java/forge/ai/simulation/PossibleTargetSelector.java +++ b/forge-ai/src/main/java/forge/ai/simulation/PossibleTargetSelector.java @@ -80,7 +80,7 @@ public class PossibleTargetSelector { } private static class SimilarTargetSkipper { - private ArrayListMultimap validTargetsMap = ArrayListMultimap.create(); + private ArrayListMultimap validTargetsMap = ArrayListMultimap.create(); private HashMap cardTypeStrings = new HashMap(); private HashMap creatureScores; diff --git a/forge-ai/src/main/java/forge/ai/simulation/SpellAbilityChoicesIterator.java b/forge-ai/src/main/java/forge/ai/simulation/SpellAbilityChoicesIterator.java index 75225c73cab..36fbde8d365 100644 --- a/forge-ai/src/main/java/forge/ai/simulation/SpellAbilityChoicesIterator.java +++ b/forge-ai/src/main/java/forge/ai/simulation/SpellAbilityChoicesIterator.java @@ -49,7 +49,7 @@ public class SpellAbilityChoicesIterator { // TODO: Do we need to do something special to support cards that have extra costs // when choosing more modes, like Blessed Alliance? if (!allowRepeat) { - modeIterator = CombinatoricsUtils.combinationsIterator(choices.size(), num);; + modeIterator = CombinatoricsUtils.combinationsIterator(choices.size(), num); } else { // Note: When allowRepeat is true, it does result in many possibilities being tried. // We should ideally prune some of those at a higher level. diff --git a/forge-ai/src/main/java/forge/ai/simulation/SpellAbilityPicker.java b/forge-ai/src/main/java/forge/ai/simulation/SpellAbilityPicker.java index a14f2b94047..f6c9eec8dfa 100644 --- a/forge-ai/src/main/java/forge/ai/simulation/SpellAbilityPicker.java +++ b/forge-ai/src/main/java/forge/ai/simulation/SpellAbilityPicker.java @@ -308,9 +308,7 @@ public class SpellAbilityPicker { return true; } List phases = conditions.getPhases(); - if (phases.isEmpty() || phases.contains(PhaseType.MAIN1)) { - return true; - } + return phases.isEmpty() || phases.contains(PhaseType.MAIN1); } return false; diff --git a/forge-core/pom.xml b/forge-core/pom.xml index 6d1913363d1..de96bebf9b6 100644 --- a/forge-core/pom.xml +++ b/forge-core/pom.xml @@ -6,7 +6,7 @@ forge forge - 1.6.28-SNAPSHOT + 1.6.29-SNAPSHOT forge-core diff --git a/forge-core/src/main/java/forge/CardStorageReader.java b/forge-core/src/main/java/forge/CardStorageReader.java index 92b30bce7ac..02e4d414277 100644 --- a/forge-core/src/main/java/forge/CardStorageReader.java +++ b/forge-core/src/main/java/forge/CardStorageReader.java @@ -64,7 +64,7 @@ public class CardStorageReader { void report(int current, int total); // does nothing, used when they pass null instead of an instance - public final static ProgressObserver emptyObserver = new ProgressObserver() { + ProgressObserver emptyObserver = new ProgressObserver() { @Override public void setOperationName(final String name, final boolean usePercents) {} @Override public void report(final int current, final int total) {} }; diff --git a/forge-core/src/main/java/forge/ImageKeys.java b/forge-core/src/main/java/forge/ImageKeys.java index bd2c20ed0b5..3e5192ba642 100644 --- a/forge-core/src/main/java/forge/ImageKeys.java +++ b/forge-core/src/main/java/forge/ImageKeys.java @@ -123,7 +123,7 @@ public final class ImageKeys { int index = filename.lastIndexOf('_'); if (index != -1) { String setlessFilename = filename.substring(0, index); - String setCode = filename.substring(index + 1, filename.length()); + String setCode = filename.substring(index + 1); // try with upper case set file = findFile(dir, setlessFilename + "_" + setCode.toUpperCase()); if (file != null) { return file; } diff --git a/forge-core/src/main/java/forge/card/CardDb.java b/forge-core/src/main/java/forge/card/CardDb.java index 0c4071e4cf4..0b157f26ac2 100644 --- a/forge-core/src/main/java/forge/card/CardDb.java +++ b/forge-core/src/main/java/forge/card/CardDb.java @@ -41,7 +41,7 @@ public final class CardDb implements ICardDatabase, IDeckGenPool { public final static char NameSetSeparator = '|'; // need this to obtain cardReference by name+set+artindex - private final ListMultimap allCardsByName = Multimaps.newListMultimap(new TreeMap>(String.CASE_INSENSITIVE_ORDER), CollectionSuppliers.arrayLists()); + private final ListMultimap allCardsByName = Multimaps.newListMultimap(new TreeMap>(String.CASE_INSENSITIVE_ORDER), CollectionSuppliers.arrayLists()); private final Map uniqueCardsByName = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER); private final Map rulesByName; private final Map facesByName = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER); @@ -62,7 +62,7 @@ public final class CardDb implements ICardDatabase, IDeckGenPool { Random(false); final boolean filterSets; - private SetPreference(boolean filterIrregularSets) { + SetPreference(boolean filterIrregularSets) { filterSets = filterIrregularSets; } diff --git a/forge-core/src/main/java/forge/card/CardEdition.java b/forge-core/src/main/java/forge/card/CardEdition.java index 86653eb178b..b9b88687d97 100644 --- a/forge-core/src/main/java/forge/card/CardEdition.java +++ b/forge-core/src/main/java/forge/card/CardEdition.java @@ -189,7 +189,7 @@ public final class CardEdition implements Comparable { // immutable public String getBoosterMustContain() { return boosterMustContain; } public CardInSet[] getCards() { return cards; } - public Map getTokens() { return tokenNormalized; }; + public Map getTokens() { return tokenNormalized; } public static final Function FN_GET_CODE = new Function() { @Override diff --git a/forge-core/src/main/java/forge/card/CardFace.java b/forge-core/src/main/java/forge/card/CardFace.java index 001f2eff18d..3e7afb2858b 100644 --- a/forge-core/src/main/java/forge/card/CardFace.java +++ b/forge-core/src/main/java/forge/card/CardFace.java @@ -20,7 +20,7 @@ final class CardFace implements ICardFace { public enum FaceSelectionMethod { // USE_ACTIVE_FACE, USE_PRIMARY_FACE, - COMBINE; + COMBINE } @@ -87,7 +87,7 @@ final class CardFace implements ICardFace { void setInitialLoyalty(String value) { this.initialLoyalty = value; } void setPtText(String value) { - final String k[] = value.split("/"); + final String[] k = value.split("/"); if (k.length != 2) { throw new RuntimeException("Creature '" + this.getName() + "' has bad p/t stats"); diff --git a/forge-core/src/main/java/forge/card/CardFacePredicates.java b/forge-core/src/main/java/forge/card/CardFacePredicates.java index ee83dda3787..e2b4d2a5815 100644 --- a/forge-core/src/main/java/forge/card/CardFacePredicates.java +++ b/forge-core/src/main/java/forge/card/CardFacePredicates.java @@ -85,7 +85,7 @@ public final class CardFacePredicates { @Override public boolean apply(ICardFace input) { - String k[] = valid.split("\\.", 2); + String[] k = valid.split("\\.", 2); if ("Card".equals(k[0])) { // okay @@ -110,10 +110,7 @@ public final class CardFacePredicates { static protected boolean hasProperty(ICardFace input, final String v) { if (v.startsWith("non")) { return !hasProperty(input, v.substring(3)); - } else if (!input.getType().hasStringType(v)) { - return false; - } - return true; + } else return input.getType().hasStringType(v); } } diff --git a/forge-core/src/main/java/forge/card/CardRarity.java b/forge-core/src/main/java/forge/card/CardRarity.java index 7ed13dda93c..b6f1f898067 100644 --- a/forge-core/src/main/java/forge/card/CardRarity.java +++ b/forge-core/src/main/java/forge/card/CardRarity.java @@ -35,7 +35,7 @@ public enum CardRarity { private final String shortName, longName; - private CardRarity(final String shortName0, final String longName0) { + CardRarity(final String shortName0, final String longName0) { shortName = shortName0; longName = longName0; } diff --git a/forge-core/src/main/java/forge/card/CardRulesPredicates.java b/forge-core/src/main/java/forge/card/CardRulesPredicates.java index e6b200b1a94..4748c821013 100644 --- a/forge-core/src/main/java/forge/card/CardRulesPredicates.java +++ b/forge-core/src/main/java/forge/card/CardRulesPredicates.java @@ -435,10 +435,10 @@ public final class CardRulesPredicates { return this.op(card.getManaCost().getGenericCost(), this.operand); case POWER: value = card.getIntPower(); - return value != Integer.MAX_VALUE ? this.op(value, this.operand) : false; + return value != Integer.MAX_VALUE && this.op(value, this.operand); case TOUGHNESS: value = card.getIntToughness(); - return value != Integer.MAX_VALUE ? this.op(value, this.operand) : false; + return value != Integer.MAX_VALUE && this.op(value, this.operand); default: return false; } diff --git a/forge-core/src/main/java/forge/card/CardSplitType.java b/forge-core/src/main/java/forge/card/CardSplitType.java index 38902df9db1..a949ec8b975 100644 --- a/forge-core/src/main/java/forge/card/CardSplitType.java +++ b/forge-core/src/main/java/forge/card/CardSplitType.java @@ -10,7 +10,7 @@ public enum CardSplitType Split(FaceSelectionMethod.COMBINE, CardStateName.RightSplit), Flip(FaceSelectionMethod.USE_PRIMARY_FACE, CardStateName.Flipped); - private CardSplitType(FaceSelectionMethod calcMode, CardStateName stateName) { + CardSplitType(FaceSelectionMethod calcMode, CardStateName stateName) { method = calcMode; this.changedStateName = stateName; } diff --git a/forge-core/src/main/java/forge/card/CardType.java b/forge-core/src/main/java/forge/card/CardType.java index ebc12e29266..21cd142f63a 100644 --- a/forge-core/src/main/java/forge/card/CardType.java +++ b/forge-core/src/main/java/forge/card/CardType.java @@ -73,7 +73,7 @@ public final class CardType implements Comparable, CardTypeView { public final boolean isPermanent; private static final ImmutableList allCoreTypeNames = EnumUtil.getNames(CoreType.class); - private CoreType(final boolean permanent) { + CoreType(final boolean permanent) { isPermanent = permanent; } } diff --git a/forge-core/src/main/java/forge/card/ICardFace.java b/forge-core/src/main/java/forge/card/ICardFace.java index 4953f3ddf0e..d73578d6242 100644 --- a/forge-core/src/main/java/forge/card/ICardFace.java +++ b/forge-core/src/main/java/forge/card/ICardFace.java @@ -5,5 +5,5 @@ package forge.card; * */ public interface ICardFace extends ICardCharacteristics, ICardRawAbilites, Comparable { - public String getAltName(); + String getAltName(); } diff --git a/forge-core/src/main/java/forge/card/MagicColor.java b/forge-core/src/main/java/forge/card/MagicColor.java index bf0b4fdbb9f..c21dedeac97 100644 --- a/forge-core/src/main/java/forge/card/MagicColor.java +++ b/forge-core/src/main/java/forge/card/MagicColor.java @@ -168,7 +168,7 @@ public final class MagicColor { private final String name, symbol; private final byte colormask; - private Color(String name0, byte colormask0, String symbol0) { + Color(String name0, byte colormask0, String symbol0) { name = name0; colormask = colormask0; symbol = symbol0; diff --git a/forge-core/src/main/java/forge/card/mana/ManaAtom.java b/forge-core/src/main/java/forge/card/mana/ManaAtom.java index 5a38b3a3310..951f7fbf776 100644 --- a/forge-core/src/main/java/forge/card/mana/ManaAtom.java +++ b/forge-core/src/main/java/forge/card/mana/ManaAtom.java @@ -44,7 +44,7 @@ public abstract class ManaAtom { if (s.length() == 2) { //if name is two characters, check for combination of two colors return (byte)(fromName(s.charAt(0)) | fromName(s.charAt(1))); } else if (s.length() == 1) { - return (byte) fromName(s.charAt(0)); + return fromName(s.charAt(0)); } s = s.toLowerCase(); diff --git a/forge-core/src/main/java/forge/card/mana/ManaCost.java b/forge-core/src/main/java/forge/card/mana/ManaCost.java index a2393429897..90886018108 100644 --- a/forge-core/src/main/java/forge/card/mana/ManaCost.java +++ b/forge-core/src/main/java/forge/card/mana/ManaCost.java @@ -69,7 +69,7 @@ public final class ManaCost implements Comparable, IterablenewArrayList()); + sealClass(Lists.newArrayList()); } private ManaCost(int cmc, List shards0) { diff --git a/forge-core/src/main/java/forge/card/mana/ManaCostShard.java b/forge-core/src/main/java/forge/card/mana/ManaCostShard.java index 84d317554b7..8c97c99e5b8 100644 --- a/forge-core/src/main/java/forge/card/mana/ManaCostShard.java +++ b/forge-core/src/main/java/forge/card/mana/ManaCostShard.java @@ -86,7 +86,7 @@ public enum ManaCostShard { * @param sValue * the s value */ - private ManaCostShard(final int value, final String sValue) { + ManaCostShard(final int value, final String sValue) { this(value, sValue, sValue); } @@ -100,7 +100,7 @@ public enum ManaCostShard { * @param imgKey * the img key */ - private ManaCostShard(final int value, final String sValue, final String imgKey) { + ManaCostShard(final int value, final String sValue, final String imgKey) { this.shard = value; this.cmc = this.getCMC(); this.cmpc = this.getCmpCost(); diff --git a/forge-core/src/main/java/forge/deck/DeckFormat.java b/forge-core/src/main/java/forge/deck/DeckFormat.java index 5d9f651828b..f0515c6494b 100644 --- a/forge-core/src/main/java/forge/deck/DeckFormat.java +++ b/forge-core/src/main/java/forge/deck/DeckFormat.java @@ -85,10 +85,7 @@ public enum DeckFormat { if (otherPart != null && otherPart.getManaCost().getCMC() > 3) { return false; //only cards with CMC less than 3 are allowed } - if (bannedCards.contains(rules.getName())) { - return false; - } - return true; + return !bannedCards.contains(rules.getName()); } }) { private final Set bannedCommanders = ImmutableSet.of("Derevi, Empyrial Tactician", "Erayo, Soratami Ascendant", "Rofellos, Llanowar Emissary"); @@ -120,7 +117,7 @@ public enum DeckFormat { private final static String ADVPROCLAMATION = "Advantageous Proclamation"; private final static String SOVREALM = "Sovereign's Realm"; - private DeckFormat(Range mainRange0, Range sideRange0, int maxCardCopies0, Predicate cardPoolFilter0, Predicate paperCardPoolFilter0) { + DeckFormat(Range mainRange0, Range sideRange0, int maxCardCopies0, Predicate cardPoolFilter0, Predicate paperCardPoolFilter0) { mainRange = mainRange0; sideRange = sideRange0; maxCardCopies = maxCardCopies0; @@ -128,7 +125,7 @@ public enum DeckFormat { paperCardPoolFilter = paperCardPoolFilter0; } - private DeckFormat(Range mainRange0, Range sideRange0, int maxCardCopies0, Predicate cardPoolFilter0) { + DeckFormat(Range mainRange0, Range sideRange0, int maxCardCopies0, Predicate cardPoolFilter0) { mainRange = mainRange0; sideRange = sideRange0; maxCardCopies = maxCardCopies0; @@ -136,7 +133,7 @@ public enum DeckFormat { cardPoolFilter = cardPoolFilter0; } - private DeckFormat(Range mainRange0, Range sideRange0, int maxCardCopies0) { + DeckFormat(Range mainRange0, Range sideRange0, int maxCardCopies0) { mainRange = mainRange0; sideRange = sideRange0; maxCardCopies = maxCardCopies0; diff --git a/forge-core/src/main/java/forge/deck/DeckSection.java b/forge-core/src/main/java/forge/deck/DeckSection.java index 90d2b91d17e..59516041ad0 100644 --- a/forge-core/src/main/java/forge/deck/DeckSection.java +++ b/forge-core/src/main/java/forge/deck/DeckSection.java @@ -10,7 +10,7 @@ public enum DeckSection { Conspiracy(0); private final int typicalSize; // Rules enforcement is done in DeckFormat class, this is for reference only - private DeckSection(int commonSize) { + DeckSection(int commonSize) { typicalSize = commonSize; } diff --git a/forge-core/src/main/java/forge/deck/generation/DeckGeneratorBase.java b/forge-core/src/main/java/forge/deck/generation/DeckGeneratorBase.java index d3f0a844019..050f1827e61 100644 --- a/forge-core/src/main/java/forge/deck/generation/DeckGeneratorBase.java +++ b/forge-core/src/main/java/forge/deck/generation/DeckGeneratorBase.java @@ -142,7 +142,7 @@ public abstract class DeckGeneratorBase { if(basicLandEdition == null){ if(setBasicLandPool(cp.getEdition())){ basicLandEdition = cp.getEdition(); - }; + } } cardCounts.put(cp.getName(), newCount); trace.append(String.format("(%d) %s [%s]%n", cp.getRules().getManaCost().getCMC(), cp.getName(), cp.getRules().getManaCost())); diff --git a/forge-core/src/main/java/forge/item/PaperCard.java b/forge-core/src/main/java/forge/item/PaperCard.java index be80957515c..4200b240e4d 100644 --- a/forge-core/src/main/java/forge/item/PaperCard.java +++ b/forge-core/src/main/java/forge/item/PaperCard.java @@ -238,13 +238,11 @@ public final class PaperCard implements Comparable, InventoryItemFro // Return true if card is one of the five basic lands that can be added for free public boolean isVeryBasicLand() { - if ((this.getName().equals("Swamp")) + return (this.getName().equals("Swamp")) || (this.getName().equals("Plains")) || (this.getName().equals("Island")) || (this.getName().equals("Forest")) - || (this.getName().equals("Mountain"))) { - return true; - } else return false; + || (this.getName().equals("Mountain")); } } diff --git a/forge-core/src/main/java/forge/util/Base64Coder.java b/forge-core/src/main/java/forge/util/Base64Coder.java index c78acff79b9..2a53be0d765 100644 --- a/forge-core/src/main/java/forge/util/Base64Coder.java +++ b/forge-core/src/main/java/forge/util/Base64Coder.java @@ -36,6 +36,7 @@ import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.PBEParameterSpec; +import java.nio.charset.StandardCharsets; /** * A Base64 encoder/decoder. @@ -377,7 +378,7 @@ public final class Base64Coder { SecretKey key = keyFactory.generateSecret(new PBEKeySpec(PASSWORD)); Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES"); pbeCipher.init(Cipher.ENCRYPT_MODE, key, new PBEParameterSpec(SALT, 20)); - return String.valueOf(encode(pbeCipher.doFinal(value.getBytes("UTF-8")))); + return String.valueOf(encode(pbeCipher.doFinal(value.getBytes(StandardCharsets.UTF_8)))); } public static String decrypt(String value) throws Exception { @@ -385,7 +386,7 @@ public final class Base64Coder { SecretKey key = keyFactory.generateSecret(new PBEKeySpec(PASSWORD)); Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES"); pbeCipher.init(Cipher.DECRYPT_MODE, key, new PBEParameterSpec(SALT, 20)); - return new String(pbeCipher.doFinal(decode(value)), "UTF-8"); + return new String(pbeCipher.doFinal(decode(value)), StandardCharsets.UTF_8); } // Dummy constructor. diff --git a/forge-core/src/main/java/forge/util/ComparableOp.java b/forge-core/src/main/java/forge/util/ComparableOp.java index ff7fb1030fb..ad295dac98e 100644 --- a/forge-core/src/main/java/forge/util/ComparableOp.java +++ b/forge-core/src/main/java/forge/util/ComparableOp.java @@ -33,7 +33,7 @@ public enum ComparableOp { private final String caption; - private ComparableOp(String caption0) { + ComparableOp(String caption0) { caption = caption0; } diff --git a/forge-core/src/main/java/forge/util/ImageUtil.java b/forge-core/src/main/java/forge/util/ImageUtil.java index fff1213d844..4b2e515f8fd 100644 --- a/forge-core/src/main/java/forge/util/ImageUtil.java +++ b/forge-core/src/main/java/forge/util/ImageUtil.java @@ -10,7 +10,7 @@ import forge.item.PaperCard; public class ImageUtil { public static float getNearestHQSize(float baseSize, float actualSize) { //get nearest power of actualSize to baseSize so that the image renders good - return (float)Math.round(actualSize) * (float)Math.pow(2, (double)Math.round(Math.log((double)(baseSize / actualSize)) / Math.log(2))); + return (float)Math.round(actualSize) * (float)Math.pow(2, (double)Math.round(Math.log(baseSize / actualSize) / Math.log(2))); } public static PaperCard getPaperCardFromImageKey(String key) { @@ -119,7 +119,6 @@ public class ImageUtil { for (int i = 0; i < in.length(); i++) { c = in.charAt(i); if ((c == '"') || (c == '/') || (c == ':') || (c == '?')) { - out.append(""); } else { out.append(c); } diff --git a/forge-core/src/main/java/forge/util/Lang.java b/forge-core/src/main/java/forge/util/Lang.java index 216bfee2664..531f7237314 100644 --- a/forge-core/src/main/java/forge/util/Lang.java +++ b/forge-core/src/main/java/forge/util/Lang.java @@ -102,7 +102,7 @@ public final class Lang { strCount = startsWithVowel(noun) ? "an " : "a "; } else { - strCount = String.valueOf(cnt) + " "; + strCount = cnt + " "; } return strCount + countedForm; } diff --git a/forge-core/src/main/java/forge/util/LocalizationChangeObserver.java b/forge-core/src/main/java/forge/util/LocalizationChangeObserver.java index 88887508309..559a2191424 100644 --- a/forge-core/src/main/java/forge/util/LocalizationChangeObserver.java +++ b/forge-core/src/main/java/forge/util/LocalizationChangeObserver.java @@ -1,5 +1,5 @@ package forge.util; public interface LocalizationChangeObserver { - public void localizationChanged(); + void localizationChanged(); } diff --git a/forge-core/src/main/java/forge/util/Localizer.java b/forge-core/src/main/java/forge/util/Localizer.java index 6569e1a2e91..73076e6b30c 100644 --- a/forge-core/src/main/java/forge/util/Localizer.java +++ b/forge-core/src/main/java/forge/util/Localizer.java @@ -1,10 +1,10 @@ package forge.util; import java.io.File; -import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; +import java.nio.charset.StandardCharsets; import java.text.MessageFormat; import java.util.*; @@ -38,7 +38,7 @@ public class Localizer { try { //formatter = new MessageFormat(resourceBundle.getString(key.toLowerCase()), locale); - formatter = new MessageFormat(resourceBundle.getString(key.toString()), locale); + formatter = new MessageFormat(resourceBundle.getString(key), locale); } catch (final IllegalArgumentException | MissingResourceException e) { e.printStackTrace(); } @@ -51,14 +51,10 @@ public class Localizer { formatter.setLocale(locale); String formattedMessage = "CHAR ENCODING ERROR"; - try { - //Support non-English-standard characters - formattedMessage = new String(formatter.format(messageArguments).getBytes("ISO-8859-1"), "UTF-8"); - } catch (final UnsupportedEncodingException e) { - e.printStackTrace(); - } - - return formattedMessage; + //Support non-English-standard characters + formattedMessage = new String(formatter.format(messageArguments).getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); + + return formattedMessage; } diff --git a/forge-core/src/main/java/forge/util/storage/StorageBase.java b/forge-core/src/main/java/forge/util/storage/StorageBase.java index 5a970878e8d..2c0c959fe20 100644 --- a/forge-core/src/main/java/forge/util/storage/StorageBase.java +++ b/forge-core/src/main/java/forge/util/storage/StorageBase.java @@ -65,7 +65,7 @@ public class StorageBase implements IStorage { @Override public boolean contains(String name) { - return name == null ? false : map.containsKey(name); + return name != null && map.containsKey(name); } @Override diff --git a/forge-game/pom.xml b/forge-game/pom.xml index 898e378a0a9..ee375af6f5b 100644 --- a/forge-game/pom.xml +++ b/forge-game/pom.xml @@ -6,7 +6,7 @@ forge forge - 1.6.28-SNAPSHOT + 1.6.29-SNAPSHOT forge-game diff --git a/forge-game/src/main/java/forge/GameCommand.java b/forge-game/src/main/java/forge/GameCommand.java index f0d96122ffe..e67dc9560a3 100644 --- a/forge-game/src/main/java/forge/GameCommand.java +++ b/forge-game/src/main/java/forge/GameCommand.java @@ -27,7 +27,7 @@ package forge; */ public interface GameCommand extends java.io.Serializable, Runnable { /** Constant Blank. */ - public final GameCommand BLANK = new GameCommand() { + GameCommand BLANK = new GameCommand() { private static final long serialVersionUID = 2689172297036001710L; diff --git a/forge-game/src/main/java/forge/game/CardTraitBase.java b/forge-game/src/main/java/forge/game/CardTraitBase.java index aacc1d389e1..a56db98f6f9 100644 --- a/forge-game/src/main/java/forge/game/CardTraitBase.java +++ b/forge-game/src/main/java/forge/game/CardTraitBase.java @@ -1,5 +1,6 @@ package forge.game; +import forge.card.MagicColor; import forge.card.mana.ManaAtom; import forge.game.ability.AbilityUtils; import forge.game.card.Card; @@ -16,6 +17,8 @@ import forge.util.Expressions; import java.util.*; +import org.apache.commons.lang3.StringUtils; + import com.google.common.collect.ImmutableList; import com.google.common.collect.Maps; @@ -159,9 +162,7 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView { */ public final boolean isSecondary() { if (this.mapParams.containsKey("Secondary")) { - if (this.mapParams.get("Secondary").equals("True")) { - return true; - } + return this.mapParams.get("Secondary").equals("True"); } return false; } @@ -252,6 +253,16 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView { if (params.containsKey("Blessing")) { if ("True".equalsIgnoreCase(params.get("Blessing")) != hostController.hasBlessing()) return false; } + + if (params.containsKey("Adamant")) { + if (hostCard.getCastSA() == null) { + return false; + } + final String payingMana = StringUtils.join(hostCard.getCastSA().getPayingMana()); + if (StringUtils.countMatches(payingMana, MagicColor.toShortString(params.get("Adamant"))) < 3) { + return false; + } + } if (params.containsKey("Presence")) { if (hostCard.getCastFrom() == null || hostCard.getCastSA() == null) @@ -451,9 +462,7 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView { if (params.containsKey("ActivateNoLoyaltyAbilitiesCondition")) { final Player active = game.getPhaseHandler().getPlayerTurn(); - if (active.getActivateLoyaltyAbilityThisTurn()) { - return false; - } + return !active.getActivateLoyaltyAbilityThisTurn(); } return true; } diff --git a/forge-game/src/main/java/forge/game/ForgeScript.java b/forge-game/src/main/java/forge/game/ForgeScript.java index c5db86d46ad..1bf735a42d4 100644 --- a/forge-game/src/main/java/forge/game/ForgeScript.java +++ b/forge-game/src/main/java/forge/game/ForgeScript.java @@ -29,8 +29,7 @@ public class ForgeScript { int desiredColor = MagicColor.fromName(colorName); boolean hasColor = colors.hasAnyColor(desiredColor); - if (mustHave != hasColor) - return false; + return mustHave == hasColor; } else if (property.contains("Colorless")) { // ... Card is colorless boolean non = property.startsWith("non"); @@ -38,66 +37,48 @@ public class ForgeScript { if (non && withSource && isColorlessSource) { return false; } - if (non == colors.isColorless()) return false; + return non != colors.isColorless(); } else if (property.contains("MultiColor")) { // ... Card is multicolored if (property.endsWith("Source") && isColorlessSource) return false; - if (property.startsWith("non") == colors.isMulticolor()) - return false; + return property.startsWith("non") != colors.isMulticolor(); } else if (property.contains("MonoColor")) { // ... Card is monocolored if (property.endsWith("Source") && isColorlessSource) return false; - if (property.startsWith("non") == colors.isMonoColor()) - return false; + return property.startsWith("non") != colors.isMonoColor(); } else if (property.startsWith("ChosenColor")) { if (property.endsWith("Source") && isColorlessSource) return false; - if (!source.hasChosenColor() || !colors.hasAnyColor(MagicColor.fromName(source.getChosenColor()))) - return false; + return source.hasChosenColor() && colors.hasAnyColor(MagicColor.fromName(source.getChosenColor())); } else if (property.startsWith("AnyChosenColor")) { if (property.endsWith("Source") && isColorlessSource) return false; - if (!source.hasChosenColor() - || !colors.hasAnyColor(ColorSet.fromNames(source.getChosenColors()).getColor())) - return false; + return source.hasChosenColor() + && colors.hasAnyColor(ColorSet.fromNames(source.getChosenColors()).getColor()); } else if (property.startsWith("non")) { // ... Other Card types - if (cardState.getTypeWithChanges().hasStringType(property.substring(3))) { - return false; - } + return !cardState.getTypeWithChanges().hasStringType(property.substring(3)); } else if (property.equals("CostsPhyrexianMana")) { - if (!cardState.getManaCost().hasPhyrexian()) { - return false; - } + return cardState.getManaCost().hasPhyrexian(); } else if (property.startsWith("HasSVar")) { final String svar = property.substring(8); - if (!cardState.hasSVar(svar)) { - return false; - } + return cardState.hasSVar(svar); } else if (property.equals("ChosenType")) { - if (!cardState.getTypeWithChanges().hasStringType(source.getChosenType())) { - return false; - } + return cardState.getTypeWithChanges().hasStringType(source.getChosenType()); } else if (property.equals("IsNotChosenType")) { - if (cardState.getTypeWithChanges().hasStringType(source.getChosenType())) { - return false; - } + return !cardState.getTypeWithChanges().hasStringType(source.getChosenType()); } else if (property.startsWith("HasSubtype")) { final String subType = property.substring(11); - if (!cardState.getTypeWithChanges().hasSubtype(subType)) { - return false; - } + return cardState.getTypeWithChanges().hasSubtype(subType); } else if (property.startsWith("HasNoSubtype")) { final String subType = property.substring(13); - if (cardState.getTypeWithChanges().hasSubtype(subType)) { - return false; - } + return !cardState.getTypeWithChanges().hasSubtype(subType); } else if (property.equals("hasActivatedAbilityWithTapCost")) { for (final SpellAbility sa : cardState.getSpellAbilities()) { if (sa.isAbility() && (sa.getPayCosts() != null) && sa.getPayCosts().hasTapCost()) { @@ -136,80 +117,47 @@ public class ForgeScript { x = AbilityUtils.calculateAmount(source, rhs, spellAbility); } - if (!Expressions.compare(y, property, x)) { - return false; - } - } else if (!cardState.getTypeWithChanges().hasStringType(property)) { - return false; - } - - return true; - + return Expressions.compare(y, property, x); + } else return cardState.getTypeWithChanges().hasStringType(property); + - } public static boolean spellAbilityHasProperty(SpellAbility sa, String property, Player sourceController, Card source, SpellAbility spellAbility) { if (property.equals("ManaAbility")) { - if (!sa.isManaAbility()) { - return false; - } + return sa.isManaAbility(); } else if (property.equals("nonManaAbility")) { - if (sa.isManaAbility()) { - return false; - } + return !sa.isManaAbility(); } else if (property.equals("Buyback")) { - if (!sa.isBuyBackAbility()) { - return false; - } + return sa.isBuyBackAbility(); } else if (property.equals("Cycling")) { - if (!sa.isCycling()) { - return false; - } + return sa.isCycling(); } else if (property.equals("Dash")) { - if (!sa.isDash()) { - return false; - } + return sa.isDash(); } else if (property.equals("Flashback")) { - if (!sa.isFlashBackAbility()) { - return false; - } + return sa.isFlashBackAbility(); } else if (property.equals("Jumpstart")) { - if (!sa.isJumpstart()) { - return false; - } + return sa.isJumpstart(); } else if (property.equals("Kicked")) { - if (!sa.isKicked()) { - return false; - } + return sa.isKicked(); } else if (property.equals("Loyalty")) { - if (!sa.isPwAbility()) { - return false; - } + return sa.isPwAbility(); } else if (property.equals("Aftermath")) { - if (!sa.isAftermath()) { - return false; - } + return sa.isAftermath(); } else if (property.equals("MorphUp")) { - if (!sa.isMorphUp()) { - return false; - } + return sa.isMorphUp(); } else if (property.equals("Equip")) { - if (!sa.hasParam("Equip")) { - return false; - } + return sa.hasParam("Equip"); } else if (property.equals("MayPlaySource")) { StaticAbility m = sa.getMayPlay(); if (m == null) { return false; } - if (!source.equals(m.getHostCard())) { - return false; - } + return source.equals(m.getHostCard()); } else if (property.startsWith("IsTargeting")) { - String k[] = property.split(" ", 2); + String[] k = property.split(" ", 2); boolean found = false; for (GameObject o : AbilityUtils.getDefinedObjects(source, k[1], spellAbility)) { if (sa.isTargeting(o)) { @@ -217,15 +165,11 @@ public class ForgeScript { break; } } - if (!found) { - return false; - } + return found; } else if (property.equals("YouCtrl")) { return sa.getActivatingPlayer().equals(sourceController); } else if (sa.getHostCard() != null) { - if (!sa.getHostCard().hasProperty(property, sourceController, source, spellAbility)) { - return false; - } + return sa.getHostCard().hasProperty(property, sourceController, source, spellAbility); } return true; diff --git a/forge-game/src/main/java/forge/game/Game.java b/forge-game/src/main/java/forge/game/Game.java index 4e58a1aba55..beef5eade46 100644 --- a/forge-game/src/main/java/forge/game/Game.java +++ b/forge-game/src/main/java/forge/game/Game.java @@ -845,7 +845,7 @@ public class Game { } } - library.removeAll((Collection)toRemove); + library.removeAll(toRemove); if (library.size() > 0) { //Make sure that matches were found. If not, use the original method to choose antes Card ante = library.get(MyRandom.getRandom().nextInt(library.size())); diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index 2b95afafab1..50d3523676d 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -763,7 +763,7 @@ public class GameAction { checkStaticAbilities(true); } public final void checkStaticAbilities(final boolean runEvents) { - checkStaticAbilities(runEvents, Sets.newHashSet(), CardCollection.EMPTY); + checkStaticAbilities(runEvents, Sets.newHashSet(), CardCollection.EMPTY); } public final void checkStaticAbilities(final boolean runEvents, final Set affectedCards, final CardCollectionView preList) { if (isCheckingStaticAbilitiesOnHold()) { @@ -929,7 +929,7 @@ public class GameAction { } public final void checkStateEffects(final boolean runEvents) { - checkStateEffects(runEvents, Sets.newHashSet()); + checkStateEffects(runEvents, Sets.newHashSet()); } public final void checkStateEffects(final boolean runEvents, final Set affectedCards) { // sol(10/29) added for Phase updates, state effects shouldn't be diff --git a/forge-game/src/main/java/forge/game/GameActionUtil.java b/forge-game/src/main/java/forge/game/GameActionUtil.java index b8fa75f9f13..e425d2fff6e 100644 --- a/forge-game/src/main/java/forge/game/GameActionUtil.java +++ b/forge-game/src/main/java/forge/game/GameActionUtil.java @@ -234,7 +234,7 @@ public final class GameActionUtil { // there is a flashback cost (and not the cards cost) if (keyword.contains(":")) { - final String k[] = keyword.split(":"); + final String[] k = keyword.split(":"); flashback.setPayCosts(new Cost(k[1], false)); } alternatives.add(flashback); diff --git a/forge-game/src/main/java/forge/game/GameEntity.java b/forge-game/src/main/java/forge/game/GameEntity.java index 1e7ecd2d3f9..58ab4d02127 100644 --- a/forge-game/src/main/java/forge/game/GameEntity.java +++ b/forge-game/src/main/java/forge/game/GameEntity.java @@ -407,11 +407,7 @@ public abstract class GameEntity extends GameObject implements IIdentifiable { } // true for all - if (hasProtectionFrom(attach, checkSBA)) { - return false; - } - - return true; + return !hasProtectionFrom(attach, checkSBA); } protected boolean canBeEquippedBy(final Card aura) { diff --git a/forge-game/src/main/java/forge/game/GameFormat.java b/forge-game/src/main/java/forge/game/GameFormat.java index 2790a759a64..bfa3f08efae 100644 --- a/forge-game/src/main/java/forge/game/GameFormat.java +++ b/forge-game/src/main/java/forge/game/GameFormat.java @@ -368,7 +368,7 @@ public class GameFormat implements Comparable { if ( strCars != null ) { CardRarity cr; rarities = Lists.newArrayList(); - for (String s: Arrays.asList(strCars.split(", "))) { + for (String s: strCars.split(", ")) { cr = CardRarity.smartValueOf(s); if (!cr.name().equals("Unknown")) { rarities.add(cr); diff --git a/forge-game/src/main/java/forge/game/GameLogEntryType.java b/forge-game/src/main/java/forge/game/GameLogEntryType.java index 76538fef910..8654fba1a55 100644 --- a/forge-game/src/main/java/forge/game/GameLogEntryType.java +++ b/forge-game/src/main/java/forge/game/GameLogEntryType.java @@ -20,7 +20,7 @@ public enum GameLogEntryType { PHASE("Phase"); private final String caption; - private GameLogEntryType(String name) { + GameLogEntryType(String name) { this.caption = name; } diff --git a/forge-game/src/main/java/forge/game/GameLogFormatter.java b/forge-game/src/main/java/forge/game/GameLogFormatter.java index 6ad9bd1cf8f..bed7d9a2755 100644 --- a/forge-game/src/main/java/forge/game/GameLogFormatter.java +++ b/forge-game/src/main/java/forge/game/GameLogFormatter.java @@ -182,7 +182,7 @@ public class GameLogFormatter extends IGameEventVisitor.Base { if (event.type == DamageType.LoyaltyLoss) { additionalLog = " (Removing " + Lang.nounWithAmount(event.amount, "loyalty counter") + ")"; } - String message = event.source.toString() + " deals " + String.valueOf(event.amount) + " damage" + additionalLog + " to " + event.card.toString() + "."; + String message = event.source.toString() + " deals " + event.amount + " damage" + additionalLog + " to " + event.card.toString() + "."; return new GameLogEntry(GameLogEntryType.DAMAGE, message); } @@ -197,7 +197,7 @@ public class GameLogFormatter extends IGameEventVisitor.Base { @Override public GameLogEntry visit(GameEventTurnBegan event) { - String message = "Turn " + String.valueOf(event.turnNumber) + " (" + event.turnOwner.toString() + ")"; + String message = "Turn " + event.turnNumber + " (" + event.turnOwner.toString() + ")"; return new GameLogEntry(GameLogEntryType.TURN, message); } @@ -205,7 +205,7 @@ public class GameLogFormatter extends IGameEventVisitor.Base { public GameLogEntry visit(GameEventPlayerDamaged ev) { String extra = ev.infect ? " (as poison counters)" : ""; String damageType = ev.combat ? "combat" : "non-combat"; - String message = ev.source.toString() + " deals " + String.valueOf(ev.amount) + " " + damageType + " damage to " + ev.target.toString() + extra + "."; + String message = ev.source.toString() + " deals " + ev.amount + " " + damageType + " damage to " + ev.target.toString() + extra + "."; return new GameLogEntry(GameLogEntryType.DAMAGE, message); } @@ -281,7 +281,7 @@ public class GameLogFormatter extends IGameEventVisitor.Base { @Override public GameLogEntry visit(GameEventMulligan ev) { - String message = ev.player.toString() + " has mulliganed down to " + String.valueOf(ev.player.getZone(ZoneType.Hand).size()) + " cards."; + String message = ev.player.toString() + " has mulliganed down to " + ev.player.getZone(ZoneType.Hand).size() + " cards."; return new GameLogEntry(GameLogEntryType.MULLIGAN, message); } diff --git a/forge-game/src/main/java/forge/game/GameStage.java b/forge-game/src/main/java/forge/game/GameStage.java index 9d32e7ac39f..251fc2e25ee 100644 --- a/forge-game/src/main/java/forge/game/GameStage.java +++ b/forge-game/src/main/java/forge/game/GameStage.java @@ -5,5 +5,5 @@ public enum GameStage { Mulligan, Play, RestartedByKarn, - GameOver; + GameOver } \ No newline at end of file diff --git a/forge-game/src/main/java/forge/game/GameType.java b/forge-game/src/main/java/forge/game/GameType.java index dc63a482d3f..7ef81786c26 100644 --- a/forge-game/src/main/java/forge/game/GameType.java +++ b/forge-game/src/main/java/forge/game/GameType.java @@ -71,11 +71,11 @@ public enum GameType { private final String name, description; private final Function deckAutoGenerator; - private GameType(DeckFormat deckFormat0, boolean isCardPoolLimited0, boolean canSideboard0, boolean addWonCardsMidgame0, String name0, String description0) { + GameType(DeckFormat deckFormat0, boolean isCardPoolLimited0, boolean canSideboard0, boolean addWonCardsMidgame0, String name0, String description0) { this(deckFormat0, isCardPoolLimited0, canSideboard0, addWonCardsMidgame0, name0, description0, null); } - private GameType(DeckFormat deckFormat0, boolean isCardPoolLimited0, boolean canSideboard0, boolean addWonCardsMidgame0, String name0, String description0, Function deckAutoGenerator0) { + GameType(DeckFormat deckFormat0, boolean isCardPoolLimited0, boolean canSideboard0, boolean addWonCardsMidgame0, String name0, String description0, Function deckAutoGenerator0) { final Localizer localizer = forge.util.Localizer.getInstance(); deckFormat = deckFormat0; isCardPoolLimited = isCardPoolLimited0; diff --git a/forge-game/src/main/java/forge/game/GlobalRuleChange.java b/forge-game/src/main/java/forge/game/GlobalRuleChange.java index aa2e4f1b326..2e7fc2ca2ab 100644 --- a/forge-game/src/main/java/forge/game/GlobalRuleChange.java +++ b/forge-game/src/main/java/forge/game/GlobalRuleChange.java @@ -40,7 +40,7 @@ public enum GlobalRuleChange { private final String ruleText; - private GlobalRuleChange(String text) { + GlobalRuleChange(String text) { ruleText = text; } diff --git a/forge-game/src/main/java/forge/game/IIdentifiable.java b/forge-game/src/main/java/forge/game/IIdentifiable.java index 8c3bf20272a..6b90c6826e8 100644 --- a/forge-game/src/main/java/forge/game/IIdentifiable.java +++ b/forge-game/src/main/java/forge/game/IIdentifiable.java @@ -3,8 +3,8 @@ package forge.game; import com.google.common.base.Function; public interface IIdentifiable { - public abstract int getId(); - public static final Function FN_GET_ID = new Function() { + int getId(); + Function FN_GET_ID = new Function() { @Override public Integer apply(final IIdentifiable input) { return Integer.valueOf(input.getId()); diff --git a/forge-game/src/main/java/forge/game/StaticEffect.java b/forge-game/src/main/java/forge/game/StaticEffect.java index 9f4be831e8f..1d2d7b73151 100644 --- a/forge-game/src/main/java/forge/game/StaticEffect.java +++ b/forge-game/src/main/java/forge/game/StaticEffect.java @@ -53,7 +53,6 @@ public class StaticEffect { private int xValue = 0; private int yValue = 0; private long timestamp = -1; - private Map xValueMap = Maps.newTreeMap(); private String chosenType; private Map mapParams = Maps.newTreeMap(); @@ -95,7 +94,6 @@ public class StaticEffect { copy.xValue = this.xValue; copy.yValue = this.yValue; copy.timestamp = this.timestamp; - copy.xValueMap = this.xValueMap; copy.chosenType = this.chosenType; copy.mapParams = this.mapParams; copy.overwriteTypes = this.overwriteTypes; @@ -740,29 +738,6 @@ public class StaticEffect { return this.yValue; } - /** - * Store xValue relative to a specific card. - * @param affectedCard the card affected - * @param xValue the xValue - */ - public final void addXMapValue(final Card affectedCard, final Integer xValue) { - if (this.xValueMap.containsKey(affectedCard)) { - if (!this.xValueMap.get(affectedCard).equals(xValue)) { - this.xValueMap.remove(affectedCard); - } - } - this.xValueMap.put(affectedCard, xValue); - } - - /** - * Get the xValue for specific card. - * @param affectedCard the affected card - * @return an int. - */ - public int getXMapValue(Card affectedCard) { - return this.xValueMap.get(affectedCard); - } - /** * setParams. TODO Write javadoc for this method. * @@ -813,10 +788,6 @@ public class StaticEffect { String changeColorWordsTo = null; - int powerBonus = 0; - String addP = ""; - int toughnessBonus = 0; - String addT = ""; int keywordMultiplier = 1; boolean setPT = false; String[] addHiddenKeywords = null; @@ -834,28 +805,6 @@ public class StaticEffect { setPT = true; } - if (params.containsKey("AddPower")) { - addP = params.get("AddPower"); - if (addP.matches("[0-9][0-9]?")) { - powerBonus = Integer.valueOf(addP); - } else if (addP.equals("AffectedX")) { - // gets calculated at runtime - } else { - powerBonus = getXValue(); - } - } - - if (params.containsKey("AddToughness")) { - addT = params.get("AddToughness"); - if (addT.matches("[0-9][0-9]?")) { - toughnessBonus = Integer.valueOf(addT); - } else if (addT.equals("AffectedX")) { - // gets calculated at runtime - } else { - toughnessBonus = getYValue(); - } - } - if (params.containsKey("KeywordMultiplier")) { String multiplier = params.get("KeywordMultiplier"); if (multiplier.equals("X")) { @@ -934,15 +883,9 @@ public class StaticEffect { } // remove P/T bonus - if (addP.startsWith("AffectedX")) { - powerBonus = getXMapValue(affectedCard); - } - if (addT.startsWith("AffectedX")) { - toughnessBonus = getXMapValue(affectedCard); - } + affectedCard.removePTBoost(getTimestamp()); + // the view is updated in GameAction#checkStaticAbilities to avoid flickering - affectedCard.addSemiPermanentPowerBoost(powerBonus * -1, false); - affectedCard.addSemiPermanentToughnessBoost(toughnessBonus * -1, false); // remove keywords // TODO regular keywords currently don't try to use keyword multiplier diff --git a/forge-game/src/main/java/forge/game/ability/AbilityFactory.java b/forge-game/src/main/java/forge/game/ability/AbilityFactory.java index 6fd213ea43c..1e770f1fce9 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityFactory.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityFactory.java @@ -64,7 +64,7 @@ public final class AbilityFactory { SubAbility("DB"); private final String prefix; - private AbilityRecordType(String prefix) { + AbilityRecordType(String prefix) { this.prefix = prefix; } public String getPrefix() { diff --git a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java index 747945ae97b..bf32df071ef 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -35,7 +35,6 @@ import io.sentry.event.BreadcrumbBuilder; import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -1063,7 +1062,7 @@ public class AbilityUtils { } else if (defined.startsWith("OppNon")) { players.addAll(player.getOpponents()); - players.removeAll((Collection)getDefinedPlayers(card, defined.substring(6), sa)); + players.removeAll(getDefinedPlayers(card, defined.substring(6), sa)); } else if (defined.startsWith("Replaced")) { final SpellAbility root = sa.getRootAbility(); @@ -1624,6 +1623,13 @@ public class AbilityUtils { return count; } + // Count$Adamant... + if (sq[0].startsWith("Adamant")) { + final String payingMana = StringUtils.join(sa.getRootAbility().getPayingMana()); + final boolean adamant = StringUtils.countMatches(payingMana, MagicColor.toShortString(sq[1])) >= 3; + return CardFactoryUtil.doXMath(Integer.parseInt(sq[adamant ? 2 : 3]), expr, c); + } + if (l[0].startsWith("LastStateBattlefield")) { final String[] k = l[0].split(" "); CardCollectionView list = null; @@ -1800,7 +1806,7 @@ public class AbilityUtils { public static final String getSVar(final CardTraitBase ability, final String sVarName) { String val = null; if (ability instanceof SpellAbility) { - val = ((SpellAbility) ability).getSVar(sVarName); + val = ability.getSVar(sVarName); } if (StringUtils.isEmpty(val)) { Card host = null; @@ -1857,7 +1863,7 @@ public class AbilityUtils { public boolean apply(Card input) { for (final KeywordInterface inst : input.getKeywords(Keyword.SPLICE)) { String k = inst.getOriginal(); - final String n[] = k.split(":"); + final String[] n = k.split(":"); if (source.isValid(n[1].split(","), player, input, sa)) { return true; } @@ -1890,7 +1896,7 @@ public class AbilityUtils { // This Function thinks that Splice exist only once on the card for (final KeywordInterface inst : c.getKeywords(Keyword.SPLICE)) { final String k = inst.getOriginal(); - final String n[] = k.split(":"); + final String[] n = k.split(":"); spliceCost = new Cost(n[2], false); } diff --git a/forge-game/src/main/java/forge/game/ability/effects/ActivateAbilityEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ActivateAbilityEffect.java index 2811591354c..3114cf48501 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ActivateAbilityEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ActivateAbilityEffect.java @@ -51,7 +51,7 @@ public class ActivateAbilityEffect extends SpellAbilityEffect { continue; } SpellAbility manaAb = p.getController().chooseSingleSpellForEffect( - possibleAb, sa, "Choose a mana ability:", ImmutableMap.of()); + possibleAb, sa, "Choose a mana ability:", ImmutableMap.of()); p.getController().playChosenSpellAbility(manaAb); } } diff --git a/forge-game/src/main/java/forge/game/ability/effects/AssignGroupEffect.java b/forge-game/src/main/java/forge/game/ability/effects/AssignGroupEffect.java index eb53cecf76b..e3e53dc6fa0 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/AssignGroupEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/AssignGroupEffect.java @@ -38,7 +38,7 @@ public class AssignGroupEffect extends SpellAbilityEffect { List defined = getDefinedOrTargeted(sa, "Defined"); - final List abilities = Lists.newArrayList(sa.getAdditionalAbilityList("Choices")); + final List abilities = Lists.newArrayList(sa.getAdditionalAbilityList("Choices")); Player chooser = sa.getActivatingPlayer(); if (sa.hasParam("Chooser")) { diff --git a/forge-game/src/main/java/forge/game/ability/effects/BidLifeEffect.java b/forge-game/src/main/java/forge/game/ability/effects/BidLifeEffect.java index fdd3365212e..0ea798f50e9 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/BidLifeEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/BidLifeEffect.java @@ -54,7 +54,7 @@ public class BidLifeEffect extends SpellAbilityEffect { willBid = false; for (final Player p : bidPlayers) { final boolean result = p.getController().confirmBidAction(sa, PlayerActionConfirmMode.BidLife, - "Do you want to top bid? Current Bid =" + String.valueOf(bid), bid, winner); + "Do you want to top bid? Current Bid =" + bid, bid, winner); willBid |= result; if (result) { // a different choose number bid += p.getController().chooseNumber(sa, "Bid life:", 1, 9); diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChangeTextEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChangeTextEffect.java index 91ee11bd4b8..131eecbcff7 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChangeTextEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChangeTextEffect.java @@ -71,13 +71,13 @@ public class ChangeTextEffect extends SpellAbilityEffect { validTypes.addAll(CardType.Constant.CREATURE_TYPES); kindOfType = "creature"; } - changedTypeWordOriginal = sa.getActivatingPlayer().getController().chooseSomeType(kindOfType, sa, validTypes, Lists.newArrayList()); + changedTypeWordOriginal = sa.getActivatingPlayer().getController().chooseSomeType(kindOfType, sa, validTypes, Lists.newArrayList()); } else { changedTypeWordOriginal = changedTypeWordsArray[0]; } validTypes.clear(); - final List forbiddenTypes = sa.hasParam("ForbiddenNewTypes") ? Lists.newArrayList(sa.getParam("ForbiddenNewTypes").split(",")) : Lists.newArrayList(); + final List forbiddenTypes = sa.hasParam("ForbiddenNewTypes") ? Lists.newArrayList(sa.getParam("ForbiddenNewTypes").split(",")) : Lists.newArrayList(); forbiddenTypes.add(changedTypeWordOriginal); if (changedTypeWordsArray[1].startsWith("Choose")) { if (changedTypeWordsArray[1].equals("ChooseBasicLandType")) { diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java index 58220d302fb..8cbf3f0ba5b 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java @@ -908,7 +908,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect { } if (totalcmc != null) { if (totcmc >= 0) { - fetchList = CardLists.getValidCards(fetchList, "Card.cmcLE" + Integer.toString(totcmc), source.getController(), source); + fetchList = CardLists.getValidCards(fetchList, "Card.cmcLE" + totcmc, source.getController(), source); } } diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java index 5d7083bf5ab..d87d9da4b85 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChooseCardEffect.java @@ -98,7 +98,7 @@ public class ChooseCardEffect extends SpellAbilityEffect { int chosenP = 0; while (!creature.isEmpty()) { Card c = p.getController().chooseSingleEntityForEffect(creature, sa, - "Select creature(s) with total power less than or equal to " + Integer.toString(totP - chosenP - negativeNum) + "Select creature(s) with total power less than or equal to " + (totP - chosenP - negativeNum) + "\r\n(Selected:" + chosenPool + ")\r\n" + "(Total Power: " + chosenP + ")", chosenP <= totP); if (c == null) { if (p.getController().confirmAction(sa, PlayerActionConfirmMode.OptionalChoose, "Cancel Choose?")) { diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChooseGenericEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChooseGenericEffect.java index 93e5b3bca09..9073e1a9342 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChooseGenericEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChooseGenericEffect.java @@ -30,14 +30,14 @@ public class ChooseGenericEffect extends SpellAbilityEffect { public void resolve(SpellAbility sa) { final Card host = sa.getHostCard(); - final List abilities = Lists.newArrayList(sa.getAdditionalAbilityList("Choices")); + final List abilities = Lists.newArrayList(sa.getAdditionalAbilityList("Choices")); final SpellAbility fallback = sa.getAdditionalAbility("FallbackAbility"); final List tgtPlayers = getDefinedPlayersOrTargeted(sa); for (final Player p : tgtPlayers) { // determine if any of the choices are not valid - List saToRemove = Lists.newArrayList(); + List saToRemove = Lists.newArrayList(); for (SpellAbility saChoice : abilities) { if (!saChoice.getRestrictions().checkOtherRestrictions(host, saChoice, sa.getActivatingPlayer()) ) { diff --git a/forge-game/src/main/java/forge/game/ability/effects/CloneEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CloneEffect.java index 19933d913e2..950643e4a9c 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CloneEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CloneEffect.java @@ -124,7 +124,7 @@ public class CloneEffect extends SpellAbilityEffect { } if (!pumpKeywords.isEmpty()) { - tgtCard.addChangedCardKeywords(pumpKeywords, Lists.newArrayList(), false, false, ts); + tgtCard.addChangedCardKeywords(pumpKeywords, Lists.newArrayList(), false, false, ts); } tgtCard.updateStateForView(); diff --git a/forge-game/src/main/java/forge/game/ability/effects/ControlGainEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ControlGainEffect.java index 9844f1dd6a2..ec26b621f1d 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ControlGainEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ControlGainEffect.java @@ -142,7 +142,7 @@ public class ControlGainEffect extends SpellAbilityEffect { } if (!kws.isEmpty()) { - tgtC.addChangedCardKeywords(kws, Lists.newArrayList(), false, false, tStamp); + tgtC.addChangedCardKeywords(kws, Lists.newArrayList(), false, false, tStamp); game.fireEvent(new GameEventCardStatsChanged(tgtC)); } diff --git a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java index 2ecdfcfd620..612737941e8 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java @@ -192,7 +192,7 @@ public class CopyPermanentEffect extends SpellAbilityEffect { copyInPlay.setCloneOrigin(host); if (!pumpKeywords.isEmpty()) { - copyInPlay.addChangedCardKeywords(pumpKeywords, Lists.newArrayList(), false, false, timestamp); + copyInPlay.addChangedCardKeywords(pumpKeywords, Lists.newArrayList(), false, false, timestamp); } crds.add(copyInPlay); if (sa.hasParam("RememberCopied")) { diff --git a/forge-game/src/main/java/forge/game/ability/effects/CountersRemoveEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CountersRemoveEffect.java index 15a4a69bcf2..5338477cae1 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CountersRemoveEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CountersRemoveEffect.java @@ -32,7 +32,7 @@ public class CountersRemoveEffect extends SpellAbilityEffect { int amount = 0; if (!num.equals("All") && !num.equals("Remembered")) { amount = AbilityUtils.calculateAmount(sa.getHostCard(), num, sa); - }; + } sb.append("Remove "); if (sa.hasParam("UpTo")) { diff --git a/forge-game/src/main/java/forge/game/ability/effects/DelayedTriggerEffect.java b/forge-game/src/main/java/forge/game/ability/effects/DelayedTriggerEffect.java index d3c5ab0bc4c..33cd4a6aaf7 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/DelayedTriggerEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/DelayedTriggerEffect.java @@ -30,9 +30,7 @@ public class DelayedTriggerEffect extends SpellAbilityEffect { @Override public void resolve(SpellAbility sa) { Map mapParams = Maps.newHashMap(sa.getMapParams()); - if (mapParams.containsKey("Cost")) { - mapParams.remove("Cost"); - } + mapParams.remove("Cost"); if (mapParams.containsKey("SpellDescription")) { mapParams.put("TriggerDescription", mapParams.get("SpellDescription")); diff --git a/forge-game/src/main/java/forge/game/ability/effects/ImmediateTriggerEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ImmediateTriggerEffect.java index a96057b6c34..8fe2f8b4813 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ImmediateTriggerEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ImmediateTriggerEffect.java @@ -29,9 +29,7 @@ public class ImmediateTriggerEffect extends SpellAbilityEffect { public void resolve(SpellAbility sa) { Map mapParams = Maps.newHashMap(sa.getMapParams()); - if (mapParams.containsKey("Cost")) { - mapParams.remove("Cost"); - } + mapParams.remove("Cost"); if (mapParams.containsKey("SpellDescription")) { mapParams.put("TriggerDescription", mapParams.get("SpellDescription")); diff --git a/forge-game/src/main/java/forge/game/ability/effects/LifeLoseEffect.java b/forge-game/src/main/java/forge/game/ability/effects/LifeLoseEffect.java index d4af63d3a8e..39693308a68 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/LifeLoseEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/LifeLoseEffect.java @@ -43,12 +43,12 @@ public class LifeLoseEffect extends SpellAbilityEffect { lifeLost += p.loseLife(lifeAmount); } } - sa.getHostCard().setSVar("AFLifeLost", "Number$" + Integer.toString(lifeLost)); + sa.getHostCard().setSVar("AFLifeLost", "Number$" + lifeLost); // Exceptional case for Extort: must propagate the amount of life lost to subability, // otherwise the first Extort trigger per game won't work if (sa.getSubAbility() != null && ApiType.GainLife.equals(sa.getSubAbility().getApi())) { - sa.getSubAbility().setSVar("AFLifeLost", "Number$" + Integer.toString(lifeLost)); + sa.getSubAbility().setSVar("AFLifeLost", "Number$" + lifeLost); } } diff --git a/forge-game/src/main/java/forge/game/ability/effects/PowerExchangeEffect.java b/forge-game/src/main/java/forge/game/ability/effects/PowerExchangeEffect.java index a6c6dcb3137..5b13d75feae 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/PowerExchangeEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/PowerExchangeEffect.java @@ -55,8 +55,10 @@ public class PowerExchangeEffect extends SpellAbilityEffect { final int power1 = c1.getNetPower(); final int power2 = c2.getNetPower(); - c1.addTempPowerBoost(power2 - power1); - c2.addTempPowerBoost(power1 - power2); + final long timestamp = game.getNextTimestamp(); + + c1.addNewPT(power2, null, timestamp); + c2.addNewPT(power1, null, timestamp); game.fireEvent(new GameEventCardStatsChanged(c1)); game.fireEvent(new GameEventCardStatsChanged(c2)); @@ -69,8 +71,8 @@ public class PowerExchangeEffect extends SpellAbilityEffect { @Override public void run() { - c1.addTempPowerBoost(power1 - power2); - c2.addTempPowerBoost(power2 - power1); + c1.removeNewPT(timestamp); + c2.removeNewPT(timestamp); game.fireEvent(new GameEventCardStatsChanged(c1)); game.fireEvent(new GameEventCardStatsChanged(c2)); } diff --git a/forge-game/src/main/java/forge/game/ability/effects/ProtectAllEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ProtectAllEffect.java index 2a09ba0eb5b..8929a776217 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ProtectAllEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ProtectAllEffect.java @@ -123,7 +123,7 @@ public class ProtectAllEffect extends SpellAbilityEffect { final List playerList = AbilityUtils.getDefinedPlayers(host, players, sa); for (final Player player : playerList) { for (final String gain : gains) { - player.addChangedKeywords(ImmutableList.of("Protection from " + gain), ImmutableList.of(), timestamp); + player.addChangedKeywords(ImmutableList.of("Protection from " + gain), ImmutableList.of(), timestamp); } if (!sa.hasParam("Permanent")) { diff --git a/forge-game/src/main/java/forge/game/ability/effects/ProtectEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ProtectEffect.java index 3b2b1fe6445..df30dea7f34 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ProtectEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ProtectEffect.java @@ -27,7 +27,7 @@ public class ProtectEffect extends SpellAbilityEffect { protected String getStackDescription(SpellAbility sa) { final List gains = getProtectionList(sa); - final boolean choose = (sa.hasParam("Choices")) ? true : false; + final boolean choose = sa.hasParam("Choices"); final String joiner = choose ? "or" : "and"; final StringBuilder sb = new StringBuilder(); diff --git a/forge-game/src/main/java/forge/game/ability/effects/PumpAllEffect.java b/forge-game/src/main/java/forge/game/ability/effects/PumpAllEffect.java index c149b976412..010914c6775 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/PumpAllEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/PumpAllEffect.java @@ -49,9 +49,17 @@ public class PumpAllEffect extends SpellAbilityEffect { continue; } - tgtC.addTempPowerBoost(a); - tgtC.addTempToughnessBoost(d); + boolean redrawPT = false; + + if (a != 0 || d != 0) { + tgtC.addPTBoost(a, d, timestamp); + redrawPT = true; + } + tgtC.addChangedCardKeywords(kws, null, false, false, timestamp); + if (redrawPT) { + tgtC.updatePowerToughnessForView(); + } for (String kw : hiddenkws) { tgtC.addHiddenExtrinsicKeyword(kw); @@ -68,13 +76,13 @@ public class PumpAllEffect extends SpellAbilityEffect { @Override public void run() { - tgtC.addTempPowerBoost(-1 * a); - tgtC.addTempToughnessBoost(-1 * d); + tgtC.removePTBoost(timestamp); tgtC.removeChangedCardKeywords(timestamp); for (String kw : hiddenkws) { tgtC.removeHiddenExtrinsicKeyword(kw); } + tgtC.updatePowerToughnessForView(); game.fireEvent(new GameEventCardStatsChanged(tgtC)); } diff --git a/forge-game/src/main/java/forge/game/ability/effects/PumpEffect.java b/forge-game/src/main/java/forge/game/ability/effects/PumpEffect.java index 68936a2f7ae..72c2987dd5c 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/PumpEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/PumpEffect.java @@ -55,9 +55,12 @@ public class PumpEffect extends SpellAbilityEffect { } } - gameCard.addTempPowerBoost(a); - gameCard.addTempToughnessBoost(d); - gameCard.addChangedCardKeywords(kws, Lists.newArrayList(), false, false, timestamp); + if (a != 0 || d != 0) { + gameCard.addPTBoost(a, d, timestamp); + redrawPT = true; + } + + gameCard.addChangedCardKeywords(kws, Lists.newArrayList(), false, false, timestamp); if (redrawPT) { gameCard.updatePowerToughnessForView(); } @@ -73,23 +76,18 @@ public class PumpEffect extends SpellAbilityEffect { @Override public void run() { - gameCard.addTempPowerBoost(-1 * a); - gameCard.addTempToughnessBoost(-1 * d); + gameCard.removePTBoost(timestamp); if (keywords.size() > 0) { - boolean redrawPT = false; for (String kw : keywords) { - redrawPT |= kw.contains("CARDNAME's power and toughness are switched"); if (kw.startsWith("HIDDEN")) { gameCard.removeHiddenExtrinsicKeyword(kw); - if (redrawPT) { - gameCard.updatePowerToughnessForView(); - } } } gameCard.removeChangedCardKeywords(timestamp); } + gameCard.updatePowerToughnessForView(); game.fireEvent(new GameEventCardStatsChanged(gameCard)); } @@ -108,7 +106,7 @@ public class PumpEffect extends SpellAbilityEffect { && !(host.isInPlay() || host.isInZone(ZoneType.Stack))) { return; } - p.addChangedKeywords(keywords, ImmutableList.of(), timestamp); + p.addChangedKeywords(keywords, ImmutableList.of(), timestamp); if (!sa.hasParam("Permanent")) { // If not Permanent, remove Pumped at EOT @@ -254,7 +252,7 @@ public class PumpEffect extends SpellAbilityEffect { if (defined.equals("ChosenType")) { replaced = host.getChosenType(); } else if (defined.equals("CardUIDSource")) { - replaced = "CardUID_" + String.valueOf(host.getId()); + replaced = "CardUID_" + host.getId(); } else if (defined.equals("ActivatorName")) { replaced = sa.getActivatingPlayer().getName(); } @@ -279,9 +277,7 @@ public class PumpEffect extends SpellAbilityEffect { if (sa.hasParam("NoRepetition")) { for (KeywordInterface inst : tgtCards.get(0).getKeywords()) { final String kws = inst.getOriginal(); - if (total.contains(kws)) { - total.remove(kws); - } + total.remove(kws); } } final int min = Math.min(total.size(), numkw); diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index 8e08f99c1bb..1ee0b0f0f17 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -113,7 +113,7 @@ public class Card extends GameEntity implements Comparable { private final Map mayPlay = Maps.newHashMap(); - private final Multimap withFlash = HashMultimap.create(); + private final Multimap withFlash = HashMultimap.create(); // changes by AF animate and continuous static effects - timestamp is the key of maps private final Map changedCardTypes = Maps.newTreeMap(); @@ -195,6 +195,8 @@ public class Card extends GameEntity implements Comparable { // stack of set power/toughness private Map> newPT = Maps.newTreeMap(); private Map> newPTCharacterDefining = Maps.newTreeMap(); + private Map> boostPT = Maps.newTreeMap(); + private String basePowerString = null; private String baseToughnessString = null; private String oracleText = ""; @@ -208,12 +210,6 @@ public class Card extends GameEntity implements Comparable { private int turnInZone; - private int tempPowerBoost = 0; - private int tempToughnessBoost = 0; - - private int semiPermanentPowerBoost = 0; - private int semiPermanentToughnessBoost = 0; - private int xManaCostPaid = 0; private Map xManaCostPaidByColor; @@ -1200,9 +1196,7 @@ public class Card extends GameEntity implements Comparable { if (type == CounterType.DREAM) { // need to be done extra because it is also a state based action - if (hasKeyword("CARDNAME can't have more than seven dream counters on it.") && getCounters(CounterType.DREAM) > 6) { - return false; - } + return !hasKeyword("CARDNAME can't have more than seven dream counters on it.") || getCounters(CounterType.DREAM) <= 6; } return true; } @@ -1713,7 +1707,7 @@ public class Card extends GameEntity implements Comparable { sbLong.append(sbx).append("\r\n"); } } else if (keyword.startsWith("Hexproof:")) { - final String k[] = keyword.split(":"); + final String[] k = keyword.split(":"); sbLong.append("Hexproof from ").append(k[2]) .append(" (").append(inst.getReminderText()).append(")").append("\r\n"); } else if (keyword.endsWith(".") && !keyword.startsWith("Haunt")) { @@ -1807,7 +1801,7 @@ public class Card extends GameEntity implements Comparable { } else if (keyword.equals("AllNonLegendaryCreatureNames")) { sbLong.append(getName()).append(" has all names of nonlegendary creature cards.\r\n"); } else if (keyword.startsWith("IfReach")) { - String k[] = keyword.split(":"); + String[] k = keyword.split(":"); sbLong.append(getName()).append(" can block ") .append(CardType.getPluralType(k[1])) .append(" as though it had reach.\r\n"); @@ -1817,7 +1811,7 @@ public class Card extends GameEntity implements Comparable { String desc = AbilityFactory.getMapParams(getSVar(k[1])).get("SpellDescription"); sbLong.append(desc); } else if (keyword.startsWith("Saga")) { - String k[] = keyword.split(":"); + String[] k = keyword.split(":"); String desc = "(As this Saga enters and after your draw step, " + " add a lore counter. Sacrifice after " + Strings.repeat("I", Integer.valueOf(k[1])) + ".)"; sbLong.append(desc); @@ -2205,7 +2199,7 @@ public class Card extends GameEntity implements Comparable { if (n.length > 3) { desc = n[3]; } else { - String k[] = n[1].split(","); + String[] k = n[1].split(","); for (int i = 0; i < k.length; i++) { if (CardType.isACardType(k[i])) { k[i] = k[i].toLowerCase(); @@ -3343,7 +3337,7 @@ public class Card extends GameEntity implements Comparable { } public final StatBreakdown getUnswitchedPowerBreakdown() { - return new StatBreakdown(getCurrentPower(), getTempPowerBoost(), getSemiPermanentPowerBoost(), getPowerBonusFromCounters()); + return new StatBreakdown(getCurrentPower(), getTempPowerBoost(), getPowerBonusFromCounters()); } public final int getUnswitchedPower() { return getUnswitchedPowerBreakdown().getTotal(); @@ -3380,31 +3374,28 @@ public class Card extends GameEntity implements Comparable { public static class StatBreakdown { public final int currentValue; public final int tempBoost; - public final int semiPermanentBoost; public final int bonusFromCounters; public StatBreakdown() { this.currentValue = 0; this.tempBoost = 0; - this.semiPermanentBoost = 0; this.bonusFromCounters = 0; } - public StatBreakdown(int currentValue, int tempBoost, int semiPermanentBoost, int bonusFromCounters){ + public StatBreakdown(int currentValue, int tempBoost, int bonusFromCounters){ this.currentValue = currentValue; this.tempBoost = tempBoost; - this.semiPermanentBoost = semiPermanentBoost; this.bonusFromCounters = bonusFromCounters; } public int getTotal() { - return currentValue + tempBoost + semiPermanentBoost + bonusFromCounters; + return currentValue + tempBoost + bonusFromCounters; } @Override public String toString() { - return TextUtil.concatWithSpace("c:"+String.valueOf(currentValue),"tb:"+String.valueOf(tempBoost), "spb:"+String.valueOf(semiPermanentBoost),"bfc:"+String.valueOf(bonusFromCounters)); + return TextUtil.concatWithSpace("c:"+ currentValue,"tb:"+ tempBoost,"bfc:"+ bonusFromCounters); } } public final StatBreakdown getUnswitchedToughnessBreakdown() { - return new StatBreakdown(getCurrentToughness(), getTempToughnessBoost(), getSemiPermanentToughnessBoost(), getToughnessBonusFromCounters()); + return new StatBreakdown(getCurrentToughness(), getTempToughnessBoost(), getToughnessBonusFromCounters()); } public final int getUnswitchedToughness() { return getUnswitchedToughnessBreakdown().getTotal(); @@ -3465,62 +3456,44 @@ public class Card extends GameEntity implements Comparable { // for cards like Giant Growth, etc. public final int getTempPowerBoost() { - return tempPowerBoost; + int result = 0; + for (Pair pair : boostPT.values()) { + if (pair.getLeft() != null) { + result += pair.getLeft(); + } + } + return result; } public final int getTempToughnessBoost() { - return tempToughnessBoost; - } - - public final void addTempPowerBoost(final int n) { - if (n == 0) { return; } - tempPowerBoost += n; - currentState.getView().updatePower(this); - } - - public final void addTempToughnessBoost(final int n) { - if (n == 0) { return; } - tempToughnessBoost += n; - currentState.getView().updateToughness(this); - } - - // for cards like Glorious Anthem, etc. - public final int getSemiPermanentPowerBoost() { - return semiPermanentPowerBoost; - } - - public final int getSemiPermanentToughnessBoost() { - return semiPermanentToughnessBoost; - } - - public final void addSemiPermanentPowerBoost(final int n, final boolean updateViewImmediately) { - if (n == 0) { return; } - semiPermanentPowerBoost += n; - if (updateViewImmediately) { - currentState.getView().updatePower(this); + int result = 0; + for (Pair pair : boostPT.values()) { + if (pair.getRight() != null) { + result += pair.getRight(); + } } + return result; } - public final void addSemiPermanentToughnessBoost(final int n, final boolean updateViewImmediately) { - if (n == 0) { return; } - semiPermanentToughnessBoost += n; - if (updateViewImmediately) { - currentState.getView().updateToughness(this); + public void addPTBoost(final Integer power, final Integer toughness, final long timestamp) { + boostPT.put(timestamp, Pair.of(power, toughness)); + } + + public void removePTBoost(final long timestamp) { + boostPT.remove(timestamp); + } + + public Map> getPTBoostMap() { + return ImmutableMap.copyOf(boostPT); + } + + public void setPTBoost(Map> map) { + this.boostPT.clear(); + for (Map.Entry> e : map.entrySet()) { + this.boostPT.put(e.getKey(), Pair.of(e.getValue().getLeft(), e.getValue().getRight())); } } - public final void setSemiPermanentPowerBoost(final int n) { - if (semiPermanentPowerBoost == n) { return; } - semiPermanentPowerBoost = n; - currentState.getView().updatePower(this); - } - - public final void setSemiPermanentToughnessBoost(final int n) { - if (semiPermanentToughnessBoost == n) { return; } - semiPermanentToughnessBoost = n; - currentState.getView().updateToughness(this); - } - public final boolean isUntapped() { return !tapped; } @@ -4810,7 +4783,7 @@ public class Card extends GameEntity implements Comparable { CardCollection newCardsInCommand = (CardCollection)getGame().getCardsIn(ZoneType.Command); newCardsInCommand.removeAll(cardsInCommand); if (!newCardsInCommand.isEmpty()) { - newCardsInCommand.get(0).setSVar("PreventedDamage", "Number$" + Integer.toString(dmgToBePrevented)); + newCardsInCommand.get(0).setSVar("PreventedDamage", "Number$" + dmgToBePrevented); } } subtractPreventNextDamageWithEffect(shieldSource, restDamage); @@ -5105,7 +5078,7 @@ public class Card extends GameEntity implements Comparable { addChangedCardTypes(new CardType(Collections.singletonList("Aura")), new CardType(Collections.singletonList("Creature")), false, false, false, false, false, false, true, bestowTimestamp, updateView); - addChangedCardKeywords(Collections.singletonList("Enchant creature"), Lists.newArrayList(), + addChangedCardKeywords(Collections.singletonList("Enchant creature"), Lists.newArrayList(), false, false, bestowTimestamp, updateView); } @@ -5409,7 +5382,7 @@ public class Card extends GameEntity implements Comparable { switch (kw.getOriginal()) { case "Shroud": StringBuilder sb = new StringBuilder(); - sb.append("Can target CardUID_").append(String.valueOf(getId())); + sb.append("Can target CardUID_").append(getId()); sb.append(" with spells and abilities as though it didn't have shroud."); if (sa.getActivatingPlayer() == null) { System.err.println("Unexpected behavior: SA activator was null when trying to determine if the activating player could target a card with Shroud. SA host card = " + source + ", SA = " + sa); @@ -5472,9 +5445,7 @@ public class Card extends GameEntity implements Comparable { } // check valid - if (!isValid(tgt.getValidTgts(), aura.getController(), aura, sa)) { - return false; - } + return isValid(tgt.getValidTgts(), aura.getController(), aura, sa); } return true; @@ -5482,18 +5453,12 @@ public class Card extends GameEntity implements Comparable { @Override protected final boolean canBeEquippedBy(final Card equip) { - if (!isCreature() || !isInPlay()) { - return false; - } - return true; + return isCreature() && isInPlay(); } @Override protected boolean canBeFortifiedBy(final Card fort) { - if (!isLand() || !isInPlay() || fort.isLand()) { - return false; - } - return true; + return isLand() && isInPlay() && !fort.isLand(); } /* (non-Javadoc) @@ -5752,11 +5717,7 @@ public class Card extends GameEntity implements Comparable { } } - if (!getController().canSacrificeBy(source)) { - return false; - } - - return true; + return getController().canSacrificeBy(source); } public CardRules getRules() { @@ -6155,10 +6116,7 @@ public class Card extends GameEntity implements Comparable { if (hasKeyword(Keyword.FLASH)) { return true; } - if (withFlash.containsValue(p)) { - return true; - } - return false; + return withFlash.containsValue(p); } public void addWithFlash(Long timestamp, Iterable players) { @@ -6195,11 +6153,7 @@ public class Card extends GameEntity implements Comparable { return false; } - if (!getOwner().canDiscardBy(sa)) { - return false; - } - - return true; + return getOwner().canDiscardBy(sa); } public void addAbilityActivated(SpellAbility ability) { diff --git a/forge-game/src/main/java/forge/game/card/CardFactory.java b/forge-game/src/main/java/forge/game/card/CardFactory.java index 2a69b3e4567..98dab46962d 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactory.java +++ b/forge-game/src/main/java/forge/game/card/CardFactory.java @@ -645,7 +645,7 @@ public class CardFactory { Trigger t = null; if (sa.isWrapper()) { // copy trigger? - t = ((WrappedAbility) sa).getTrigger(); + t = sa.getTrigger(); } else { // some keyword ability, e.g. Exalted, Annihilator return sa.copy(); } @@ -677,7 +677,7 @@ public class CardFactory { WrappedAbility wrapperAbility = new WrappedAbility(t, trig, ((WrappedAbility) sa).getDecider()); wrapperAbility.setTrigger(true); - wrapperAbility.setMandatory(((WrappedAbility) sa).isMandatory()); + wrapperAbility.setMandatory(sa.isMandatory()); wrapperAbility.setDescription(wrapperAbility.getStackDescription()); t.setTriggeredSA(wrapperAbility); return wrapperAbility; @@ -774,7 +774,7 @@ public class CardFactory { // triggers to add to clone if (sa.hasParam("AddTriggers")) { - for (final String s : Arrays.asList(sa.getParam("AddTriggers").split(","))) { + for (final String s : sa.getParam("AddTriggers").split(",")) { if (origSVars.containsKey(s)) { final String actualTrigger = origSVars.get(s); final Trigger parsedTrigger = TriggerHandler.parseTrigger(actualTrigger, out, true); @@ -786,7 +786,7 @@ public class CardFactory { // SVars to add to clone if (sa.hasParam("AddSVars") || sa.hasParam("GainTextSVars")) { final String str = sa.getParamOrDefault("GainTextSVars", sa.getParam("AddSVars")); - for (final String s : Arrays.asList(str.split(","))) { + for (final String s : str.split(",")) { if (origSVars.containsKey(s)) { final String actualsVar = origSVars.get(s); state.setSVar(s, actualsVar); @@ -797,7 +797,7 @@ public class CardFactory { // abilities to add to clone if (sa.hasParam("AddAbilities") || sa.hasParam("GainTextAbilities")) { final String str = sa.getParamOrDefault("GainTextAbilities", sa.getParam("AddAbilities")); - for (final String s : Arrays.asList(str.split(","))) { + for (final String s : str.split(",")) { if (origSVars.containsKey(s)) { final String actualAbility = origSVars.get(s); final SpellAbility grantedAbility = AbilityFactory.getAbility(actualAbility, out); diff --git a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java index bf22da56bb6..3c2413b6ed6 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -147,7 +147,7 @@ public class CardFactoryUtil { sbCost.append("— "); } // get rid of the ": " at the end - sbCost.append(costDesc.substring(0, costDesc.length() - 2)); + sbCost.append(costDesc, 0, costDesc.length() - 2); StringBuilder sb = new StringBuilder(); sb.append("ST$ SetState | Cost$ ").append(costStr).append(" | CostDesc$ ").append(sbCost); @@ -292,11 +292,7 @@ public class CardFactoryUtil { * @return a boolean. */ public static boolean isCounterable(final Card c) { - if (c.hasKeyword("CARDNAME can't be countered.") || !c.getCanCounter()) { - return false; - } - - return true; + return !c.hasKeyword("CARDNAME can't be countered.") && c.getCanCounter(); } /** @@ -318,7 +314,7 @@ public class CardFactoryUtil { for (KeywordInterface k : c.getKeywords()) { final String o = k.getOriginal(); if (o.startsWith("CantBeCounteredBy")) { - final String m[] = o.split(":"); + final String[] m = o.split(":"); if (sa.isValid(m[1].split(","), c.getController(), c, null)) { return false; } @@ -2186,12 +2182,12 @@ public class CardFactoryUtil { final String abStringAfflict = "DB$ LoseLife | Defined$ TriggeredDefendingPlayer" + " | LifeAmount$ " + n; - final Trigger afflictTrigger = TriggerHandler.parseTrigger(trigStr.toString(), card, intrinsic); + final Trigger afflictTrigger = TriggerHandler.parseTrigger(trigStr, card, intrinsic); afflictTrigger.setOverridingAbility(AbilityFactory.getAbility(abStringAfflict, card)); inst.addTrigger(afflictTrigger); } else if (keyword.startsWith("Afterlife")) { - final String k[] = keyword.split(":"); + final String[] k = keyword.split(":"); final String name = StringUtils.join(k, " "); final StringBuilder sb = new StringBuilder(); @@ -2435,7 +2431,7 @@ public class CardFactoryUtil { final String effect = "DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | " + "CounterNum$ 1 | Evolve$ True"; - final Trigger trigger = TriggerHandler.parseTrigger(trigStr.toString(), card, intrinsic); + final Trigger trigger = TriggerHandler.parseTrigger(trigStr, card, intrinsic); trigger.setOverridingAbility(AbilityFactory.getAbility(effect, card)); inst.addTrigger(trigger); @@ -2731,7 +2727,7 @@ public class CardFactoryUtil { " | TriggerDescription$ Melee (" + inst.getReminderText() + ")"; final String effect = "DB$ Pump | Defined$ TriggeredAttackerLKICopy | NumAtt$ MeleeX | NumDef$ MeleeX"; - final Trigger trigger = TriggerHandler.parseTrigger(trigStr.toString(), card, intrinsic); + final Trigger trigger = TriggerHandler.parseTrigger(trigStr, card, intrinsic); SpellAbility sa = AbilityFactory.getAbility(effect, card); sa.setSVar("MeleeX", "TriggeredPlayersDefenders$Amount"); @@ -2746,7 +2742,7 @@ public class CardFactoryUtil { final String effect = "DB$ PutCounter | CounterType$ P1P1 | CounterNum$ 1" + " | ValidTgts$ Creature.attacking+powerLTX" + " | TgtPrompt$ Select target attacking creature with less power"; - final Trigger trigger = TriggerHandler.parseTrigger(trigStr.toString(), card, intrinsic); + final Trigger trigger = TriggerHandler.parseTrigger(trigStr, card, intrinsic); SpellAbility sa = AbilityFactory.getAbility(effect, card); sa.setSVar("X", "Count$CardPower"); @@ -2854,7 +2850,7 @@ public class CardFactoryUtil { final String trigStr = "Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Secondary$ True" + " | TriggerZones$ Battlefield | TriggerDescription$ Poisonous " + n + " (" + inst.getReminderText() + ")"; - final Trigger parsedTrigger = TriggerHandler.parseTrigger(trigStr.toString(), card, intrinsic); + final Trigger parsedTrigger = TriggerHandler.parseTrigger(trigStr, card, intrinsic); final String effect = "DB$ Poison | Defined$ TriggeredTarget | Num$ " + n; parsedTrigger.setOverridingAbility(AbilityFactory.getAbility(effect, card)); @@ -2902,7 +2898,7 @@ public class CardFactoryUtil { final String effect = "DB$ Pump | Defined$ TriggeredAttackerLKICopy" + " | NumAtt$ Rampage" + n + " | NumDef$ Rampage" + n; - final Trigger trigger = TriggerHandler.parseTrigger(trigStr.toString(), card, intrinsic); + final Trigger trigger = TriggerHandler.parseTrigger(trigStr, card, intrinsic); SpellAbility sa = AbilityFactory.getAbility(effect, card); sa.setSVar("Rampage" + n, "SVar$RampageCount/Times." + n); @@ -3070,7 +3066,7 @@ public class CardFactoryUtil { inst.addTrigger(parsedTrigger); } else if (keyword.startsWith("Suspend")) { //upkeep trigger - StringBuilder upkeepTrig = new StringBuilder();; + StringBuilder upkeepTrig = new StringBuilder(); upkeepTrig.append("Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Exile "); upkeepTrig.append(" | IsPresent$ Card.Self+suspended | PresentZone$ Exile"); @@ -3201,7 +3197,7 @@ public class CardFactoryUtil { SpellAbility saDelay = AbilityFactory.getAbility(strDelay, card); saDelay.setAdditionalAbility("Execute", (AbilitySub) AbilityFactory.getAbility(strSac, card)); - final Trigger trigger = TriggerHandler.parseTrigger(strTrig.toString(), card, intrinsic); + final Trigger trigger = TriggerHandler.parseTrigger(strTrig, card, intrinsic); trigger.setOverridingAbility(saDelay); inst.addTrigger(trigger); } @@ -3404,7 +3400,7 @@ public class CardFactoryUtil { sb.append("| ValidStackSa$ Spell.Flashback | Description$ Flashback"); if (keyword.contains(":")) { - final String k[] = keyword.split(":"); + final String[] k = keyword.split(":"); final Cost cost = new Cost(k[1], false); sb.append( cost.isOnlyManaCost() ? " " : "—"); @@ -3896,7 +3892,7 @@ public class CardFactoryUtil { // Add the Epic effect as a subAbility String dbStr = "DB$ Effect | Triggers$ EpicTrigger | SVars$ EpicCopy | StaticAbilities$ EpicCantBeCast | Duration$ Permanent | Epic$ True"; - final AbilitySub newSA = (AbilitySub) AbilityFactory.getAbility(dbStr.toString(), card); + final AbilitySub newSA = (AbilitySub) AbilityFactory.getAbility(dbStr, card); newSA.setSVar("EpicCantBeCast", "Mode$ CantBeCast | ValidCard$ Card | Caster$ You | EffectZone$ Command | Description$ For the rest of the game, you can't cast spells."); newSA.setSVar("EpicTrigger", "Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ EpicCopy | TriggerDescription$ " @@ -3964,7 +3960,7 @@ public class CardFactoryUtil { // don't use SimpleString there because it does has "and" between cost i dont want that costStr = cost.toString(); // but now it has ": " at the end i want to remove - sb.append("| CostDesc$ ").append(costStr.substring(0, costStr.length() - 2)); + sb.append("| CostDesc$ ").append(costStr, 0, costStr.length() - 2); if (!cost.isOnlyManaCost()) { sb.append("."); } @@ -4542,7 +4538,7 @@ public class CardFactoryUtil { final StringBuilder sbValid = new StringBuilder(); if (!keyword.equals("Hexproof")) { - final String k[] = keyword.split(":"); + final String[] k = keyword.split(":"); sbDesc.append(" from ").append(k[2]); sbValid.append("| ValidSource$ ").append(k[1]); diff --git a/forge-game/src/main/java/forge/game/card/CardPlayOption.java b/forge-game/src/main/java/forge/game/card/CardPlayOption.java index 3c53c4d0e35..b7531dde10d 100644 --- a/forge-game/src/main/java/forge/game/card/CardPlayOption.java +++ b/forge-game/src/main/java/forge/game/card/CardPlayOption.java @@ -11,7 +11,7 @@ public final class CardPlayOption { /** Indicates the mana cost must be paid. */ YES, /** Indicates the mana cost may not be paid. */ - NO; + NO } private final Player player; diff --git a/forge-game/src/main/java/forge/game/card/CardPredicates.java b/forge-game/src/main/java/forge/game/card/CardPredicates.java index 5d5a415af5c..4f4d00b2010 100644 --- a/forge-game/src/main/java/forge/game/card/CardPredicates.java +++ b/forge-game/src/main/java/forge/game/card/CardPredicates.java @@ -214,7 +214,7 @@ public final class CardPredicates { return c.canBeSacrificedBy(sa); } }; - }; + } public static final Predicate canBeAttached(final Card aura) { return new Predicate() { @@ -223,7 +223,7 @@ public final class CardPredicates { return c.canBeAttached(aura); } }; - }; + } public static final Predicate isColor(final byte color) { return new Predicate() { diff --git a/forge-game/src/main/java/forge/game/card/CardProperty.java b/forge-game/src/main/java/forge/game/card/CardProperty.java index 74112fa659e..1411664dd18 100644 --- a/forge-game/src/main/java/forge/game/card/CardProperty.java +++ b/forge-game/src/main/java/forge/game/card/CardProperty.java @@ -27,8 +27,7 @@ import java.util.List; public class CardProperty { - public static boolean cardHasProperty(Card card, String property, Player sourceController, Card source, - SpellAbility spellAbility) { + public static boolean cardHasProperty(Card card, String property, Player sourceController, Card source, SpellAbility spellAbility) { final Game game = card.getGame(); final Combat combat = game.getCombat(); // lki can't be null but it does return this @@ -40,7 +39,7 @@ public class CardProperty { String name = TextUtil.fastReplace(property.substring(5), ";", ","); // for some legendary cards if (!card.sharesNameWith(name)) { return false; - } + } } else if (property.startsWith("notnamed")) { if (card.sharesNameWith(property.substring(8))) { return false; @@ -1115,9 +1114,9 @@ public class CardProperty { return false; } } else if (property.startsWith("DrawnThisTurn")) { - if (!card.getDrawnThisTurn()) { - return false; - } + if (!card.getDrawnThisTurn()) { + return false; + } } else if (property.startsWith("enteredBattlefieldThisTurn")) { if (!(card.getTurnInZone() == game.getPhaseHandler().getTurn())) { return false; @@ -1749,7 +1748,7 @@ public class CardProperty { final ZoneType realZone = ZoneType.smartValueOf(strZone); // lki last zone does fall back to this zone final Zone lkiZone = lki.getLastKnownZone(); - + if (lkiZone == null || !lkiZone.is(realZone)) { return false; } @@ -1773,4 +1772,4 @@ public class CardProperty { return true; } -} +} \ No newline at end of file diff --git a/forge-game/src/main/java/forge/game/card/CardState.java b/forge-game/src/main/java/forge/game/card/CardState.java index dbe4ca1546b..b2b4d60e72a 100644 --- a/forge-game/src/main/java/forge/game/card/CardState.java +++ b/forge-game/src/main/java/forge/game/card/CardState.java @@ -471,9 +471,7 @@ public class CardState extends GameObject { view.updateFoilIndex(card.getState(CardStateName.Original)); } public final void removeSVar(final String var) { - if (sVars.containsKey(var)) { - sVars.remove(var); - } + sVars.remove(var); } public final int getFoil() { diff --git a/forge-game/src/main/java/forge/game/card/CardUtil.java b/forge-game/src/main/java/forge/game/card/CardUtil.java index f96d0f8af38..8d0c2000fff 100644 --- a/forge-game/src/main/java/forge/game/card/CardUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardUtil.java @@ -80,7 +80,7 @@ public final class CardUtil { } public static boolean isStackingKeyword(final String keyword) { - String kw = new String(keyword); + String kw = keyword; if (kw.startsWith("HIDDEN")) { kw = kw.substring(7); } @@ -251,8 +251,8 @@ public final class CardUtil { } // lock in the current P/T without bonus from counters - newCopy.setBasePower(in.getCurrentPower() + in.getTempPowerBoost() + in.getSemiPermanentPowerBoost()); - newCopy.setBaseToughness(in.getCurrentToughness() + in.getTempToughnessBoost() + in.getSemiPermanentToughnessBoost()); + newCopy.setBasePower(in.getCurrentPower() + in.getTempPowerBoost()); + newCopy.setBaseToughness(in.getCurrentToughness() + in.getTempToughnessBoost()); newCopy.setCounters(Maps.newEnumMap(in.getCounters())); @@ -345,7 +345,7 @@ public final class CardUtil { // a nice entry point with minimum parameters public static Set getReflectableManaColors(final SpellAbility sa) { - return getReflectableManaColors(sa, sa, Sets.newHashSet(), new CardCollection()); + return getReflectableManaColors(sa, sa, Sets.newHashSet(), new CardCollection()); } private static Set getReflectableManaColors(final SpellAbility abMana, final SpellAbility sa, @@ -390,9 +390,7 @@ public final class CardUtil { // remove anything cards that is already in parents for (final Card p : parents) { - if (cards.contains(p)) { - cards.remove(p); - } + cards.remove(p); } if ((cards.size() == 0) && !reflectProperty.equals("Produced")) { @@ -506,9 +504,7 @@ public final class CardUtil { // Remove cards already targeted final List targeted = Lists.newArrayList(ability.getTargets().getTargetCards()); for (final Card c : targeted) { - if (choices.contains(c)) { - choices.remove(c); - } + choices.remove(c); } // Remove cards exceeding total CMC diff --git a/forge-game/src/main/java/forge/game/card/CardView.java b/forge-game/src/main/java/forge/game/card/CardView.java index 5afd53b06ca..8762d2816d2 100644 --- a/forge-game/src/main/java/forge/game/card/CardView.java +++ b/forge-game/src/main/java/forge/game/card/CardView.java @@ -345,10 +345,7 @@ public class CardView extends GameEntityView { return true; } col = get(TrackableProperty.PlayerMayLookTemp); - if (col != null && col.contains(pv)) { - return true; - } - return false; + return col != null && col.contains(pv); } void setPlayerMayLook(Player p, boolean mayLook, boolean temp) { TrackableProperty prop = temp ? TrackableProperty.PlayerMayLookTemp : TrackableProperty.PlayerMayLook; @@ -380,7 +377,7 @@ public class CardView extends GameEntityView { return Iterables.any(viewers, new Predicate() { public final boolean apply(final PlayerView input) { return canBeShownTo(input); - }; + } }); } @@ -462,10 +459,7 @@ public class CardView extends GameEntityView { if (mindSlaveMaster != null && canFaceDownBeShownTo(mindSlaveMaster)) { return true; } - if (isInZone(EnumSet.of(ZoneType.Battlefield, ZoneType.Stack, ZoneType.Sideboard)) && getController().equals(viewer)) { - return true; - } - return false; + return isInZone(EnumSet.of(ZoneType.Battlefield, ZoneType.Stack, ZoneType.Sideboard)) && getController().equals(viewer); } public FCollectionView getEncodedCards() { @@ -1067,7 +1061,7 @@ public class CardView extends GameEntityView { TrackableCollection views = get(key); if (views == null) { views = new TrackableCollection(); - views.add(cardToAdd.getView());; + views.add(cardToAdd.getView()); set(key, views); } else if (views.add(cardToAdd.getView())) { diff --git a/forge-game/src/main/java/forge/game/card/token/TokenInfo.java b/forge-game/src/main/java/forge/game/card/token/TokenInfo.java index 5d4ff3b79aa..4abd4a7447e 100644 --- a/forge-game/src/main/java/forge/game/card/token/TokenInfo.java +++ b/forge-game/src/main/java/forge/game/card/token/TokenInfo.java @@ -320,7 +320,7 @@ public class TokenInfo { if (!CardUtil.isKeywordModifiable(o)) { continue; } - String r = new String(o); + String r = o; // replace types for (final Map.Entry e : typeMap.entrySet()) { final String key = e.getKey(); diff --git a/forge-game/src/main/java/forge/game/combat/AttackConstraints.java b/forge-game/src/main/java/forge/game/combat/AttackConstraints.java index c3420217e83..f7b59f9413f 100644 --- a/forge-game/src/main/java/forge/game/combat/AttackConstraints.java +++ b/forge-game/src/main/java/forge/game/combat/AttackConstraints.java @@ -94,7 +94,7 @@ public class AttackConstraints { final int globalMax = globalRestrictions.getMax(); final int myMax = Ints.min(globalMax == -1 ? Integer.MAX_VALUE : globalMax, possibleAttackers.size()); if (myMax == 0) { - return Pair.of(Collections.emptyMap(), Integer.valueOf(0)); + return Pair.of(Collections.emptyMap(), Integer.valueOf(0)); } final MapToAmount> possible = new LinkedHashMapToAmount>(); @@ -163,8 +163,8 @@ public class AttackConstraints { // Now try all others (plus empty attack) and count their violations final FCollection> legalAttackers = collectLegalAttackers(reqs, myMax); possible.putAll(Maps.asMap(legalAttackers.asSet(), FN_COUNT_VIOLATIONS)); - if (countViolations(Collections.emptyMap()) != -1) { - possible.put(Collections.emptyMap(), countViolations(Collections.emptyMap())); + if (countViolations(Collections.emptyMap()) != -1) { + possible.put(Collections.emptyMap(), countViolations(Collections.emptyMap())); } // take the case with the fewest violations @@ -173,7 +173,7 @@ public class AttackConstraints { private final FCollection> collectLegalAttackers(final List reqs, final int maximum) { return new FCollection> - (collectLegalAttackers(Collections.emptyMap(), deepClone(reqs), new CardCollection(), maximum)); + (collectLegalAttackers(Collections.emptyMap(), deepClone(reqs), new CardCollection(), maximum)); } private final List> collectLegalAttackers(final Map attackers, final List reqs, final CardCollection reserved, final int maximum) { diff --git a/forge-game/src/main/java/forge/game/combat/AttackRequirement.java b/forge-game/src/main/java/forge/game/combat/AttackRequirement.java index c02701595d3..8c40d44d7e6 100644 --- a/forge-game/src/main/java/forge/game/combat/AttackRequirement.java +++ b/forge-game/src/main/java/forge/game/combat/AttackRequirement.java @@ -80,7 +80,7 @@ public class AttackRequirement { for (Card pw : CardLists.filter(c.getController().getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANESWALKERS)) { // Add the attack alternatives that suffice (planeswalkers that can be attacked instead of the player) if (!defenderSpecificAlternatives.containsKey(c.getController())) { - defenderSpecificAlternatives.put(c.getController(), Lists.newArrayList()); + defenderSpecificAlternatives.put(c.getController(), Lists.newArrayList()); } defenderSpecificAlternatives.get(c.getController()).add(pw); } @@ -147,7 +147,7 @@ public class AttackRequirement { int violations = 0; // first. check to see if "must attack X or Y with at least one creature" requirements are satisfied - List toRemoveFromDefSpecific = Lists.newArrayList(); + List toRemoveFromDefSpecific = Lists.newArrayList(); if (!defenderOrPWSpecific.isEmpty()) { for (GameEntity def : defenderOrPWSpecific.keySet()) { if (defenderSpecificAlternatives.containsKey(def)) { diff --git a/forge-game/src/main/java/forge/game/combat/Combat.java b/forge-game/src/main/java/forge/game/combat/Combat.java index bc5441689ea..4299ce1eede 100644 --- a/forge-game/src/main/java/forge/game/combat/Combat.java +++ b/forge-game/src/main/java/forge/game/combat/Combat.java @@ -54,8 +54,8 @@ public class Combat { private final FCollection attackableEntries = new FCollection(); // Keyed by attackable defender (player or planeswalker) - private final Multimap attackedByBands = Multimaps.synchronizedMultimap(ArrayListMultimap.create()); - private final Multimap blockedBands = Multimaps.synchronizedMultimap(ArrayListMultimap.create()); + private final Multimap attackedByBands = Multimaps.synchronizedMultimap(ArrayListMultimap.create()); + private final Multimap blockedBands = Multimaps.synchronizedMultimap(ArrayListMultimap.create()); private final Map defendingDamageMap = Maps.newHashMap(); @@ -353,7 +353,7 @@ public class Combat { public final boolean isBlocked(final Card attacker) { AttackingBand band = getBandOfAttacker(attacker); - return band == null ? false : Boolean.TRUE.equals(band.isBlocked()); + return band != null && Boolean.TRUE.equals(band.isBlocked()); } // Some cards in Alpha may UNBLOCK an attacker, so second parameter is not always-true @@ -804,7 +804,7 @@ public class Combat { for (final Entry entry : defendingDamageMap.entrySet()) { GameEntity defender = getDefenderByAttacker(entry.getKey()); if (defender instanceof Player) { // player - ((Player) defender).addCombatDamage(entry.getValue(), entry.getKey(), dealtDamageTo, preventMap, counterTable); + defender.addCombatDamage(entry.getValue(), entry.getKey(), dealtDamageTo, preventMap, counterTable); } else if (defender instanceof Card) { // planeswalker ((Card) defender).getController().addCombatDamage(entry.getValue(), entry.getKey(), dealtDamageTo, preventMap, counterTable); @@ -843,7 +843,7 @@ public class Combat { public final boolean isUnblocked(final Card att) { AttackingBand band = getBandOfAttacker(att); - return band == null ? false : Boolean.FALSE.equals(band.isBlocked()); + return band != null && Boolean.FALSE.equals(band.isBlocked()); } public final CardCollection getUnblockedAttackers() { @@ -875,7 +875,7 @@ public class Combat { public boolean isBlocking(Card blocker) { if (blockedBands.containsValue(blocker)) { return true; // is blocking something at the moment - }; + } CombatLki lki = lkiCache.get(blocker); return null != lki && !lki.isAttacker; // was blocking something anyway diff --git a/forge-game/src/main/java/forge/game/combat/CombatLki.java b/forge-game/src/main/java/forge/game/combat/CombatLki.java index 128718a3d25..682265f0a18 100644 --- a/forge-game/src/main/java/forge/game/combat/CombatLki.java +++ b/forge-game/src/main/java/forge/game/combat/CombatLki.java @@ -14,7 +14,7 @@ public class CombatLki { public CombatLki(boolean isAttacker, FCollectionView relatedBands) { this.isAttacker = isAttacker; - this.relatedBands = new FCollection(relatedBands);; + this.relatedBands = new FCollection(relatedBands); } public AttackingBand getFirstBand() { diff --git a/forge-game/src/main/java/forge/game/combat/CombatUtil.java b/forge-game/src/main/java/forge/game/combat/CombatUtil.java index 1b88c16440f..5f020665993 100644 --- a/forge-game/src/main/java/forge/game/combat/CombatUtil.java +++ b/forge-game/src/main/java/forge/game/combat/CombatUtil.java @@ -426,11 +426,7 @@ public class CombatUtil { } final List list = blocker.getController().getCreaturesInPlay(); - if (list.size() < 2 && blocker.hasKeyword("CARDNAME can't attack or block alone.")) { - return false; - } - - return true; + return list.size() >= 2 || !blocker.hasKeyword("CARDNAME can't attack or block alone."); } public static boolean canBlockMoreCreatures(final Card blocker, final CardCollectionView blockedBy) { @@ -500,8 +496,7 @@ public class CombatUtil { // Landwalk if (isUnblockableFromLandwalk(attacker, defender)) { - if (CardLists.getAmountOfKeyword(defender.getCreaturesInPlay(), "CARDNAME can block creatures with landwalk abilities as though they didn't have those abilities.") == 0) - return false; + return CardLists.getAmountOfKeyword(defender.getCreaturesInPlay(), "CARDNAME can block creatures with landwalk abilities as though they didn't have those abilities.") != 0; } return true; @@ -518,7 +513,7 @@ public class CombatUtil { IGNORE_LANDWALK_KEYWORDS = new String[size]; for (int i = 0; i < size; i++) { final String basic = MagicColor.Constant.BASIC_LANDS.get(i); - final String landwalk = basic + "walk";; + final String landwalk = basic + "walk"; LANDWALK_KEYWORDS[i] = landwalk; SNOW_LANDWALK_KEYWORDS[i] = "Snow " + landwalk.toLowerCase(); IGNORE_LANDWALK_KEYWORDS[i] = "May be blocked as though it doesn't have " + landwalk + "."; @@ -1053,7 +1048,7 @@ public class CombatUtil { for (KeywordInterface inst : blocker.getKeywords()) { String k = inst.getOriginal(); if (k.startsWith("IfReach")) { - String n[] = k.split(":"); + String[] n = k.split(":"); if (attacker.getType().hasCreatureType(n[1])) { stillblock = true; break; @@ -1114,9 +1109,7 @@ public class CombatUtil { System.out.println("Warning: it was impossible to deduce the defending player in CombatUtil#canAttackerBeBlockedWithAmount, returning 'true' (safest default)."); return true; } - if (amount < defender.getCreaturesInPlay().size()) { - return false; - } + return amount >= defender.getCreaturesInPlay().size(); } return true; diff --git a/forge-game/src/main/java/forge/game/combat/GlobalAttackRestrictions.java b/forge-game/src/main/java/forge/game/combat/GlobalAttackRestrictions.java index cde3c921347..9c5f3b810bf 100644 --- a/forge-game/src/main/java/forge/game/combat/GlobalAttackRestrictions.java +++ b/forge-game/src/main/java/forge/game/combat/GlobalAttackRestrictions.java @@ -45,7 +45,7 @@ public class GlobalAttackRestrictions { private GlobalAttackRestrictionViolations getViolations(final Map attackers, final CardCollection possibleAttackers, final boolean returnQuickly) { final int nTooMany = max < 0 ? 0 : attackers.size() - max; if (returnQuickly && nTooMany > 0) { - return new GlobalAttackRestrictionViolations(nTooMany, MapToAmountUtil.emptyMap(), MapToAmountUtil.emptyMap()); + return new GlobalAttackRestrictionViolations(nTooMany, MapToAmountUtil.emptyMap(), MapToAmountUtil.emptyMap()); } final MapToAmount defenderTooMany = new LinkedHashMapToAmount(defenderMax.size()); diff --git a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java index 5f40f259d76..75d87c49e64 100644 --- a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java +++ b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java @@ -13,7 +13,6 @@ import forge.game.keyword.KeywordInterface; import forge.game.mana.ManaCostBeingPaid; import forge.game.player.Player; import forge.game.spellability.AbilityActivated; -import forge.game.spellability.Spell; import forge.game.spellability.SpellAbility; import forge.game.spellability.TargetChoices; import forge.game.staticability.StaticAbility; @@ -40,7 +39,7 @@ public class CostAdjustment { Cost result = cost.copy(); boolean isStateChangeToFaceDown = false; - if (sa.isSpell() && ((Spell) sa).isCastFaceDown()) { + if (sa.isSpell() && sa.isCastFaceDown()) { // Turn face down to apply cost modifiers correctly host.turnFaceDownNoUpdate(); isStateChangeToFaceDown = true; @@ -159,7 +158,7 @@ public class CostAdjustment { boolean isStateChangeToFaceDown = false; if (sa.isSpell()) { - if (((Spell) sa).isCastFaceDown()) { + if (sa.isCastFaceDown()) { // Turn face down to apply cost modifiers correctly originalCard.turnFaceDownNoUpdate(); isStateChangeToFaceDown = true; @@ -490,7 +489,7 @@ public class CostAdjustment { return false; } } else if (type.equals("MorphDown")) { - if (!sa.isSpell() || !((Spell) sa).isCastFaceDown()) { + if (!sa.isSpell() || !sa.isCastFaceDown()) { return false; } } @@ -546,9 +545,7 @@ public class CostAdjustment { } curSa = curSa.getSubAbility(); } - if (!targetValid) { - return false; - } + return targetValid; } return true; } diff --git a/forge-game/src/main/java/forge/game/cost/CostDiscard.java b/forge-game/src/main/java/forge/game/cost/CostDiscard.java index d788b0287f4..517b374b6b8 100644 --- a/forge-game/src/main/java/forge/game/cost/CostDiscard.java +++ b/forge-game/src/main/java/forge/game/cost/CostDiscard.java @@ -112,15 +112,11 @@ public class CostDiscard extends CostPartWithList { final Integer amount = this.convertAmount(); if (this.payCostFromSource()) { - if (!source.canBeDiscardedBy(ability)) { - return false; - } + return source.canBeDiscardedBy(ability); } else { if (type.equals("Hand")) { - if (!payer.canDiscardBy(ability)) { - return false; - } + return payer.canDiscardBy(ability); // this will always work } else if (type.equals("LastDrawn")) { @@ -159,7 +155,6 @@ public class CostDiscard extends CostPartWithList { } } } - return true; } diff --git a/forge-game/src/main/java/forge/game/cost/CostExert.java b/forge-game/src/main/java/forge/game/cost/CostExert.java index 60160d0d5f3..c9dc957a715 100644 --- a/forge-game/src/main/java/forge/game/cost/CostExert.java +++ b/forge-game/src/main/java/forge/game/cost/CostExert.java @@ -93,9 +93,7 @@ public class CostExert extends CostPartWithList { final Integer amount = this.convertAmount(); - if (!needsAnnoucement && (amount != null) && (typeList.size() < amount)) { - return false; - } + return needsAnnoucement || (amount == null) || (typeList.size() >= amount); } diff --git a/forge-game/src/main/java/forge/game/cost/CostExile.java b/forge-game/src/main/java/forge/game/cost/CostExile.java index 4e4f3dc8003..61a189b8731 100644 --- a/forge-game/src/main/java/forge/game/cost/CostExile.java +++ b/forge-game/src/main/java/forge/game/cost/CostExile.java @@ -146,9 +146,7 @@ public class CostExile extends CostPartWithList { break; } } - if (!foundPayable) { - return false; - } + return foundPayable; } return true; } diff --git a/forge-game/src/main/java/forge/game/cost/CostExileFromStack.java b/forge-game/src/main/java/forge/game/cost/CostExileFromStack.java index cf66f777abd..d04501e37f3 100644 --- a/forge-game/src/main/java/forge/game/cost/CostExileFromStack.java +++ b/forge-game/src/main/java/forge/game/cost/CostExileFromStack.java @@ -94,11 +94,7 @@ public class CostExileFromStack extends CostPart { list = CardLists.getValidCards(list, type.split(";"), payer, source, ability); final Integer amount = this.convertAmount(); - if ((amount != null) && (list.size() < amount)) { - return false; - } - - return true; + return (amount == null) || (list.size() >= amount); } diff --git a/forge-game/src/main/java/forge/game/cost/CostGainControl.java b/forge-game/src/main/java/forge/game/cost/CostGainControl.java index b77f91075ac..28940a73060 100644 --- a/forge-game/src/main/java/forge/game/cost/CostGainControl.java +++ b/forge-game/src/main/java/forge/game/cost/CostGainControl.java @@ -83,10 +83,7 @@ public class CostGainControl extends CostPartWithList { if (amount == null) { amount = AbilityUtils.calculateAmount(source, this.getAmount(), ability); } - if (typeList.size() < amount) { - return false; - } - return true; + return typeList.size() >= amount; } /* (non-Javadoc) diff --git a/forge-game/src/main/java/forge/game/cost/CostPartWithList.java b/forge-game/src/main/java/forge/game/cost/CostPartWithList.java index 495457493be..b934d3d0be7 100644 --- a/forge-game/src/main/java/forge/game/cost/CostPartWithList.java +++ b/forge-game/src/main/java/forge/game/cost/CostPartWithList.java @@ -144,7 +144,7 @@ public abstract class CostPartWithList extends CostPart { protected abstract Card doPayment(SpellAbility ability, Card targetCard); // Overload these two only together, set to true and perform payment on list protected boolean canPayListAtOnce() { return false; } - protected CardCollectionView doListPayment(SpellAbility ability, CardCollectionView targetCards) { return CardCollection.EMPTY; }; + protected CardCollectionView doListPayment(SpellAbility ability, CardCollectionView targetCards) { return CardCollection.EMPTY; } /** * TODO: Write javadoc for this method. diff --git a/forge-game/src/main/java/forge/game/cost/CostPutCardToLib.java b/forge-game/src/main/java/forge/game/cost/CostPutCardToLib.java index f70b1c8d188..5c55cea15e1 100644 --- a/forge-game/src/main/java/forge/game/cost/CostPutCardToLib.java +++ b/forge-game/src/main/java/forge/game/cost/CostPutCardToLib.java @@ -160,9 +160,7 @@ public class CostPutCardToLib extends CostPartWithList { break; } } - if (!foundPayable) { - return false; - } + return foundPayable; } return true; } diff --git a/forge-game/src/main/java/forge/game/cost/CostPutCounter.java b/forge-game/src/main/java/forge/game/cost/CostPutCounter.java index 3738d839398..63c64457ea2 100644 --- a/forge-game/src/main/java/forge/game/cost/CostPutCounter.java +++ b/forge-game/src/main/java/forge/game/cost/CostPutCounter.java @@ -140,9 +140,7 @@ public class CostPutCounter extends CostPartWithList { public final boolean canPay(final SpellAbility ability, final Player payer) { final Card source = ability.getHostCard(); if (this.payCostFromSource()) { - if (!source.canReceiveCounters(this.counter)) { - return false; - } + return source.canReceiveCounters(this.counter); } else { // 3 Cards have Put a -1/-1 Counter on a Creature you control. List typeList = CardLists.getValidCards(source.getGame().getCardsIn(ZoneType.Battlefield), @@ -150,12 +148,9 @@ public class CostPutCounter extends CostPartWithList { typeList = CardLists.filter(typeList, CardPredicates.canReceiveCounters(this.counter)); - if (typeList.isEmpty()) { - return false; - } + return !typeList.isEmpty(); } - return true; } /* diff --git a/forge-game/src/main/java/forge/game/cost/CostRemoveCounter.java b/forge-game/src/main/java/forge/game/cost/CostRemoveCounter.java index f74a892516d..7434d7add6f 100644 --- a/forge-game/src/main/java/forge/game/cost/CostRemoveCounter.java +++ b/forge-game/src/main/java/forge/game/cost/CostRemoveCounter.java @@ -133,9 +133,7 @@ public class CostRemoveCounter extends CostPartWithList { final Integer amount = this.convertAmount(); if (this.payCostFromSource()) { - if ((amount != null) && ((source.getCounters(cntrs) - amount) < 0)) { - return false; - } + return (amount == null) || ((source.getCounters(cntrs) - amount) >= 0); } else { List typeList; @@ -152,9 +150,7 @@ public class CostRemoveCounter extends CostPartWithList { for (Card c : typeList) { totalCounters += c.getCounters(cntrs); } - if (totalCounters >= amount) { - return true; - } + return totalCounters >= amount; } else { // (default logic) remove X counters from a single permanent diff --git a/forge-game/src/main/java/forge/game/cost/CostReturn.java b/forge-game/src/main/java/forge/game/cost/CostReturn.java index 11b9e8b236a..2a9d6603701 100644 --- a/forge-game/src/main/java/forge/game/cost/CostReturn.java +++ b/forge-game/src/main/java/forge/game/cost/CostReturn.java @@ -102,14 +102,9 @@ public class CostReturn extends CostPartWithList { typeList = CardLists.getValidCards(typeList, this.getType().split(";"), payer, source, ability); final Integer amount = this.convertAmount(); - if (!needsAnnoucement && amount != null && typeList.size() < amount) { - return false; - } - } else if (!source.isInPlay()) { - return false; - } + return needsAnnoucement || amount == null || typeList.size() >= amount; + } else return source.isInPlay(); - return true; } /* (non-Javadoc) diff --git a/forge-game/src/main/java/forge/game/cost/CostReveal.java b/forge-game/src/main/java/forge/game/cost/CostReveal.java index 0252203d1e6..b7d08ff1807 100644 --- a/forge-game/src/main/java/forge/game/cost/CostReveal.java +++ b/forge-game/src/main/java/forge/game/cost/CostReveal.java @@ -57,9 +57,7 @@ public class CostReveal extends CostPartWithList { final Integer amount = this.convertAmount(); if (this.payCostFromSource()) { - if (!source.isInZone(ZoneType.Hand)) { - return false; - } + return source.isInZone(ZoneType.Hand); } else if (this.getType().equals("Hand")) { return true; } else if (this.getType().equals("SameColor")) { @@ -85,14 +83,11 @@ public class CostReveal extends CostPartWithList { handList = modifiedHand; } handList = CardLists.getValidCards(handList, type.split(";"), payer, source, ability); - if ((amount != null) && (amount > handList.size())) { - // not enough cards in hand to pay - return false; - } + // not enough cards in hand to pay + return (amount == null) || (amount <= handList.size()); //System.out.println("revealcost - " + amount + type + handList); } - return true; } @Override diff --git a/forge-game/src/main/java/forge/game/cost/CostSacrifice.java b/forge-game/src/main/java/forge/game/cost/CostSacrifice.java index 46f121a07a2..0ac0cb3248a 100644 --- a/forge-game/src/main/java/forge/game/cost/CostSacrifice.java +++ b/forge-game/src/main/java/forge/game/cost/CostSacrifice.java @@ -103,19 +103,14 @@ public class CostSacrifice extends CostPartWithList { typeList = CardLists.filter(typeList, CardPredicates.canBeSacrificedBy(ability)); - if (!needsAnnoucement && (amount != null) && (typeList.size() < amount)) { - return false; - } + return needsAnnoucement || (amount == null) || (typeList.size() >= amount); // If amount is null, it's either "ALL" or "X" // if X is defined, it needs to be calculated and checked, if X is // choice, it can be Paid even if it's 0 } - else if (!source.canBeSacrificedBy(ability)) { - return false; - } + else return source.canBeSacrificedBy(ability); - return true; } @Override diff --git a/forge-game/src/main/java/forge/game/cost/CostTapType.java b/forge-game/src/main/java/forge/game/cost/CostTapType.java index e0e9b345f4e..4a400a3a4dc 100644 --- a/forge-game/src/main/java/forge/game/cost/CostTapType.java +++ b/forge-game/src/main/java/forge/game/cost/CostTapType.java @@ -150,11 +150,7 @@ public class CostTapType extends CostPartWithList { } final Integer amount = this.convertAmount(); - if ((typeList.size() == 0) || ((amount != null) && (typeList.size() < amount))) { - return false; - } - - return true; + return (typeList.size() != 0) && ((amount == null) || (typeList.size() >= amount)); } /* (non-Javadoc) diff --git a/forge-game/src/main/java/forge/game/cost/CostUnattach.java b/forge-game/src/main/java/forge/game/cost/CostUnattach.java index fb33a53ebf3..d4ab4bd8b76 100644 --- a/forge-game/src/main/java/forge/game/cost/CostUnattach.java +++ b/forge-game/src/main/java/forge/game/cost/CostUnattach.java @@ -74,21 +74,14 @@ public class CostUnattach extends CostPartWithList { final String type = this.getType(); if (type.equals("CARDNAME")) { - if (source.isEquipping()) { - return true; - } + return source.isEquipping(); } else if (type.equals("OriginalHost")) { Card originalEquipment = ability.getOriginalHost(); - if (originalEquipment.isEquipping()) { - return true; - } + return originalEquipment.isEquipping(); } else { - if (CardLists.getValidCards(source.getEquippedBy(), type, payer, source).size() > 0) { - return true; - } + return CardLists.getValidCards(source.getEquippedBy(), type, payer, source).size() > 0; } - return false; } public Card findCardToUnattach(final Card source, Player activator, SpellAbility ability) { diff --git a/forge-game/src/main/java/forge/game/cost/CostUntapType.java b/forge-game/src/main/java/forge/game/cost/CostUntapType.java index 7db801bc88f..b52634e00f8 100644 --- a/forge-game/src/main/java/forge/game/cost/CostUntapType.java +++ b/forge-game/src/main/java/forge/game/cost/CostUntapType.java @@ -89,10 +89,7 @@ public class CostUntapType extends CostPartWithList { typeList = CardLists.filter(typeList, Presets.TAPPED); final Integer amount = convertAmount(); - if ((typeList.size() == 0) || ((amount != null) && (typeList.size() < amount))) { - return false; - } - return true; + return (typeList.size() != 0) && ((amount == null) || (typeList.size() >= amount)); } @Override diff --git a/forge-game/src/main/java/forge/game/cost/ICostVisitor.java b/forge-game/src/main/java/forge/game/cost/ICostVisitor.java index 5112124012e..9ca192502b3 100644 --- a/forge-game/src/main/java/forge/game/cost/ICostVisitor.java +++ b/forge-game/src/main/java/forge/game/cost/ICostVisitor.java @@ -2,36 +2,36 @@ package forge.game.cost; public interface ICostVisitor { - public T visit(CostGainControl cost); - public T visit(CostChooseCreatureType cost); - public T visit(CostDiscard cost); - public T visit(CostDamage cost); - public T visit(CostDraw cost); - public T visit(CostExile cost); - public T visit(CostExileFromStack cost); - public T visit(CostExiledMoveToGrave cost); - public T visit(CostExert cost); - public T visit(CostFlipCoin cost); - public T visit(CostMill cost); - public T visit(CostAddMana cost); - public T visit(CostPayLife cost); - public T visit(CostPayEnergy cost); - public T visit(CostGainLife cost); - public T visit(CostPartMana cost); - public T visit(CostPutCardToLib cost); - public T visit(CostTap cost); - public T visit(CostSacrifice cost); - public T visit(CostReturn cost); - public T visit(CostReveal cost); - public T visit(CostRemoveAnyCounter cost); - public T visit(CostRemoveCounter cost); - public T visit(CostPutCounter cost); - public T visit(CostUntapType cost); - public T visit(CostUntap cost); - public T visit(CostUnattach cost); - public T visit(CostTapType cost); + T visit(CostGainControl cost); + T visit(CostChooseCreatureType cost); + T visit(CostDiscard cost); + T visit(CostDamage cost); + T visit(CostDraw cost); + T visit(CostExile cost); + T visit(CostExileFromStack cost); + T visit(CostExiledMoveToGrave cost); + T visit(CostExert cost); + T visit(CostFlipCoin cost); + T visit(CostMill cost); + T visit(CostAddMana cost); + T visit(CostPayLife cost); + T visit(CostPayEnergy cost); + T visit(CostGainLife cost); + T visit(CostPartMana cost); + T visit(CostPutCardToLib cost); + T visit(CostTap cost); + T visit(CostSacrifice cost); + T visit(CostReturn cost); + T visit(CostReveal cost); + T visit(CostRemoveAnyCounter cost); + T visit(CostRemoveCounter cost); + T visit(CostPutCounter cost); + T visit(CostUntapType cost); + T visit(CostUntap cost); + T visit(CostUnattach cost); + T visit(CostTapType cost); - public static class Base implements ICostVisitor { + class Base implements ICostVisitor { @Override public T visit(CostGainControl cost) { diff --git a/forge-game/src/main/java/forge/game/event/GameEventCardDamaged.java b/forge-game/src/main/java/forge/game/event/GameEventCardDamaged.java index e809ad41743..149cf8e3ea9 100644 --- a/forge-game/src/main/java/forge/game/event/GameEventCardDamaged.java +++ b/forge-game/src/main/java/forge/game/event/GameEventCardDamaged.java @@ -8,7 +8,7 @@ public class GameEventCardDamaged extends GameEvent { Normal, M1M1Counters, Deathtouch, - LoyaltyLoss; + LoyaltyLoss } public final Card card; diff --git a/forge-game/src/main/java/forge/game/event/GameEventCardStatsChanged.java b/forge-game/src/main/java/forge/game/event/GameEventCardStatsChanged.java index 1eb9149788f..e1bb2138ffe 100644 --- a/forge-game/src/main/java/forge/game/event/GameEventCardStatsChanged.java +++ b/forge-game/src/main/java/forge/game/event/GameEventCardStatsChanged.java @@ -43,7 +43,7 @@ public class GameEventCardStatsChanged extends GameEvent { return "Card state changes: " + card.getName() + " (" + StringUtils.join(card.getType(), ' ') + ") " + card.getNetPower() + "/" + card.getNetToughness() + - " and " + String.valueOf(cards.size() - 1) + " more"; + " and " + (cards.size() - 1) + " more"; } } diff --git a/forge-game/src/main/java/forge/game/event/IGameEventVisitor.java b/forge-game/src/main/java/forge/game/event/IGameEventVisitor.java index 7e038506226..8dd56af94d4 100644 --- a/forge-game/src/main/java/forge/game/event/IGameEventVisitor.java +++ b/forge-game/src/main/java/forge/game/event/IGameEventVisitor.java @@ -51,7 +51,7 @@ public interface IGameEventVisitor { // This is base class for all visitors. - public static class Base implements IGameEventVisitor{ + class Base implements IGameEventVisitor{ public T visit(GameEventAnteCardsSelected event) { return null; } public T visit(GameEventAttackersDeclared event) { return null; } public T visit(GameEventBlockersDeclared event) { return null; } diff --git a/forge-game/src/main/java/forge/game/keyword/Keyword.java b/forge-game/src/main/java/forge/game/keyword/Keyword.java index ead951daf98..101dc0a4a90 100644 --- a/forge-game/src/main/java/forge/game/keyword/Keyword.java +++ b/forge-game/src/main/java/forge/game/keyword/Keyword.java @@ -164,7 +164,7 @@ public enum Keyword { protected final boolean isMultipleRedundant; protected final String reminderText, displayName; - private Keyword(Class> type0, boolean isMultipleRedundant0, String reminderText0) { + Keyword(Class> type0, boolean isMultipleRedundant0, String reminderText0) { type = type0; isMultipleRedundant = isMultipleRedundant0; reminderText = reminderText0; @@ -176,7 +176,7 @@ public enum Keyword { String details = k; // try to get real part if (k.contains(":")) { - final String x[] = k.split(":", 2); + final String[] x = k.split(":", 2); keyword = smartValueOf(x[0]); details = x[1]; } else if (k.contains(" ")) { @@ -186,7 +186,7 @@ public enum Keyword { // other keywords that contains other stuff like Enchant if (keyword == Keyword.UNDEFINED) { - final String x[] = k.split(" ", 2); + final String[] x = k.split(" ", 2); final Keyword k2 = smartValueOf(x[0]); // Keywords that needs to be undefined diff --git a/forge-game/src/main/java/forge/game/keyword/KeywordInstance.java b/forge-game/src/main/java/forge/game/keyword/KeywordInstance.java index 33bfe77dd56..50b99b5e66a 100644 --- a/forge-game/src/main/java/forge/game/keyword/KeywordInstance.java +++ b/forge-game/src/main/java/forge/game/keyword/KeywordInstance.java @@ -24,10 +24,10 @@ public abstract class KeywordInstance> implements K private boolean hidden; - private List triggers = Lists.newArrayList(); - private List replacements = Lists.newArrayList(); - private List abilities = Lists.newArrayList(); - private List staticAbilities = Lists.newArrayList(); + private List triggers = Lists.newArrayList(); + private List replacements = Lists.newArrayList(); + private List abilities = Lists.newArrayList(); + private List staticAbilities = Lists.newArrayList(); /* (non-Javadoc) diff --git a/forge-game/src/main/java/forge/game/keyword/KeywordInterface.java b/forge-game/src/main/java/forge/game/keyword/KeywordInterface.java index 83ad9b87aa8..d8b5f152605 100644 --- a/forge-game/src/main/java/forge/game/keyword/KeywordInterface.java +++ b/forge-game/src/main/java/forge/game/keyword/KeywordInterface.java @@ -21,36 +21,36 @@ public interface KeywordInterface extends Cloneable { boolean getHidden(); void setHidden(boolean val); - public void createTraits(final Card host, final boolean intrinsic); + void createTraits(final Card host, final boolean intrinsic); void createTraits(final Card host, final boolean intrinsic, final boolean clear); - public void addTrigger(final Trigger trg); + void addTrigger(final Trigger trg); - public void addReplacement(final ReplacementEffect trg); + void addReplacement(final ReplacementEffect trg); - public void addSpellAbility(final SpellAbility s); - public void addStaticAbility(final StaticAbility st); + void addSpellAbility(final SpellAbility s); + void addStaticAbility(final StaticAbility st); - public void setHostCard(final Card host); + void setHostCard(final Card host); /** * @return the triggers */ - public Collection getTriggers(); + Collection getTriggers(); /** * @return the replacements */ - public Collection getReplacements(); + Collection getReplacements(); /** * @return the abilities */ - public Collection getAbilities(); + Collection getAbilities(); /** * @return the staticAbilities */ - public Collection getStaticAbilities(); + Collection getStaticAbilities(); - public KeywordInterface copy(final Card host, final boolean lki); + KeywordInterface copy(final Card host, final boolean lki); - public boolean redundant(final Collection list); + boolean redundant(final Collection list); } \ No newline at end of file diff --git a/forge-game/src/main/java/forge/game/keyword/KeywordWithCostAndType.java b/forge-game/src/main/java/forge/game/keyword/KeywordWithCostAndType.java index b1e988e5bdb..167cc20dce5 100644 --- a/forge-game/src/main/java/forge/game/keyword/KeywordWithCostAndType.java +++ b/forge-game/src/main/java/forge/game/keyword/KeywordWithCostAndType.java @@ -18,7 +18,7 @@ public class KeywordWithCostAndType extends KeywordInstance 2) { strType = k[2]; } else { - String n[] = type.split(","); + String[] n = type.split(","); for (int i = 0; i < n.length; i++) { if (CardType.isACardType(n[i])) { n[i] = n[i].toLowerCase(); diff --git a/forge-game/src/main/java/forge/game/keyword/Ninjutsu.java b/forge-game/src/main/java/forge/game/keyword/Ninjutsu.java index 2159f8ea430..50b5d8b2006 100644 --- a/forge-game/src/main/java/forge/game/keyword/Ninjutsu.java +++ b/forge-game/src/main/java/forge/game/keyword/Ninjutsu.java @@ -10,7 +10,7 @@ public class Ninjutsu extends KeywordWithCost { @Override protected void parse(String details) { if (details.contains(":")) { - String k[] = details.split(":"); + String[] k = details.split(":"); details = k[0]; if (k[1].equals("Commander")) { commander = true; diff --git a/forge-game/src/main/java/forge/game/mana/ManaPool.java b/forge-game/src/main/java/forge/game/mana/ManaPool.java index de59a57ef21..bf68649ae12 100644 --- a/forge-game/src/main/java/forge/game/mana/ManaPool.java +++ b/forge-game/src/main/java/forge/game/mana/ManaPool.java @@ -95,10 +95,7 @@ public class ManaPool extends ManaConversionMatrix implements Iterable { } } - if (totalMana() == safeMana) { - return false; //won't lose floating mana if all mana is of colors that aren't going to be emptied - } - return true; + return totalMana() != safeMana; //won't lose floating mana if all mana is of colors that aren't going to be emptied } public final List clearPool(boolean isEndOfPhase) { @@ -370,7 +367,7 @@ public class ManaPool extends ManaConversionMatrix implements Iterable { } // TODO The following may not be needed anymore? - if (((color & (byte) ManaAtom.COLORLESS) != 0) && shard.canBePaidWithManaOfColor((byte) (byte)ManaAtom.COLORLESS)) { + if (((color & (byte) ManaAtom.COLORLESS) != 0) && shard.canBePaidWithManaOfColor((byte)ManaAtom.COLORLESS)) { return true; } diff --git a/forge-game/src/main/java/forge/game/mulligan/MulliganService.java b/forge-game/src/main/java/forge/game/mulligan/MulliganService.java index 2fed6777cc5..0d787327ff1 100644 --- a/forge-game/src/main/java/forge/game/mulligan/MulliganService.java +++ b/forge-game/src/main/java/forge/game/mulligan/MulliganService.java @@ -68,7 +68,7 @@ public class MulliganService { continue; } Player p = mulligan.getPlayer(); - boolean keep = mulligan.canMulligan() ? p.getController().mulliganKeepHand(firstPlayer, mulligan.tuckCardsAfterKeepHand()) : true; + boolean keep = !mulligan.canMulligan() || p.getController().mulliganKeepHand(firstPlayer, mulligan.tuckCardsAfterKeepHand()); if (game.isGameOver()) { // conceded on mulligan prompt return; diff --git a/forge-game/src/main/java/forge/game/phase/PhaseHandler.java b/forge-game/src/main/java/forge/game/phase/PhaseHandler.java index fd75bb5e2b8..00ca310ff9e 100644 --- a/forge-game/src/main/java/forge/game/phase/PhaseHandler.java +++ b/forge-game/src/main/java/forge/game/phase/PhaseHandler.java @@ -663,7 +663,7 @@ public class PhaseHandler implements java.io.Serializable { // map: defender => (many) attacker => (many) blocker Map> blockers = Maps.newHashMap(); for (GameEntity ge : combat.getDefendersControlledBy(p)) { - MapOfLists protectThisDefender = new HashMapOfLists(CollectionSuppliers.arrayLists()); + MapOfLists protectThisDefender = new HashMapOfLists(CollectionSuppliers.arrayLists()); for (Card att : combat.getAttackersOf(ge)) { protectThisDefender.addAll(att, combat.getBlockers(att)); } diff --git a/forge-game/src/main/java/forge/game/phase/PhaseType.java b/forge-game/src/main/java/forge/game/phase/PhaseType.java index 8022b483c39..eda13a747f7 100644 --- a/forge-game/src/main/java/forge/game/phase/PhaseType.java +++ b/forge-game/src/main/java/forge/game/phase/PhaseType.java @@ -36,10 +36,10 @@ public enum PhaseType { public final String nameForUi; public final String nameForScripts; - private PhaseType(String name) { + PhaseType(String name) { this(name, name); } - private PhaseType(String name, String name_for_scripts) { + PhaseType(String name, String name_for_scripts) { nameForUi = name; nameForScripts = name_for_scripts; } diff --git a/forge-game/src/main/java/forge/game/phase/Untap.java b/forge-game/src/main/java/forge/game/phase/Untap.java index 7835a67cdaf..688a295ce79 100644 --- a/forge-game/src/main/java/forge/game/phase/Untap.java +++ b/forge-game/src/main/java/forge/game/phase/Untap.java @@ -35,7 +35,6 @@ import forge.game.spellability.SpellAbility; import forge.game.zone.ZoneType; import java.util.Arrays; -import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -93,11 +92,8 @@ public class Untap extends Phase { } //exerted need current player turn final Player playerTurn = c.getGame().getPhaseHandler().getPlayerTurn(); - - if (c.isExertedBy(playerTurn)) { - return false; - } - return true; + + return !c.isExertedBy(playerTurn); } public static final Predicate CANUNTAP = new Predicate() { @@ -125,7 +121,7 @@ public class Untap extends Phase { for (final Card c : bounceList) { game.getAction().moveToHand(c, null); } - list.removeAll((Collection)bounceList); + list.removeAll(bounceList); final Map restrictUntap = Maps.newHashMap(); boolean hasChosen = false; @@ -154,10 +150,7 @@ public class Untap extends Phase { if (!Untap.canUntap(c)) { return false; } - if (c.isValid(restrict, player, null, null)) { - return false; - } - return true; + return !c.isValid(restrict, player, null, null); } }); @@ -187,7 +180,7 @@ public class Untap extends Phase { Map remaining = Maps.newHashMap(restrictUntap); for (Entry entry : remaining.entrySet()) { if (entry.getValue() == 0) { - cardList.removeAll((Collection)CardLists.getValidCards(cardList, entry.getKey(), player, null)); + cardList.removeAll(CardLists.getValidCards(cardList, entry.getKey(), player, null)); restrictUntap.remove(entry.getKey()); } } diff --git a/forge-game/src/main/java/forge/game/player/Player.java b/forge-game/src/main/java/forge/game/player/Player.java index 2607b412d75..d4214940983 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -461,10 +461,7 @@ public class Player extends GameEntity implements Comparable { } public final boolean canGainLife() { - if (hasKeyword("You can't gain life.") || hasKeyword("Your life total can't change.")) { - return false; - } - return true; + return !hasKeyword("You can't gain life.") && !hasKeyword("Your life total can't change."); } public final int loseLife(final int toLose) { @@ -513,20 +510,14 @@ public class Player extends GameEntity implements Comparable { } public final boolean canLoseLife() { - if (hasKeyword("Your life total can't change.")) { - return false; - } - return true; + return !hasKeyword("Your life total can't change."); } public final boolean canPayLife(final int lifePayment) { if (life < lifePayment) { return false; } - if ((lifePayment > 0) && hasKeyword("Your life total can't change.")) { - return false; - } - return true; + return (lifePayment <= 0) || !hasKeyword("Your life total can't change."); } public final boolean payLife(final int lifePayment, final Card source) { @@ -826,7 +817,7 @@ public class Player extends GameEntity implements Comparable { CardCollection newCardsInCommand = new CardCollection(getGame().getCardsIn(ZoneType.Command)); newCardsInCommand.removeAll(cardsInCommand); if (!newCardsInCommand.isEmpty()) { - newCardsInCommand.get(0).setSVar("PreventedDamage", "Number$" + Integer.toString(dmgToBePrevented)); + newCardsInCommand.get(0).setSVar("PreventedDamage", "Number$" + dmgToBePrevented); } } subtractPreventNextDamageWithEffect(shieldSource, restDamage); @@ -1067,7 +1058,7 @@ public class Player extends GameEntity implements Comparable { * @param keyword the keyword to add. */ public final void addKeyword(final String keyword) { - addChangedKeywords(ImmutableList.of(keyword), ImmutableList.of(), getGame().getNextTimestamp()); + addChangedKeywords(ImmutableList.of(keyword), ImmutableList.of(), getGame().getNextTimestamp()); } /** @@ -1185,7 +1176,7 @@ public class Player extends GameEntity implements Comparable { PlayerZone com = getZone(ZoneType.Command); for (DetachedCardEffect eff : staticAbilities.values()) { com.remove(eff); - eff.setStaticAbilities(Lists.newArrayList()); + eff.setStaticAbilities(Lists.newArrayList()); } this.updateZoneForView(com); } @@ -1201,7 +1192,7 @@ public class Player extends GameEntity implements Comparable { boolean cancelHexproof = false; for (String k : a.getKeywords()) { if (k.startsWith("IgnoreHexproof")) { - String m[] = k.split(":"); + String[] m = k.split(":"); if (isValid(m[1].split(","), a, sa.getHostCard(), sa)) { cancelHexproof = true; break; @@ -1218,10 +1209,7 @@ public class Player extends GameEntity implements Comparable { return false; } - if ((hasKeyword("You can't be the targets of spells or activated abilities") && (sa.isSpell() || (sa instanceof AbilityActivated)))) { - return false; - } - return true; + return (!hasKeyword("You can't be the targets of spells or activated abilities") || (!sa.isSpell() && (!(sa instanceof AbilityActivated)))); } @@ -1783,10 +1771,7 @@ public class Player extends GameEntity implements Comparable { adjMax += Integer.valueOf(k[1]); } } - if (landsPlayedThisTurn < adjMax) { - return true; - } - return false; + return landsPlayedThisTurn < adjMax; } public final ManaPool getManaPool() { @@ -2957,11 +2942,7 @@ public class Player extends GameEntity implements Comparable { return true; } - if (isOpponentOf(sa.getActivatingPlayer()) && hasKeyword("Spells and abilities your opponents control can't cause you to discard cards.")) { - return false; - } - - return true; + return !isOpponentOf(sa.getActivatingPlayer()) || !hasKeyword("Spells and abilities your opponents control can't cause you to discard cards."); } public boolean canSacrificeBy(SpellAbility sa) { @@ -2969,11 +2950,7 @@ public class Player extends GameEntity implements Comparable { return true; } - if (isOpponentOf(sa.getActivatingPlayer()) && hasKeyword("Spells and abilities your opponents control can't cause you to sacrifice permanents.")) { - return false; - } - - return true; + return !isOpponentOf(sa.getActivatingPlayer()) || !hasKeyword("Spells and abilities your opponents control can't cause you to sacrifice permanents."); } public boolean canSearchLibraryWith(SpellAbility sa, Player targetPlayer) { @@ -2983,11 +2960,8 @@ public class Player extends GameEntity implements Comparable { if (this.hasKeyword("CantSearchLibrary")) { return false; - } else if (targetPlayer != null && targetPlayer.equals(sa.getActivatingPlayer()) - && hasKeyword("Spells and abilities you control can't cause you to search your library.")) { - return false; - } + } else return targetPlayer == null || !targetPlayer.equals(sa.getActivatingPlayer()) + || !hasKeyword("Spells and abilities you control can't cause you to search your library."); - return true; } } diff --git a/forge-game/src/main/java/forge/game/player/PlayerController.java b/forge-game/src/main/java/forge/game/player/PlayerController.java index 96f146e564f..ecea26174d9 100644 --- a/forge-game/src/main/java/forge/game/player/PlayerController.java +++ b/forge-game/src/main/java/forge/game/player/PlayerController.java @@ -43,7 +43,7 @@ import java.util.Map; */ public abstract class PlayerController { - public static enum ManaPaymentPurpose { + public enum ManaPaymentPurpose { DeclareAttacker, DeclareBlocker, Echo, @@ -51,7 +51,7 @@ public abstract class PlayerController { CumulativeUpkeep, } - public static enum BinaryChoiceType { + public enum BinaryChoiceType { HeadsOrTails, // coin TapOrUntap, PlayOrDraw, diff --git a/forge-game/src/main/java/forge/game/player/PlayerProperty.java b/forge-game/src/main/java/forge/game/player/PlayerProperty.java index 08238470931..f1c17abdf59 100644 --- a/forge-game/src/main/java/forge/game/player/PlayerProperty.java +++ b/forge-game/src/main/java/forge/game/player/PlayerProperty.java @@ -358,4 +358,4 @@ public class PlayerProperty { return true; } -} +} \ No newline at end of file diff --git a/forge-game/src/main/java/forge/game/replacement/ReplaceSurveil.java b/forge-game/src/main/java/forge/game/replacement/ReplaceSurveil.java index c2121b2e0d7..ad6a9478245 100644 --- a/forge-game/src/main/java/forge/game/replacement/ReplaceSurveil.java +++ b/forge-game/src/main/java/forge/game/replacement/ReplaceSurveil.java @@ -31,7 +31,7 @@ public class ReplaceSurveil extends ReplacementEffect { } if (hasParam("ValidPlayer")) { - if (!matchesValid(runParams.get("Affected"), getParam("ValidPlayer").split(","), getHostCard())) { + if (!matchesValid(runParams.get("Affected"), this.getMapParams().get("ValidPlayer").split(","), this.getHostCard())) { return false; } } diff --git a/forge-game/src/main/java/forge/game/replacement/ReplacementResult.java b/forge-game/src/main/java/forge/game/replacement/ReplacementResult.java index bdbf0705124..a60f85d12ce 100644 --- a/forge-game/src/main/java/forge/game/replacement/ReplacementResult.java +++ b/forge-game/src/main/java/forge/game/replacement/ReplacementResult.java @@ -8,5 +8,5 @@ public enum ReplacementResult { Replaced, NotReplaced, Prevented, - Updated; + Updated } diff --git a/forge-game/src/main/java/forge/game/replacement/ReplacementType.java b/forge-game/src/main/java/forge/game/replacement/ReplacementType.java index 9d420ef7199..0f10844b665 100644 --- a/forge-game/src/main/java/forge/game/replacement/ReplacementType.java +++ b/forge-game/src/main/java/forge/game/replacement/ReplacementType.java @@ -29,7 +29,7 @@ public enum ReplacementType { Untap(ReplaceUntap.class); Class clasz; - private ReplacementType(Class cls) { + ReplacementType(Class cls) { clasz = cls; } diff --git a/forge-game/src/main/java/forge/game/spellability/AbilityManaPart.java b/forge-game/src/main/java/forge/game/spellability/AbilityManaPart.java index 9d2d71e1f38..b3b9040bf61 100644 --- a/forge-game/src/main/java/forge/game/spellability/AbilityManaPart.java +++ b/forge-game/src/main/java/forge/game/spellability/AbilityManaPart.java @@ -97,8 +97,7 @@ public class AbilityManaPart implements java.io.Serializable { this.addsKeywordsUntil = params.get("AddsKeywordsUntil"); this.addsCounters = params.get("AddsCounters"); this.triggersWhenSpent = params.get("TriggersWhenSpent"); - this.persistentMana = (null == params.get("PersistentMana")) ? false : - "True".equalsIgnoreCase(params.get("PersistentMana")); + this.persistentMana = (null != params.get("PersistentMana")) && "True".equalsIgnoreCase(params.get("PersistentMana")); this.manaReplaceType = params.containsKey("ManaReplaceType") ? params.get("ManaReplaceType") : ""; } @@ -489,12 +488,8 @@ public class AbilityManaPart implements java.io.Serializable { * @return a boolean. */ public final boolean isBasic() { - if (this.getOrigProduced().length() != 1 && !this.getOrigProduced().contains("Any") - && !this.getOrigProduced().contains("Chosen")) { - return false; - } - - return true; + return this.getOrigProduced().length() == 1 || this.getOrigProduced().contains("Any") + || this.getOrigProduced().contains("Chosen"); } /** {@inheritDoc} */ diff --git a/forge-game/src/main/java/forge/game/spellability/SpellAbility.java b/forge-game/src/main/java/forge/game/spellability/SpellAbility.java index fb8389a1af7..cfa028365c6 100644 --- a/forge-game/src/main/java/forge/game/spellability/SpellAbility.java +++ b/forge-game/src/main/java/forge/game/spellability/SpellAbility.java @@ -118,7 +118,8 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit private boolean basicLandAbility = false; private SplitSide splitSide = null; - enum SplitSide { LEFT, RIGHT }; + enum SplitSide { LEFT, RIGHT } + private int totalManaSpent = 0; /** The pay costs. */ @@ -209,7 +210,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit @Override public boolean equals(final Object obj) { return obj instanceof SpellAbility && this.id == ((SpellAbility) obj).id; - }; + } @Override public void setHostCard(final Card c) { @@ -271,7 +272,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit if (isPwAbility()) { return false; //Loyalty ability, not a mana ability. } - if (isWrapper() && ((WrappedAbility) this).getTrigger().getMode() != TriggerType.TapsForMana) { + if (isWrapper() && this.getTrigger().getMode() != TriggerType.TapsForMana) { return false; } @@ -1428,10 +1429,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit maxTargets = Integer.parseInt(this.getHostCard().getSVar("CostCountersRemoved")); } - if (minTargets > numTargets || maxTargets < numTargets) { - return false; - } - return true; + return minTargets <= numTargets && maxTargets >= numTargets; } /** *

diff --git a/forge-game/src/main/java/forge/game/spellability/SpellAbilityStackInstance.java b/forge-game/src/main/java/forge/game/spellability/SpellAbilityStackInstance.java index bf6a8e8a045..048014c7684 100644 --- a/forge-game/src/main/java/forge/game/spellability/SpellAbilityStackInstance.java +++ b/forge-game/src/main/java/forge/game/spellability/SpellAbilityStackInstance.java @@ -314,7 +314,7 @@ public class SpellAbilityStackInstance implements IIdentifiable, IHasCardView { // try to deduce which target has been replaced // (this may be imprecise, updateTarget should specify old target if possible) for (Object obj : map.keySet()) { - if (!target.getTargets().contains((GameObject)obj)) { + if (!target.getTargets().contains(obj)) { toRemove = obj; break; } diff --git a/forge-game/src/main/java/forge/game/spellability/SpellPermanent.java b/forge-game/src/main/java/forge/game/spellability/SpellPermanent.java index 8b04a632bb3..4d0a734746a 100644 --- a/forge-game/src/main/java/forge/game/spellability/SpellPermanent.java +++ b/forge-game/src/main/java/forge/game/spellability/SpellPermanent.java @@ -48,7 +48,7 @@ public class SpellPermanent extends SpellApiBased { */ public SpellPermanent(final Card sourceCard) { super(sourceCard.isCreature() ? ApiType.PermanentCreature : ApiType.PermanentNoncreature, sourceCard, - new Cost(sourceCard.getManaCost(), false), null, Maps.newHashMap()); + new Cost(sourceCard.getManaCost(), false), null, Maps.newHashMap()); // reset StackDescription for something with Text this.setStackDescription(""); diff --git a/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java b/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java index 305b77f6950..270e57585b2 100644 --- a/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java +++ b/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java @@ -773,9 +773,7 @@ public class TargetRestrictions { * @param portionAllocated the divided portion allocated */ public final void addDividedAllocation(final Object tgt, final Integer portionAllocated) { - if (this.dividedMap.containsKey(tgt)) { - this.dividedMap.remove(tgt); - } + this.dividedMap.remove(tgt); this.dividedMap.put(tgt, portionAllocated); } diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbility.java b/forge-game/src/main/java/forge/game/staticability/StaticAbility.java index 0c01ab230e9..d429b7e3d70 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbility.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbility.java @@ -520,7 +520,7 @@ public class StaticAbility extends CardTraitBase implements Comparable params = stAb.getMapParams(); final Card hostCard = stAb.getHostCard(); - if (params.containsKey("ValidCard") - && !card.isValid(params.get("ValidCard").split(","), hostCard.getController(), hostCard, null)) { - return false; - } - - return true; + return !params.containsKey("ValidCard") + || card.isValid(params.get("ValidCard").split(","), hostCard.getController(), hostCard, null); } } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerAttackerBlockedByCreature.java b/forge-game/src/main/java/forge/game/trigger/TriggerAttackerBlockedByCreature.java index 4f4ae302f7a..be66cc09438 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerAttackerBlockedByCreature.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerAttackerBlockedByCreature.java @@ -73,12 +73,12 @@ public class TriggerAttackerBlockedByCreature extends Trigger { if (this.mapParams.containsKey("ValidBlocker")) { final String validBlocker = this.mapParams.get("ValidBlocker"); if (validBlocker.equals("LessPowerThanAttacker")) { - if (blocker.getNetPower() >= attacker.getNetPower()) { - return false; - } - } else if (!matchesValid(blocker, validBlocker.split(","), this.getHostCard())) { - return false; - } + if (blocker.getNetPower() >= attacker.getNetPower()) { + return false; + } + } else if (!matchesValid(blocker, validBlocker.split(","), this.getHostCard())) { + return false; + } } return true; diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerBlocks.java b/forge-game/src/main/java/forge/game/trigger/TriggerBlocks.java index 1f351c52813..441348ace95 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerBlocks.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerBlocks.java @@ -76,9 +76,9 @@ public class TriggerBlocks extends Trigger { break; } } - + if (!foundMatch) { - return false; + return false; } } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerChangesZoneAll.java b/forge-game/src/main/java/forge/game/trigger/TriggerChangesZoneAll.java index 0993e8dae29..f49005ac74a 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerChangesZoneAll.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerChangesZoneAll.java @@ -17,11 +17,7 @@ public class TriggerChangesZoneAll extends Trigger { public boolean performTest(Map runParams2) { final CardZoneTable table = (CardZoneTable) runParams2.get("Cards"); - if (filterCards(table).isEmpty()) { - return false; - } - - return true; + return !filterCards(table).isEmpty(); } @Override diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerCounterAddedAll.java b/forge-game/src/main/java/forge/game/trigger/TriggerCounterAddedAll.java index 8becd1a4ded..94b49909f02 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerCounterAddedAll.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerCounterAddedAll.java @@ -19,11 +19,7 @@ public class TriggerCounterAddedAll extends Trigger { public boolean performTest(Map runParams2) { final GameEntityCounterTable table = (GameEntityCounterTable) runParams2.get("Objects"); - if (filterTable(table).isEmpty()) { - return false; - } - - return true; + return !filterTable(table).isEmpty(); } @Override diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerCycled.java b/forge-game/src/main/java/forge/game/trigger/TriggerCycled.java index a13e8664d9e..d62f0f8f58c 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerCycled.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerCycled.java @@ -63,10 +63,8 @@ public class TriggerCycled extends Trigger { @Override public final boolean performTest(final java.util.Map runParams2) { if (this.mapParams.containsKey("ValidCard")) { - if (!matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","), - this.getHostCard())) { - return false; - } + return matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","), + this.getHostCard()); } return true; } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerDevoured.java b/forge-game/src/main/java/forge/game/trigger/TriggerDevoured.java index f067b7a179a..ac8002f5682 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerDevoured.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerDevoured.java @@ -51,10 +51,8 @@ public class TriggerDevoured extends Trigger { public final boolean performTest(final java.util.Map runParams2) { final Card sac = (Card) runParams2.get("Devoured"); if (this.mapParams.containsKey("ValidDevoured")) { - if (!sac.isValid(this.mapParams.get("ValidDevoured").split(","), this.getHostCard().getController(), - this.getHostCard(), null)) { - return false; - } + return sac.isValid(this.mapParams.get("ValidDevoured").split(","), this.getHostCard().getController(), + this.getHostCard(), null); } return true; } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerEvolved.java b/forge-game/src/main/java/forge/game/trigger/TriggerEvolved.java index a85c4479cb3..71c0af1aac8 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerEvolved.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerEvolved.java @@ -52,10 +52,8 @@ public class TriggerEvolved extends Trigger { public final boolean performTest(final Map runParams2) { final Card sac = (Card) runParams2.get("Card"); if (hasParam("ValidCard")) { - if (!sac.isValid(getParam("ValidCard").split(","), getHostCard().getController(), - getHostCard(), null)) { - return false; - } + return sac.isValid(getParam("ValidCard").split(","), getHostCard().getController(), + getHostCard(), null); } return true; } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerExerted.java b/forge-game/src/main/java/forge/game/trigger/TriggerExerted.java index 2005d7fdc40..d4006d908e5 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerExerted.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerExerted.java @@ -24,10 +24,8 @@ public class TriggerExerted extends Trigger { public boolean performTest(Map runParams2) { final Card exerter = (Card) runParams2.get("Card"); if (this.mapParams.containsKey("ValidCard")) { - if (!exerter.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(), - this.getHostCard(), null)) { - return false; - } + return exerter.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(), + this.getHostCard(), null); } return true; } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerExplores.java b/forge-game/src/main/java/forge/game/trigger/TriggerExplores.java index 5b15c7db8da..69e458136a9 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerExplores.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerExplores.java @@ -51,10 +51,8 @@ public class TriggerExplores extends Trigger { @Override public final boolean performTest(final Map runParams2) { if (this.mapParams.containsKey("ValidCard")) { - if (!matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","), - this.getHostCard())) { - return false; - } + return matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","), + this.getHostCard()); } return true; diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerFight.java b/forge-game/src/main/java/forge/game/trigger/TriggerFight.java index 65ee54f09f4..e45b2eeda7e 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerFight.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerFight.java @@ -53,10 +53,8 @@ public class TriggerFight extends Trigger { final Card fighter = (Card) runParams2.get("Fighter"); if (this.mapParams.containsKey("ValidCard")) { - if (!fighter.isValid(this.mapParams.get("ValidCard").split(","), - this.getHostCard().getController(), this.getHostCard(), null)) { - return false; - } + return fighter.isValid(this.mapParams.get("ValidCard").split(","), + this.getHostCard().getController(), this.getHostCard(), null); } return true; } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerHandler.java b/forge-game/src/main/java/forge/game/trigger/TriggerHandler.java index 0197f253336..85a7d8a1d6c 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerHandler.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerHandler.java @@ -57,7 +57,7 @@ public class TriggerHandler { private final List delayedTriggers = Collections.synchronizedList(new ArrayList()); private final List thisTurnDelayedTriggers = Collections.synchronizedList(new ArrayList()); - private final ListMultimap playerDefinedDelayedTriggers = Multimaps.synchronizedListMultimap(ArrayListMultimap.create()); + private final ListMultimap playerDefinedDelayedTriggers = Multimaps.synchronizedListMultimap(ArrayListMultimap.create()); private final List waitingTriggers = Collections.synchronizedList(new ArrayList()); private final Game game; diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerLosesGame.java b/forge-game/src/main/java/forge/game/trigger/TriggerLosesGame.java index b9aa5c4028e..931ef32c740 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerLosesGame.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerLosesGame.java @@ -28,10 +28,8 @@ public class TriggerLosesGame extends Trigger { @Override public final boolean performTest(final java.util.Map runParams2) { if (this.mapParams.containsKey("ValidPlayer")) { - if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","), - this.getHostCard())) { - return false; - } + return matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","), + this.getHostCard()); } return true; diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerPayLife.java b/forge-game/src/main/java/forge/game/trigger/TriggerPayLife.java index 0dcdb617893..4616f0db3a9 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerPayLife.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerPayLife.java @@ -51,9 +51,7 @@ public class TriggerPayLife extends Trigger { @Override public final boolean performTest(final Map runParams2) { if (hasParam("ValidPlayer")) { - if (!matchesValid(runParams2.get("Player"), getParam("ValidPlayer").split(","), getHostCard())) { - return false; - } + return matchesValid(runParams2.get("Player"), getParam("ValidPlayer").split(","), getHostCard()); } return true; diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerPhase.java b/forge-game/src/main/java/forge/game/trigger/TriggerPhase.java index 843368ac05d..3fbe945effc 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerPhase.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerPhase.java @@ -50,10 +50,8 @@ public class TriggerPhase extends Trigger { @Override public final boolean performTest(final java.util.Map runParams2) { if (this.mapParams.containsKey("ValidPlayer")) { - if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","), - this.getHostCard())) { - return false; - } + return matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","), + this.getHostCard()); } return true; } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerPhaseIn.java b/forge-game/src/main/java/forge/game/trigger/TriggerPhaseIn.java index a9cac8b0db5..c3b4aa6e789 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerPhaseIn.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerPhaseIn.java @@ -17,10 +17,8 @@ public class TriggerPhaseIn extends Trigger { final Card phaser = (Card) runParams2.get("Card"); if (this.mapParams.containsKey("ValidCard")) { - if (!phaser.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(), - this.getHostCard(), null)) { - return false; - } + return phaser.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(), + this.getHostCard(), null); } return true; diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerPlanarDice.java b/forge-game/src/main/java/forge/game/trigger/TriggerPlanarDice.java index f8d1d6c18e4..55bbcbd4b5c 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerPlanarDice.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerPlanarDice.java @@ -42,7 +42,7 @@ public class TriggerPlanarDice extends Trigger { if (this.mapParams.containsKey("Result")) { PlanarDice cond = PlanarDice.smartValueOf(this.mapParams.get("Result")); - if (cond != ((PlanarDice) runParams2.get("Result"))) { + if (cond != runParams2.get("Result")) { return false; } } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerRevealed.java b/forge-game/src/main/java/forge/game/trigger/TriggerRevealed.java index 59d8d29d926..c7614ca9d95 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerRevealed.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerRevealed.java @@ -22,7 +22,7 @@ public class TriggerRevealed extends Trigger { } if (this.mapParams.containsKey("Miracle")) { Boolean madness = (Boolean) runParams2.get("Miracle"); - if (this.mapParams.get("Miracle").equals("True") ^ madness) { + if (!matchesValid(runParams2.get("Card"), getParam("ValidCard").split(","), getHostCard())) { return false; } } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerScry.java b/forge-game/src/main/java/forge/game/trigger/TriggerScry.java index 209f3bd5571..70be461dde3 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerScry.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerScry.java @@ -50,10 +50,8 @@ public class TriggerScry extends Trigger { @Override public final boolean performTest(final java.util.Map runParams2) { if (this.mapParams.containsKey("ValidPlayer")) { - if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","), - this.getHostCard())) { - return false; - } + return matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","), + this.getHostCard()); } return true; diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerSetInMotion.java b/forge-game/src/main/java/forge/game/trigger/TriggerSetInMotion.java index bdc94181666..0cebd807951 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerSetInMotion.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerSetInMotion.java @@ -63,7 +63,7 @@ public class TriggerSetInMotion extends Trigger { return false; } } else if (this.mapParams.get("SchemeType").equals("Ongoing")) { - if (!((Card)runParams2.get("Scheme")).getType().hasSupertype(CardType.Supertype.Ongoing)) { + if (((Card) runParams2.get("Scheme")).getType().hasSupertype(CardType.Supertype.Ongoing)) { return false; } } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerSpellAbilityCast.java b/forge-game/src/main/java/forge/game/trigger/TriggerSpellAbilityCast.java index 0dc88c7c789..43fde3f60c0 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerSpellAbilityCast.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerSpellAbilityCast.java @@ -254,7 +254,7 @@ public class TriggerSpellAbilityCast extends Trigger { } if (!sameNameFound) { return false; - } + } } return true; } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerTransformed.java b/forge-game/src/main/java/forge/game/trigger/TriggerTransformed.java index 49bedc53cea..b1237117a44 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerTransformed.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerTransformed.java @@ -45,10 +45,8 @@ public class TriggerTransformed extends Trigger { @Override public boolean performTest(Map runParams2) { if (this.mapParams.containsKey("ValidCard")) { - if (!matchesValid(runParams2.get("Transformer"), this.mapParams.get("ValidCard").split(","), - this.getHostCard())) { - return false; - } + return matchesValid(runParams2.get("Transformer"), this.mapParams.get("ValidCard").split(","), + this.getHostCard()); } return true; diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerTurnBegin.java b/forge-game/src/main/java/forge/game/trigger/TriggerTurnBegin.java index 032a6733081..aa0ac8a718d 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerTurnBegin.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerTurnBegin.java @@ -12,10 +12,8 @@ public class TriggerTurnBegin extends Trigger { @Override public final boolean performTest(final java.util.Map runParams2) { if (this.mapParams.containsKey("ValidPlayer")) { - if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","), - this.getHostCard())) { - return false; - } + return matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","), + this.getHostCard()); } return true; } diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerTurnFaceUp.java b/forge-game/src/main/java/forge/game/trigger/TriggerTurnFaceUp.java index 1136077e14b..41d27376928 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerTurnFaceUp.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerTurnFaceUp.java @@ -50,10 +50,8 @@ public class TriggerTurnFaceUp extends Trigger { @Override public final boolean performTest(final java.util.Map runParams2) { if (this.mapParams.containsKey("ValidCard")) { - if (!matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","), - this.getHostCard())) { - return false; - } + return matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","), + this.getHostCard()); } return true; diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerType.java b/forge-game/src/main/java/forge/game/trigger/TriggerType.java index 1c62481089e..952a21bb6f9 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerType.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerType.java @@ -98,7 +98,7 @@ public enum TriggerType { private final Constructor constructor; - private TriggerType(Class clasz) { + TriggerType(Class clasz) { constructor = findConstructor(clasz); } diff --git a/forge-game/src/main/java/forge/game/zone/MagicStack.java b/forge-game/src/main/java/forge/game/zone/MagicStack.java index 2fb39bf9915..bdaf3207197 100644 --- a/forge-game/src/main/java/forge/game/zone/MagicStack.java +++ b/forge-game/src/main/java/forge/game/zone/MagicStack.java @@ -618,7 +618,7 @@ public class MagicStack /* extends MyObservable */ implements Iterable() { @Override public boolean apply(final Card c) { - if (!c.mayPlay(who).isEmpty() || c.mayPlayerLook(who)) { - return true; - } - return false; + return !c.mayPlay(who).isEmpty() || c.mayPlayerLook(who); } }; } diff --git a/forge-game/src/main/java/forge/game/zone/Zone.java b/forge-game/src/main/java/forge/game/zone/Zone.java index 7800e400519..000da073c7c 100644 --- a/forge-game/src/main/java/forge/game/zone/Zone.java +++ b/forge-game/src/main/java/forge/game/zone/Zone.java @@ -51,10 +51,10 @@ public class Zone implements java.io.Serializable, Iterable { protected final ZoneType zoneType; protected final Game game; - protected final transient MapOfLists cardsAddedThisTurn = new EnumMapOfLists<>(ZoneType.class, CollectionSuppliers.arrayLists()); - protected final transient MapOfLists cardsAddedLastTurn = new EnumMapOfLists<>(ZoneType.class, CollectionSuppliers.arrayLists()); - protected final transient MapOfLists latestStateCardsAddedThisTurn = new EnumMapOfLists<>(ZoneType.class, CollectionSuppliers.arrayLists()); - protected final transient MapOfLists latestStateCardsAddedLastTurn = new EnumMapOfLists<>(ZoneType.class, CollectionSuppliers.arrayLists()); + protected final transient MapOfLists cardsAddedThisTurn = new EnumMapOfLists<>(ZoneType.class, CollectionSuppliers.arrayLists()); + protected final transient MapOfLists cardsAddedLastTurn = new EnumMapOfLists<>(ZoneType.class, CollectionSuppliers.arrayLists()); + protected final transient MapOfLists latestStateCardsAddedThisTurn = new EnumMapOfLists<>(ZoneType.class, CollectionSuppliers.arrayLists()); + protected final transient MapOfLists latestStateCardsAddedLastTurn = new EnumMapOfLists<>(ZoneType.class, CollectionSuppliers.arrayLists()); public Zone(final ZoneType zone0, Game game0) { zoneType = zone0; diff --git a/forge-game/src/main/java/forge/game/zone/ZoneType.java b/forge-game/src/main/java/forge/game/zone/ZoneType.java index 283c309df0e..9f358f902de 100644 --- a/forge-game/src/main/java/forge/game/zone/ZoneType.java +++ b/forge-game/src/main/java/forge/game/zone/ZoneType.java @@ -22,10 +22,10 @@ public enum ZoneType { PlanarDeck(true), None(true); - public static final List STATIC_ABILITIES_SOURCE_ZONES = Arrays.asList(new ZoneType[]{Battlefield, Graveyard, Exile, Command/*, Hand*/}); + public static final List STATIC_ABILITIES_SOURCE_ZONES = Arrays.asList(Battlefield, Graveyard, Exile, Command/*, Hand*/); private final boolean holdsHiddenInfo; - private ZoneType(boolean holdsHidden) { + ZoneType(boolean holdsHidden) { holdsHiddenInfo = holdsHidden; } diff --git a/forge-game/src/main/java/forge/trackable/TrackableProperty.java b/forge-game/src/main/java/forge/trackable/TrackableProperty.java index bae4622580e..232788992bd 100644 --- a/forge-game/src/main/java/forge/trackable/TrackableProperty.java +++ b/forge-game/src/main/java/forge/trackable/TrackableProperty.java @@ -172,10 +172,10 @@ public enum TrackableProperty { private final TrackableType type; private final FreezeMode freezeMode; - private TrackableProperty(TrackableType type0) { + TrackableProperty(TrackableType type0) { this(type0, FreezeMode.RespectsFreeze); } - private TrackableProperty(TrackableType type0, FreezeMode freezeMode0) { + TrackableProperty(TrackableType type0, FreezeMode freezeMode0) { type = type0; freezeMode = freezeMode0; } diff --git a/forge-game/src/main/java/forge/util/MessageUtil.java b/forge-game/src/main/java/forge/util/MessageUtil.java index efdbc0c040f..ea46eeb77e3 100644 --- a/forge-game/src/main/java/forge/util/MessageUtil.java +++ b/forge-game/src/main/java/forge/util/MessageUtil.java @@ -9,7 +9,7 @@ import forge.game.spellability.SpellAbility; public class MessageUtil { - private MessageUtil() { }; + private MessageUtil() { } public static String formatMessage(String message, Player player, Object related) { if (related instanceof Player && message.indexOf("{player") >= 0) { diff --git a/forge-gui-android/AndroidManifest.xml b/forge-gui-android/AndroidManifest.xml index 3b743c30f49..f207f20d405 100644 --- a/forge-gui-android/AndroidManifest.xml +++ b/forge-gui-android/AndroidManifest.xml @@ -15,6 +15,7 @@ jar -Xms1024m -Xmx1536m - 1.6.27.001 + 1.6.28.001 keystore alias storepass @@ -19,7 +19,7 @@ forge forge - 1.6.28-SNAPSHOT + 1.6.29-SNAPSHOT forge-gui-android diff --git a/forge-gui-desktop/pom.xml b/forge-gui-desktop/pom.xml index 9d7e5e8dc9d..2f70bf99f2c 100644 --- a/forge-gui-desktop/pom.xml +++ b/forge-gui-desktop/pom.xml @@ -4,7 +4,7 @@ forge forge - 1.6.28-SNAPSHOT + 1.6.29-SNAPSHOT forge-gui-desktop diff --git a/forge-gui-desktop/src/main/java/forge/screens/deckeditor/controllers/CEditorQuest.java b/forge-gui-desktop/src/main/java/forge/screens/deckeditor/controllers/CEditorQuest.java index 4bafc436d96..e502263eee2 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/deckeditor/controllers/CEditorQuest.java +++ b/forge-gui-desktop/src/main/java/forge/screens/deckeditor/controllers/CEditorQuest.java @@ -221,7 +221,7 @@ public final class CEditorQuest extends CDeckEditor { if (n == 0) { s = "Remove custom rating"; } else { - s = "Rate this card as " + Integer.toString(n) + " stars"; + s = "Rate this card as " + n + " stars"; } GuiUtils.addMenuItem(cmb.getMenu(), s, KeyStroke.getKeyStroke(48 + n, 0), diff --git a/forge-gui-desktop/src/main/java/forge/screens/deckeditor/controllers/CEditorQuestCardShop.java b/forge-gui-desktop/src/main/java/forge/screens/deckeditor/controllers/CEditorQuestCardShop.java index c9f8f5c0fb2..11e1c512e83 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/deckeditor/controllers/CEditorQuestCardShop.java +++ b/forge-gui-desktop/src/main/java/forge/screens/deckeditor/controllers/CEditorQuestCardShop.java @@ -83,10 +83,10 @@ public final class CEditorQuestCardShop extends ACEditorBase { private List fullCatalogCards; // remember changed gui elements - private String CCTabLabel = new String(); - private String CCAddLabel = new String(); - private String CDTabLabel = new String(); - private String CDRemLabel = new String(); + private String CCTabLabel = ""; + private String CCAddLabel = ""; + private String CDTabLabel = ""; + private String CDRemLabel = ""; private String prevRem4Label = null; private String prevRem4Tooltip = null; private Runnable prevRem4Cmd = null; diff --git a/forge-gui-desktop/src/main/java/forge/screens/home/gauntlet/ContestGauntletLister.java b/forge-gui-desktop/src/main/java/forge/screens/home/gauntlet/ContestGauntletLister.java index f465232242b..588cf960802 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/home/gauntlet/ContestGauntletLister.java +++ b/forge-gui-desktop/src/main/java/forge/screens/home/gauntlet/ContestGauntletLister.java @@ -79,8 +79,8 @@ public class ContestGauntletLister extends JPanel { name = gd.getName(); name = name.substring(GauntletIO.PREFIX_LOCKED.length()); - progress = String.valueOf(Math.round( - ((double) gd.getCompleted() / (double) gd.getDecks().size()) * 100)) + " %"; + progress = Math.round( + ((double) gd.getCompleted() / (double) gd.getDecks().size()) * 100) + " %"; if (gd.getUserDeck() == null) { progress = "---"; diff --git a/forge-gui-desktop/src/main/java/forge/screens/home/gauntlet/QuickGauntletLister.java b/forge-gui-desktop/src/main/java/forge/screens/home/gauntlet/QuickGauntletLister.java index 1938459912c..b0e9d04cfdb 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/home/gauntlet/QuickGauntletLister.java +++ b/forge-gui-desktop/src/main/java/forge/screens/home/gauntlet/QuickGauntletLister.java @@ -110,8 +110,8 @@ public class QuickGauntletLister extends JPanel { row.add(new FLabel.Builder().text(String.valueOf(gd.getDecks().size())) .fontAlign(SwingConstants.RIGHT).build(), "w 90px!, h 20px!, gap 0 0 5px 0"); - row.add(new FLabel.Builder().text(String.valueOf(Math.round( - ((double) gd.getCompleted() / (double) gd.getDecks().size()) * 100)) + "%") + row.add(new FLabel.Builder().text(Math.round( + ((double) gd.getCompleted() / (double) gd.getDecks().size()) * 100) + "%") .fontAlign(SwingConstants.RIGHT).build(), "w 90px!, h 20px!, gap 0 0 5px 0"); this.add(row, "w 98%!, h 30px!, gap 1% 0 0 0"); diff --git a/forge-gui-desktop/src/main/java/forge/screens/home/quest/VSubmenuQuestData.java b/forge-gui-desktop/src/main/java/forge/screens/home/quest/VSubmenuQuestData.java index 3813522c759..65454ac06ce 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/home/quest/VSubmenuQuestData.java +++ b/forge-gui-desktop/src/main/java/forge/screens/home/quest/VSubmenuQuestData.java @@ -49,7 +49,7 @@ public enum VSubmenuQuestData implements IVSubmenu { private final FLabel lblTitleNew = new FLabel.Builder().text(localizer.getMessage("lblStartanewQuest")).opaque(true).fontSize(16).build(); - String str=new String( ForgeConstants.QUEST_SAVE_DIR.replace('\\', '/')); + String str= ForgeConstants.QUEST_SAVE_DIR.replace('\\', '/'); private final FLabel lblOldQuests = new FLabel.Builder().text(localizer.getMessage("lblOldQuestData").replace("%s",str)).fontAlign(SwingConstants.CENTER).fontSize(12).build(); private final QuestFileLister lstQuests = new QuestFileLister(); private final FScrollPane scrQuests = new FScrollPane(lstQuests, false); diff --git a/forge-gui-desktop/src/main/java/forge/screens/home/quest/ViewItem.java b/forge-gui-desktop/src/main/java/forge/screens/home/quest/ViewItem.java index 002165d9255..31b8aa1a43b 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/home/quest/ViewItem.java +++ b/forge-gui-desktop/src/main/java/forge/screens/home/quest/ViewItem.java @@ -89,7 +89,7 @@ public class ViewItem extends FPanel { ViewItem.this.lblIcon.setIcon(i); ViewItem.this.lblName.setText(bazaarItem.getPurchaseName()); - ViewItem.this.lblPrice.setText("Cost: " + String.valueOf(bazaarItem.getBuyingPrice(qA)) + " credits"); + ViewItem.this.lblPrice.setText("Cost: " + bazaarItem.getBuyingPrice(qA) + " credits"); String desc = bazaarItem.getPurchaseDescription(qA); ViewItem.this.tarDesc.setText(FSkin.encodeSymbols(desc, false)); //encode in case there are mana symbols in description diff --git a/forge-gui-desktop/src/main/java/forge/screens/match/CMatchUI.java b/forge-gui-desktop/src/main/java/forge/screens/match/CMatchUI.java index 1d6b5532257..dc80e578182 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/match/CMatchUI.java +++ b/forge-gui-desktop/src/main/java/forge/screens/match/CMatchUI.java @@ -101,7 +101,6 @@ import forge.util.gui.SOptionPane; import forge.view.FView; import forge.view.arcane.CardPanel; import forge.view.arcane.FloatingZone; -import forge.match.input.*; /** * Constructs instance of match UI controller, used as a single point of diff --git a/forge-gui-desktop/src/main/java/forge/screens/match/VAssignDamage.java b/forge-gui-desktop/src/main/java/forge/screens/match/VAssignDamage.java index 9e9fcb0df1d..8b4717a3929 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/match/VAssignDamage.java +++ b/forge-gui-desktop/src/main/java/forge/screens/match/VAssignDamage.java @@ -174,7 +174,7 @@ public class VAssignDamage { final JPanel pnlDefenders = new JPanel(); pnlDefenders.setOpaque(false); int cols = attackerHasTrample ? blockers.size() + 1 : blockers.size(); - final String wrap = "wrap " + Integer.toString(cols); + final String wrap = "wrap " + cols; pnlDefenders.setLayout(new MigLayout("insets 0, gap 0, ax center, " + wrap)); final FScrollPane scrDefenders = new FScrollPane(pnlDefenders, false); diff --git a/forge-gui-desktop/src/main/java/forge/sound/AudioClip.java b/forge-gui-desktop/src/main/java/forge/sound/AudioClip.java index 19c15568c11..105dadd8882 100644 --- a/forge-gui-desktop/src/main/java/forge/sound/AudioClip.java +++ b/forge-gui-desktop/src/main/java/forge/sound/AudioClip.java @@ -24,7 +24,10 @@ import forge.properties.ForgeConstants; import java.io.File; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import java.util.MissingResourceException; +import java.util.function.Supplier; /** @@ -34,7 +37,10 @@ import java.util.MissingResourceException; * @author Agetian */ public class AudioClip implements IAudioClip { - private Clip clip; + private final int maxSize = 16; + private String filename; + private List clips; + private boolean failed; public static boolean fileExists(String fileName) { File fSound = new File(ForgeConstants.SOUND_DIR, fileName); @@ -42,72 +48,166 @@ public class AudioClip implements IAudioClip { } public AudioClip(final String filename) { - File fSound = new File(ForgeConstants.SOUND_DIR, filename); - if (!fSound.exists()) { - throw new IllegalArgumentException("Sound file " + fSound.toString() + " does not exist, cannot make a clip of it"); - } - - try { - AudioInputStream stream = AudioSystem.getAudioInputStream(fSound); - AudioFormat format = stream.getFormat(); - DataLine.Info info = new DataLine.Info(Clip.class, stream.getFormat(), ((int) stream.getFrameLength() * format.getFrameSize())); - clip = (Clip) AudioSystem.getLine(info); - clip.open(stream); - return; - - } catch (IOException ex) { - System.err.println("Unable to load sound file: " + filename); - } catch (LineUnavailableException ex) { - System.err.println("Error initializing sound system: " + ex); - } catch (UnsupportedAudioFileException ex) { - System.err.println("Unsupported file type of the sound file: " + fSound.toString() + " - " + ex.getMessage()); - clip = null; - return; - } - throw new MissingResourceException("Sound clip failed to load", this.getClass().getName(), filename); + this.filename = filename; + clips = new ArrayList<>(maxSize); + addClip(); } @Override public final void play() { - if (null == clip) { - return; + if (clips.stream().anyMatch(ClipWrapper::isRunning)) { + // introduce small delay to make a batch sounds more granular, + // e.g. when you auto-tap 4 lands the 4 tap sounds should + // not become completely merged + waitSoundSystemDelay(); } - clip.setMicrosecondPosition(0); - try { - Thread.sleep(SoundSystem.DELAY); - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - clip.start(); + getIdleClip().start(); } @Override public final void loop() { - if (null == clip) { - return; - } - clip.setMicrosecondPosition(0); - try { - Thread.sleep(SoundSystem.DELAY); - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - clip.loop(Clip.LOOP_CONTINUOUSLY); + getIdleClip().loop(); } @Override public final void stop() { - if (null == clip) { - return; + for (ClipWrapper clip: clips) { + clip.stop(); } - clip.stop(); } @Override public final boolean isDone() { - if (null == clip) { + return clips.stream().noneMatch(ClipWrapper::isRunning); + } + + private ClipWrapper getIdleClip() { + return clips.stream() + .filter(clip -> !clip.isRunning()) + .findFirst() + .orElseGet(this::addClip); + } + + private ClipWrapper addClip() { + if (clips.size() < maxSize && !failed) { + ClipWrapper clip = new ClipWrapper(filename); + if (clip.isFailed()) { + failed = true; + } else { + clips.add(clip); + } + return clip; + } + return ClipWrapper.Dummy; + } + + + + private static boolean waitSoundSystemDelay() { + try { + Thread.sleep(SoundSystem.DELAY); + return true; + } catch (InterruptedException ex) { + ex.printStackTrace(); return false; } - return !clip.isRunning(); + } + + static class ClipWrapper { + private final Clip clip; + private boolean started; + static final ClipWrapper Dummy = new ClipWrapper(); + + private ClipWrapper() { + clip = null; + } + + ClipWrapper(String filename) { + clip = createClip(filename); + if (clip != null) { + clip.addLineListener(this::clipStateChanged); + } + } + + boolean isFailed() { + return null == clip; + } + + void start() { + if (null == clip) { + return; + } + synchronized (this) { + clip.setMicrosecondPosition(0); + this.started = false; + clip.start(); + // with JRE 1.8.0_211 if another thread called clip.setMicrosecondPosition + // just now, it would deadlock. To prevent this we synchronize this method + // and wait + wait(() -> this.started); + } + } + + void loop() { + if (null == clip) { + return; + } + synchronized (this) { + clip.setMicrosecondPosition(0); + this.started = false; + clip.loop(Clip.LOOP_CONTINUOUSLY); + wait(() -> this.started); + } + } + + void stop() { + if (null == clip) { + return; + } + synchronized (this) { + clip.stop(); + } + } + + boolean isRunning() { + return clip != null && (clip.isRunning() || clip.isActive()); + } + + private Clip createClip(String filename) { + File fSound = new File(ForgeConstants.SOUND_DIR, filename); + if (!fSound.exists()) { + throw new IllegalArgumentException("Sound file " + fSound.toString() + " does not exist, cannot make a clip of it"); + } + + try { + AudioInputStream stream = AudioSystem.getAudioInputStream(fSound); + AudioFormat format = stream.getFormat(); + DataLine.Info info = new DataLine.Info(Clip.class, stream.getFormat(), ((int) stream.getFrameLength() * format.getFrameSize())); + Clip clip = (Clip) AudioSystem.getLine(info); + clip.open(stream); + return clip; + } catch (IOException ex) { + System.err.println("Unable to load sound file: " + filename); + } catch (LineUnavailableException ex) { + System.err.println("Error initializing sound system: " + ex); + } catch (UnsupportedAudioFileException ex) { + System.err.println("Unsupported file type of the sound file: " + fSound.toString() + " - " + ex.getMessage()); + return null; + } + throw new MissingResourceException("Sound clip failed to load", this.getClass().getName(), filename); + } + + private void clipStateChanged(LineEvent lineEvent) { + started |= lineEvent.getType() == LineEvent.Type.START; + } + + private void wait(Supplier completed) { + final int attempts = 5; + for (int i = 0; i < attempts; i++) { + if (completed.get() || !waitSoundSystemDelay()) { + break; + } + } + } } } diff --git a/forge-gui-desktop/src/main/java/forge/toolbox/imaging/FImagePanel.java b/forge-gui-desktop/src/main/java/forge/toolbox/imaging/FImagePanel.java index 1bfcdd2b460..9c53990d84d 100644 --- a/forge-gui-desktop/src/main/java/forge/toolbox/imaging/FImagePanel.java +++ b/forge-gui-desktop/src/main/java/forge/toolbox/imaging/FImagePanel.java @@ -282,7 +282,7 @@ public class FImagePanel extends JPanel { at.translate(this.getWidth() / 2, this.getHeight() / 2); // 3. rotate around (0,0). - at.rotate(Math.toRadians((double) degreesOfRotation)); + at.rotate(Math.toRadians(degreesOfRotation)); // 2. scale image. if (createScaleTransform) { diff --git a/forge-gui-desktop/src/main/java/forge/toolbox/special/PlayerDetailsPanel.java b/forge-gui-desktop/src/main/java/forge/toolbox/special/PlayerDetailsPanel.java index 79fa196ba8f..79c32a486cc 100644 --- a/forge-gui-desktop/src/main/java/forge/toolbox/special/PlayerDetailsPanel.java +++ b/forge-gui-desktop/src/main/java/forge/toolbox/special/PlayerDetailsPanel.java @@ -213,7 +213,7 @@ public class PlayerDetailsPanel extends JPanel { } public void setToolTip(final String... args) { - super.setToolTipText(String.format(tooltip, (Object[]) args)); + super.setToolTipText(String.format(tooltip, args)); } @Override diff --git a/forge-gui-desktop/src/main/java/forge/view/arcane/CardPanel.java b/forge-gui-desktop/src/main/java/forge/view/arcane/CardPanel.java index 0ae68b24e79..e3d2270d7dd 100644 --- a/forge-gui-desktop/src/main/java/forge/view/arcane/CardPanel.java +++ b/forge-gui-desktop/src/main/java/forge/view/arcane/CardPanel.java @@ -693,7 +693,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl titleText.setText(card.getCurrentState().getName()); final int damage = card.getDamage(); - damageText.setText(damage > 0 ? "\u00BB " + String.valueOf(damage) + " \u00AB" : ""); + damageText.setText(damage > 0 ? "\u00BB " + damage + " \u00AB" : ""); // Card Id overlay cardIdText.setText(card.getCurrentState().getDisplayId()); diff --git a/forge-gui-desktop/src/test/java/forge/planarconquestgenerate/PlanarConquestCommanderGeneraterGA.java b/forge-gui-desktop/src/test/java/forge/planarconquestgenerate/PlanarConquestCommanderGeneraterGA.java index 3eedba838c6..d74ac25ac6d 100644 --- a/forge-gui-desktop/src/test/java/forge/planarconquestgenerate/PlanarConquestCommanderGeneraterGA.java +++ b/forge-gui-desktop/src/test/java/forge/planarconquestgenerate/PlanarConquestCommanderGeneraterGA.java @@ -109,7 +109,7 @@ public class PlanarConquestCommanderGeneraterGA extends PlanarConquestGeneraterG @Override protected Deck mutateObject(Deck parent1) { PaperCard allele = parent1.getCommanders().get(0); - if(!standardMap.keySet().contains(allele.getName())){ + if(!standardMap.containsKey(allele.getName())){ return null; } return getDeckForCard(allele); diff --git a/forge-gui-desktop/src/test/java/forge/planarconquestgenerate/PlanarConquestGeneraterGA.java b/forge-gui-desktop/src/test/java/forge/planarconquestgenerate/PlanarConquestGeneraterGA.java index 1ff8140c537..5d352e0d51a 100644 --- a/forge-gui-desktop/src/test/java/forge/planarconquestgenerate/PlanarConquestGeneraterGA.java +++ b/forge-gui-desktop/src/test/java/forge/planarconquestgenerate/PlanarConquestGeneraterGA.java @@ -174,7 +174,7 @@ public class PlanarConquestGeneraterGA extends AbstractGeneticAlgorithm { @Override protected Deck mutateObject(Deck parent1) { PaperCard allele = parent1.getMain().get(MyRandom.getRandom().nextInt(8)); - if(!standardMap.keySet().contains(allele.getName())){ + if(!standardMap.containsKey(allele.getName())){ return null; } return getDeckForCard(allele); @@ -184,8 +184,8 @@ public class PlanarConquestGeneraterGA extends AbstractGeneticAlgorithm { protected Deck createChild(Deck parent1, Deck parent2) { PaperCard allele = parent1.getMain().get(MyRandom.getRandom().nextInt(8)); PaperCard allele2 = parent2.getMain().get(MyRandom.getRandom().nextInt(8)); - if(!standardMap.keySet().contains(allele.getName()) - ||!standardMap.keySet().contains(allele2.getName()) + if(!standardMap.containsKey(allele.getName()) + ||!standardMap.containsKey(allele2.getName()) ||allele.getName().equals(allele2.getName())){ return null; } diff --git a/forge-gui-ios/pom.xml b/forge-gui-ios/pom.xml index 628d3d9210c..550be4903b2 100644 --- a/forge-gui-ios/pom.xml +++ b/forge-gui-ios/pom.xml @@ -6,13 +6,13 @@ jar -Xms128m -Xmx2048m - 1.6.27.001 + 1.6.28.001 forge forge - 1.6.28-SNAPSHOT + 1.6.29-SNAPSHOT forge-gui-ios diff --git a/forge-gui-mobile-dev/pom.xml b/forge-gui-mobile-dev/pom.xml index 4e745345768..5a552e6fc65 100644 --- a/forge-gui-mobile-dev/pom.xml +++ b/forge-gui-mobile-dev/pom.xml @@ -4,7 +4,7 @@ forge forge - 1.6.28-SNAPSHOT + 1.6.29-SNAPSHOT forge-gui-mobile-dev diff --git a/forge-gui-mobile-dev/src/forge/app/Main.java b/forge-gui-mobile-dev/src/forge/app/Main.java index d5a932cefda..d80bc49cdae 100644 --- a/forge-gui-mobile-dev/src/forge/app/Main.java +++ b/forge-gui-mobile-dev/src/forge/app/Main.java @@ -77,7 +77,7 @@ public class Main { boolean fullscreenFlag = true; if (FileUtil.doesFileExist(desktopModeAssetsDir + "screen_resolution.ini")) { res = FileUtil.readFileToString(desktopModeAssetsDir + "screen_resolution.ini").split("x"); - fullscreenFlag = res.length == 3 ? Integer.parseInt(res[2].trim()) > 0 : true; + fullscreenFlag = res.length != 3 || Integer.parseInt(res[2].trim()) > 0; if (res.length >= 2) { desktopScreenWidth = Integer.parseInt(res[0].trim()); desktopScreenHeight = Integer.parseInt(res[1].trim()); diff --git a/forge-gui-mobile/pom.xml b/forge-gui-mobile/pom.xml index 79bc4accf79..7b5224aa9c6 100644 --- a/forge-gui-mobile/pom.xml +++ b/forge-gui-mobile/pom.xml @@ -4,7 +4,7 @@ forge forge - 1.6.28-SNAPSHOT + 1.6.29-SNAPSHOT forge-gui-mobile diff --git a/forge-gui-mobile/src/forge/Forge.java b/forge-gui-mobile/src/forge/Forge.java index 44cab2a5976..15f603356ca 100644 --- a/forge-gui-mobile/src/forge/Forge.java +++ b/forge-gui-mobile/src/forge/Forge.java @@ -34,7 +34,7 @@ import java.util.List; import java.util.Stack; public class Forge implements ApplicationListener { - public static final String CURRENT_VERSION = "1.6.27.001"; + public static final String CURRENT_VERSION = "1.6.28.001"; private static final ApplicationListener app = new Forge(); private static Clipboard clipboard; @@ -49,6 +49,9 @@ public class Forge implements ApplicationListener { private static int continuousRenderingCount = 1; //initialize to 1 since continuous rendering is the default private static final Stack screens = new Stack(); private static boolean textureFiltering = false; + private static boolean destroyThis = false; + public static String extrawide = "default"; + public static float heigtModifier = 0.0f; public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0) { if (GuiBase.getInterface() == null) { @@ -70,7 +73,14 @@ public class Forge implements ApplicationListener { graphics = new Graphics(); splashScreen = new SplashScreen(); Gdx.input.setInputProcessor(new MainInputProcessor()); - + /* + Set CatchBackKey here and exit the app when you hit the + back button while the textures,fonts,etc are still loading, + to prevent rendering issue when you try to restart + the app again (seems it doesnt dispose correctly...?!?) + */ + Gdx.input.setCatchKey(Keys.BACK, true); + destroyThis = true; //Prevent back() ForgePreferences prefs = new ForgePreferences(); String skinName; @@ -115,9 +125,8 @@ public class Forge implements ApplicationListener { FSkin.loadFull(splashScreen); SoundSystem.instance.setBackgroundMusic(MusicPlaylist.MENUS); //start background music - - Gdx.input.setCatchBackKey(true); - Gdx.input.setCatchMenuKey(true); + destroyThis = false; //Allow back() + Gdx.input.setCatchKey(Keys.MENU, true); openScreen(HomeScreen.instance); splashScreen = null; @@ -126,6 +135,9 @@ public class Forge implements ApplicationListener { NewGameMenu.getPreferredScreen().open(); } + //adjust height modifier + adjustHeightModifier(getScreenWidth(), getScreenHeight()); + //update landscape mode preference if it doesn't match what the app loaded as if (FModel.getPreferences().getPrefBoolean(FPref.UI_LANDSCAPE_MODE) != isLandscapeMode) { FModel.getPreferences().setPref(FPref.UI_LANDSCAPE_MODE, isLandscapeMode); @@ -154,6 +166,29 @@ public class Forge implements ApplicationListener { } } + public static void setHeightModifier(float height) { + heigtModifier = height; + } + + public static float getHeightModifier() { + return heigtModifier; + } + + public static void adjustHeightModifier(float DisplayW, float DisplayH) { + if(isLandscapeMode()) + {//TODO: Fullscreen support for Display without screen controls + float aspectratio = DisplayW / DisplayH; + if(aspectratio > 1.82f) {/* extra wide */ + setHeightModifier(200.0f); + extrawide = "extrawide"; + } + else if(aspectratio > 1.7f) {/* wide */ + setHeightModifier(100.0f); + extrawide = "wide"; + } + } + } + public static void showMenu() { if (currentScreen == null) { return; } endKeyInput(); //end key input before menu shown @@ -167,6 +202,8 @@ public class Forge implements ApplicationListener { } public static void back() { + if(destroyThis && isLandscapeMode()) + return; if (screens.size() < 2) { exit(false); //prompt to exit if attempting to go back from home screen return; @@ -481,7 +518,12 @@ public class Forge implements ApplicationListener { touchDown(0,0,0,0); return fling(0,1000); } - + if(keyCode == Keys.BACK){ + if (destroyThis) + deviceAdapter.exit(); + else if(onHomeScreen() && isLandscapeMode()) + back(); + } if (keyInputAdapter == null) { if (KeyInputAdapter.isModifierKey(keyCode)) { return false; //don't process modifiers keys for unknown adapter diff --git a/forge-gui-mobile/src/forge/Graphics.java b/forge-gui-mobile/src/forge/Graphics.java index b2a99f88617..64ca50b75a7 100644 --- a/forge-gui-mobile/src/forge/Graphics.java +++ b/forge-gui-mobile/src/forge/Graphics.java @@ -535,7 +535,16 @@ public class Graphics { } public void drawImage(FImage image, float x, float y, float w, float h) { + drawImage(image, x, y, w, h, false); + } + public void drawImage(FImage image, float x, float y, float w, float h, boolean withDarkOverlay) { image.draw(this, x, y, w, h); + if(withDarkOverlay){ + float oldalpha = alphaComposite; + setAlphaComposite(0.4f); + fillRect(Color.BLACK, x, y, w, h); + setAlphaComposite(oldalpha); + } } public void drawImage(Texture image, float x, float y, float w, float h) { batch.draw(image, adjustX(x), adjustY(y, h), w, h); diff --git a/forge-gui-mobile/src/forge/animation/AbilityEffect.java b/forge-gui-mobile/src/forge/animation/AbilityEffect.java index 868d527863b..755aa68d16a 100644 --- a/forge-gui-mobile/src/forge/animation/AbilityEffect.java +++ b/forge-gui-mobile/src/forge/animation/AbilityEffect.java @@ -11,7 +11,7 @@ public enum AbilityEffect { private GifAnimation animation; private AudioClip soundClip; - private AbilityEffect(String gif0, String wav0) { + AbilityEffect(String gif0, String wav0) { gif = gif0; wav = wav0; } diff --git a/forge-gui-mobile/src/forge/animation/GifDecoder.java b/forge-gui-mobile/src/forge/animation/GifDecoder.java index a0aa82ad767..301bec02894 100644 --- a/forge-gui-mobile/src/forge/animation/GifDecoder.java +++ b/forge-gui-mobile/src/forge/animation/GifDecoder.java @@ -254,7 +254,7 @@ public class GifDecoder { if (frameCount <= 0) return null; n = n % frameCount; - return ((GifFrame) frames.elementAt(n)).image; + return frames.elementAt(n).image; } /** @@ -692,7 +692,7 @@ public class GifDecoder { Pixmap frame = getFrame(0); int width = frame.getWidth(); int height = frame.getHeight(); - int vzones = (int)Math.sqrt((double)nrFrames); + int vzones = (int)Math.sqrt(nrFrames); int hzones = vzones; while(vzones * hzones < nrFrames) vzones++; diff --git a/forge-gui-mobile/src/forge/assets/BitmapFontWriter.java b/forge-gui-mobile/src/forge/assets/BitmapFontWriter.java index 457a337d2ec..768eb1e4efe 100644 --- a/forge-gui-mobile/src/forge/assets/BitmapFontWriter.java +++ b/forge-gui-mobile/src/forge/assets/BitmapFontWriter.java @@ -40,12 +40,12 @@ import com.badlogic.gdx.utils.Array; public class BitmapFontWriter { /** The output format. */ - public static enum OutputFormat { + public enum OutputFormat { /** AngelCodeFont text format */ Text, /** AngelCodeFont XML format */ - XML; + XML } /** The output format */ diff --git a/forge-gui-mobile/src/forge/assets/FSkinFont.java b/forge-gui-mobile/src/forge/assets/FSkinFont.java index 726edaabc3a..4cec472b453 100644 --- a/forge-gui-mobile/src/forge/assets/FSkinFont.java +++ b/forge-gui-mobile/src/forge/assets/FSkinFont.java @@ -187,6 +187,30 @@ public class FSkinFont { //only generate images for characters that could be used by Forge String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\"!?'.,;:()[]{}<>|/@\\^$-%+=#_&*\u2014\u2022"; chars += "ÁÉÍÓÚáéíóúÀÈÌÒÙàèìòùÑñÄËÏÖÜäëïöüẞß"; + //generate from zh-CN.properties + chars += "“”、一三上下不与专且东两个中临为主么义之乐也了争事二于五些交产" + + "亮人什仅从他付代以们件价任优会传伤但位低住体何作你使例供侧侵便" + + "保信倍候值偏做停偿像允元充先克入全关其具兼兽内再冒决况准减凑几" + + "出击分切列则创初删利到制刷前剪副力功加动助励势包化匹区十协单卖" + + "博卡印即原去参双发取受变叠口句只召可台史右号司合同名后向吗否含" + + "启告员周命和咒品哪唤售商喜器回因团困围图在地场均坊坏坟型域基堆" + + "塞境墓增声处备复多大天太失头夹奇奖套好如始子字存它完宏官定宝实" + + "宠客害家容对导将小少尝就局层屏展属巅左差已市布带帮常幕并幻序库" + + "应底店度建开异弊式引张弧强当录形征很得御徽必志快忽态性总恢息您" + + "悬情惊惰想意慢戏成我或战户所手才打执找把抓抗折报拉拟拥择括持指" + + "按挑挡挥损换据捷排探接控掷描提摩摸撤播操擎支收改攻放故效数文斗" + + "斯新方旅无日旧时明易星是显景暂暴更替最有服期未本术机权束来杯松" + + "板构果柄染查标栏样格框档检植模次止正此死殊段每比池没法注洗洛活" + + "测消涵混添清渐温渲游源滤灵灼点烁烧然片版牌物特状独率王玩环现珍" + + "理瓦生用由画界留略登白百的盒盖盘目直相省看着瞄瞬知破确磨示神票" + + "禁离种秘积称移稀程空窗立竞章第等筑筛简管箭类精系素索紧红级线组" + + "细终经结给络统继绩续维绿缓编缩缺网置者而联肥背胜能脚自至致舒航" + + "般艇色节英范莫获菜蓝薪藏行衍衡补表被西要覆观规视览觉角解触言誓" + + "警计认让记许论设证评试诗诡该详语误说请读调谋谜象败费资赌赛赢起" + + "距跳踢转轮轻载较辑输辨边过运近返还这进远连述退适选逐递速造道那" + + "部都配醒释里重量金钮铁银销锁锋错锦键长门闪闭间队防阴阶阻限除险" + + "隆随隐障难雄集雪需静非靠面音页顶项顺须顿预题颜风飞首验骰高魔鹏" + + "黑默鼠!(),:?"; final PixmapPacker packer = new PixmapPacker(pageSize, pageSize, Pixmap.Format.RGBA8888, 2, false); final FreeTypeFontParameter parameter = new FreeTypeFontParameter(); parameter.characters = chars; diff --git a/forge-gui-mobile/src/forge/assets/FSkinTexture.java b/forge-gui-mobile/src/forge/assets/FSkinTexture.java index 1e5689ea45d..772d897cb24 100644 --- a/forge-gui-mobile/src/forge/assets/FSkinTexture.java +++ b/forge-gui-mobile/src/forge/assets/FSkinTexture.java @@ -7,94 +7,99 @@ import com.badlogic.gdx.graphics.Texture.TextureWrap; import forge.Graphics; import forge.properties.ForgeConstants; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + public enum FSkinTexture implements FImage { BG_TEXTURE(ForgeConstants.TEXTURE_BG_FILE, true, false), BG_MATCH(ForgeConstants.MATCH_BG_FILE, false, false), BG_SPACE(ForgeConstants.SPACE_BG_FILE, false, false), BG_CHAOS_WHEEL(ForgeConstants.CHAOS_WHEEL_IMG_FILE, false, false), - BG_PLANE1(ForgeConstants.BG_1, false, true), - BG_PLANE2(ForgeConstants.BG_2, false, true), - BG_PLANE3(ForgeConstants.BG_3, false, true), - BG_PLANE4(ForgeConstants.BG_4, false, true), - BG_PLANE5(ForgeConstants.BG_5, false, true), - BG_PLANE6(ForgeConstants.BG_6, false, true), - BG_PLANE7(ForgeConstants.BG_7, false, true), - BG_PLANE8(ForgeConstants.BG_8, false, true), - BG_PLANE9(ForgeConstants.BG_9, false, true), - BG_PLANE10(ForgeConstants.BG_10, false, true), - BG_PLANE11(ForgeConstants.BG_11, false, true), - BG_PLANE12(ForgeConstants.BG_12, false, true), - BG_PLANE13(ForgeConstants.BG_13, false, true), - BG_PLANE14(ForgeConstants.BG_14, false, true), - BG_PLANE15(ForgeConstants.BG_15, false, true), - BG_PLANE16(ForgeConstants.BG_16, false, true), - BG_PLANE17(ForgeConstants.BG_17, false, true), - BG_PLANE18(ForgeConstants.BG_18, false, true), - BG_PLANE19(ForgeConstants.BG_19, false, true), - BG_PLANE20(ForgeConstants.BG_20, false, true), - BG_PLANE21(ForgeConstants.BG_21, false, true), - BG_PLANE22(ForgeConstants.BG_22, false, true), - BG_PLANE23(ForgeConstants.BG_23, false, true), - BG_PLANE24(ForgeConstants.BG_24, false, true), - BG_PLANE25(ForgeConstants.BG_25, false, true), - BG_PLANE26(ForgeConstants.BG_26, false, true), - BG_PLANE27(ForgeConstants.BG_27, false, true), - BG_PLANE28(ForgeConstants.BG_28, false, true), - BG_PLANE29(ForgeConstants.BG_29, false, true), - BG_PLANE30(ForgeConstants.BG_30, false, true), - BG_PLANE31(ForgeConstants.BG_31, false, true), - BG_PLANE32(ForgeConstants.BG_32, false, true), - BG_PLANE33(ForgeConstants.BG_33, false, true), - BG_PLANE34(ForgeConstants.BG_34, false, true), - BG_PLANE35(ForgeConstants.BG_35, false, true), - BG_PLANE36(ForgeConstants.BG_36, false, true), - BG_PLANE37(ForgeConstants.BG_37, false, true), - BG_PLANE38(ForgeConstants.BG_38, false, true), - BG_PLANE39(ForgeConstants.BG_39, false, true), - BG_PLANE40(ForgeConstants.BG_40, false, true), - BG_PLANE41(ForgeConstants.BG_41, false, true), - BG_PLANE42(ForgeConstants.BG_42, false, true), - BG_PLANE43(ForgeConstants.BG_43, false, true), - BG_PLANE44(ForgeConstants.BG_44, false, true), - BG_PLANE45(ForgeConstants.BG_45, false, true), - BG_PLANE46(ForgeConstants.BG_46, false, true), - BG_PLANE47(ForgeConstants.BG_47, false, true), - BG_PLANE48(ForgeConstants.BG_48, false, true), - BG_PLANE49(ForgeConstants.BG_49, false, true), - BG_PLANE50(ForgeConstants.BG_50, false, true), - BG_PLANE51(ForgeConstants.BG_51, false, true), - BG_PLANE52(ForgeConstants.BG_52, false, true), - BG_PLANE53(ForgeConstants.BG_53, false, true), - BG_PLANE54(ForgeConstants.BG_54, false, true), - BG_PLANE55(ForgeConstants.BG_55, false, true), - BG_PLANE56(ForgeConstants.BG_56, false, true), - BG_PLANE57(ForgeConstants.BG_57, false, true), - BG_PLANE58(ForgeConstants.BG_58, false, true), - BG_PLANE59(ForgeConstants.BG_59, false, true), - BG_PLANE60(ForgeConstants.BG_60, false, true), - BG_PLANE61(ForgeConstants.BG_61, false, true), - BG_PLANE62(ForgeConstants.BG_62, false, true), - BG_PLANE63(ForgeConstants.BG_63, false, true), - BG_PLANE64(ForgeConstants.BG_64, false, true), - BG_PLANE65(ForgeConstants.BG_65, false, true), - BG_PLANE66(ForgeConstants.BG_66, false, true), - BG_PLANE67(ForgeConstants.BG_67, false, true), - BG_PLANE68(ForgeConstants.BG_68, false, true), - BG_PLANE69(ForgeConstants.BG_69, false, true), - BG_PLANE70(ForgeConstants.BG_70, false, true), - BG_PLANE71(ForgeConstants.BG_71, false, true), - BG_PLANE72(ForgeConstants.BG_72, false, true), - BG_PLANE73(ForgeConstants.BG_73, false, true), - BG_PLANE74(ForgeConstants.BG_74, false, true), - BG_PLANE75(ForgeConstants.BG_75, false, true), - BG_PLANE76(ForgeConstants.BG_76, false, true), - BG_PLANE77(ForgeConstants.BG_77, false, true), - BG_PLANE78(ForgeConstants.BG_78, false, true); + Academy_at_Tolaria_West(ForgeConstants.BG_1, false, true), + Agyrem(ForgeConstants.BG_2, false, true), + Akoum(ForgeConstants.BG_3, false, true), + Aretopolis(ForgeConstants.BG_4, false, true), + Astral_Arena(ForgeConstants.BG_5, false, true), + Bant(ForgeConstants.BG_6, false, true), + Bloodhill_Bastion(ForgeConstants.BG_7, false, true), + Cliffside_Market(ForgeConstants.BG_8, false, true), + Edge_of_Malacol(ForgeConstants.BG_9, false, true), + Eloren_Wilds(ForgeConstants.BG_10, false, true), + Feeding_Grounds(ForgeConstants.BG_11, false, true), + Fields_of_Summer(ForgeConstants.BG_12, false, true), + Furnace_Layer(ForgeConstants.BG_13, false, true), + Gavony(ForgeConstants.BG_14, false, true), + Glen_Elendra(ForgeConstants.BG_15, false, true), + Glimmervoid_Basin(ForgeConstants.BG_16, false, true), + Goldmeadow(ForgeConstants.BG_17, false, true), + Grand_Ossuary(ForgeConstants.BG_18, false, true), + Grixis(ForgeConstants.BG_19, false, true), + Grove_of_the_Dreampods(ForgeConstants.BG_20, false, true), + Hedron_Fields_of_Agadeem(ForgeConstants.BG_21, false, true), + Immersturm(ForgeConstants.BG_22, false, true), + Isle_of_Vesuva(ForgeConstants.BG_23, false, true), + Izzet_Steam_Maze(ForgeConstants.BG_24, false, true), + Jund(ForgeConstants.BG_25, false, true), + Kessig(ForgeConstants.BG_26, false, true), + Kharasha_Foothills(ForgeConstants.BG_27, false, true), + Kilnspire_District(ForgeConstants.BG_28, false, true), + Krosa(ForgeConstants.BG_29, false, true), + Lair_of_the_Ashen_Idol(ForgeConstants.BG_30, false, true), + Lethe_Lake(ForgeConstants.BG_31, false, true), + Llanowar(ForgeConstants.BG_32, false, true), + Minamo(ForgeConstants.BG_33, false, true), + Mount_Keralia(ForgeConstants.BG_34, false, true), + Murasa(ForgeConstants.BG_35, false, true), + Naar_Isle(ForgeConstants.BG_36, false, true), + Naya(ForgeConstants.BG_37, false, true), + Nephalia(ForgeConstants.BG_38, false, true), + Norns_Dominion(ForgeConstants.BG_39, false, true), + Onakke_Catacomb(ForgeConstants.BG_40, false, true), + Orochi_Colony(ForgeConstants.BG_41, false, true), + Orzhova(ForgeConstants.BG_42, false, true), + Otaria(ForgeConstants.BG_43, false, true), + Panopticon(ForgeConstants.BG_44, false, true), + Pools_of_Becoming(ForgeConstants.BG_45, false, true), + Prahv(ForgeConstants.BG_46, false, true), + Quicksilver_Sea(ForgeConstants.BG_47, false, true), + Ravens_Run(ForgeConstants.BG_48, false, true), + Sanctum_of_Serra(ForgeConstants.BG_49, false, true), + Sea_of_Sand(ForgeConstants.BG_50, false, true), + Selesnya_Loft_Gardens(ForgeConstants.BG_51, false, true), + Shiv(ForgeConstants.BG_52, false, true), + Skybreen(ForgeConstants.BG_53, false, true), + Sokenzan(ForgeConstants.BG_54, false, true), + Stairs_to_Infinity(ForgeConstants.BG_55, false, true), + Stensia(ForgeConstants.BG_56, false, true), + Stronghold_Furnace(ForgeConstants.BG_57, false, true), + Takenuma(ForgeConstants.BG_58, false, true), + Tazeem(ForgeConstants.BG_59, false, true), + The_Aether_Flues(ForgeConstants.BG_60, false, true), + The_Dark_Barony(ForgeConstants.BG_61, false, true), + The_Eon_Fog(ForgeConstants.BG_62, false, true), + The_Fourth_Sphere(ForgeConstants.BG_63, false, true), + The_Great_Forest(ForgeConstants.BG_64, false, true), + The_Hippodrome(ForgeConstants.BG_65, false, true), + The_Maelstrom(ForgeConstants.BG_66, false, true), + The_Zephyr_Maze(ForgeConstants.BG_67, false, true), + Trail_of_the_MageRings(ForgeConstants.BG_68, false, true), + Truga_Jungle(ForgeConstants.BG_69, false, true), + Turri_Island(ForgeConstants.BG_70, false, true), + Undercity_Reaches(ForgeConstants.BG_71, false, true), + Velis_Vel(ForgeConstants.BG_72, false, true), + Windriddle_Palaces(ForgeConstants.BG_73, false, true), + Tember_City(ForgeConstants.BG_74, false, true), + Celestine_Reef(ForgeConstants.BG_75, false, true), + Horizon_Boughs(ForgeConstants.BG_76, false, true), + Mirrored_Depths(ForgeConstants.BG_77, false, true), + Talon_Gates(ForgeConstants.BG_78, false, true); private final String filename; private final boolean repeat; private Texture texture; private final boolean isPlane; + private static List PlanesValue; FSkinTexture(String filename0, boolean repeat0, boolean isPlane0) { filename = filename0; @@ -102,6 +107,20 @@ public enum FSkinTexture implements FImage { isPlane = isPlane0; } + static { + PlanesValue = new ArrayList<>(); + for (FSkinTexture PlanesEnum : FSkinTexture.values()) { + PlanesValue.add(PlanesEnum.filename + .replace(".jpg", "") + .replace("'", "") + .replace("-", "")); + } + } + + public static List getValues() { + return Collections.unmodifiableList(PlanesValue); + } + public void load() { FileHandle preferredFile = isPlane ? FSkin.getCachePlanechaseFile(filename) : FSkin.getSkinFile(filename); if (preferredFile.exists()) { diff --git a/forge-gui-mobile/src/forge/card/CardZoom.java b/forge-gui-mobile/src/forge/card/CardZoom.java index cbc10b877c3..72536fe686b 100644 --- a/forge-gui-mobile/src/forge/card/CardZoom.java +++ b/forge-gui-mobile/src/forge/card/CardZoom.java @@ -291,7 +291,7 @@ public class CardZoom extends FOverlay { protected void doLayout(float width, float height) { } - public static interface ActivateHandler { + public interface ActivateHandler { String getActivateAction(int index); void setSelectedIndex(int index); void activate(int index); diff --git a/forge-gui-mobile/src/forge/deck/FDeckEditor.java b/forge-gui-mobile/src/forge/deck/FDeckEditor.java index 56cbcaf5288..c3cb2a257b2 100644 --- a/forge-gui-mobile/src/forge/deck/FDeckEditor.java +++ b/forge-gui-mobile/src/forge/deck/FDeckEditor.java @@ -135,7 +135,7 @@ public class FDeckEditor extends TabPageScreen { return controller; } - private EditorType(DeckController controller0, Predicate cardFilter0) { + EditorType(DeckController controller0, Predicate cardFilter0) { controller = controller0; cardFilter = cardFilter0; } diff --git a/forge-gui-mobile/src/forge/deck/FDeckImportDialog.java b/forge-gui-mobile/src/forge/deck/FDeckImportDialog.java index 1d00f01b24a..e00e009a551 100644 --- a/forge-gui-mobile/src/forge/deck/FDeckImportDialog.java +++ b/forge-gui-mobile/src/forge/deck/FDeckImportDialog.java @@ -42,7 +42,12 @@ public class FDeckImportDialog extends FDialog { private final FTextArea txtInput = add(new FTextArea(true)); private final FCheckBox newEditionCheck = add(new FCheckBox("Import latest version of card", true)); private final FCheckBox dateTimeCheck = add(new FCheckBox("Use only sets released before:", false)); - private final FCheckBox onlyCoreExpCheck = add(new FCheckBox("Use only core and expansion sets", true)); + /*setting onlyCoreExpCheck to false allow the copied cards to pass the check of deck contents + forge-core\src\main\java\forge\deck\Deck.javaDeck.java starting @ Line 320 which is called by + forge-gui-mobile\src\forge\deck\FDeckEditor.java starting @ Line 373 + (as of latest commit: 8e6655e3ee67688cff66b422d4722c58392eaa7e) + */ + private final FCheckBox onlyCoreExpCheck = add(new FCheckBox("Use only core and expansion sets", false)); private final FComboBox monthDropdown = add(new FComboBox()); //don't need wrappers since skin can't change while this dialog is open private final FComboBox yearDropdown = add(new FComboBox()); diff --git a/forge-gui-mobile/src/forge/itemmanager/ItemManager.java b/forge-gui-mobile/src/forge/itemmanager/ItemManager.java index bfdcf634a56..4daa745c651 100644 --- a/forge-gui-mobile/src/forge/itemmanager/ItemManager.java +++ b/forge-gui-mobile/src/forge/itemmanager/ItemManager.java @@ -901,10 +901,7 @@ public abstract class ItemManager extends FContainer im @Override protected boolean hideBackdropOnPress(float x, float y) { Rectangle bounds = currentView.getSelectionBounds(); - if (bounds == null || bounds.contains(x, y)) { - return false; //don't hide on press if within selection bounds - } - return true; + return bounds != null && !bounds.contains(x, y); //don't hide on press if within selection bounds } @Override diff --git a/forge-gui-mobile/src/forge/menu/FDropDown.java b/forge-gui-mobile/src/forge/menu/FDropDown.java index f308b38578e..0f2f67bd893 100644 --- a/forge-gui-mobile/src/forge/menu/FDropDown.java +++ b/forge-gui-mobile/src/forge/menu/FDropDown.java @@ -187,10 +187,7 @@ public abstract class FDropDown extends FScrollPane { protected boolean hideBackdropOnPress(float x, float y) { FDisplayObject owner = getDropDownOwner(); - if (owner == null || !owner.screenPos.contains(x, y)) { - return true; //auto-hide when backdrop pressed unless over owner - } - return false; + return owner == null || !owner.screenPos.contains(x, y); //auto-hide when backdrop pressed unless over owner } protected boolean preventOwnerHandlingBackupTap(float x, float y, int count) { diff --git a/forge-gui-mobile/src/forge/menu/FDropDownMenu.java b/forge-gui-mobile/src/forge/menu/FDropDownMenu.java index 6636a51f257..7385252fb5d 100644 --- a/forge-gui-mobile/src/forge/menu/FDropDownMenu.java +++ b/forge-gui-mobile/src/forge/menu/FDropDownMenu.java @@ -71,9 +71,6 @@ public abstract class FDropDownMenu extends FDropDown { @Override public boolean tap(float x, float y, int count) { super.tap(x, y, count); - if (getDropDownOwner() instanceof FSubMenu) { - return false; //return false so owning sub menu can be hidden - } - return true; + return !(getDropDownOwner() instanceof FSubMenu); //return false so owning sub menu can be hidden } } diff --git a/forge-gui-mobile/src/forge/screens/SplashScreen.java b/forge-gui-mobile/src/forge/screens/SplashScreen.java index f9b94524393..6a6a4ae75a3 100644 --- a/forge-gui-mobile/src/forge/screens/SplashScreen.java +++ b/forge-gui-mobile/src/forge/screens/SplashScreen.java @@ -94,7 +94,7 @@ public class SplashScreen extends FContainer { String disclaimer = "Forge is not affiliated in any way with Wizards of the Coast.\n" + "Forge is open source software, released under the GNU Public License."; g.drawText(disclaimer, disclaimerFont, FProgressBar.SEL_FORE_COLOR, - x, y, w, disclaimerHeight, true, Align.center, true); + x, y, w, disclaimerHeight, false, Align.center, true); float padding = 20f / 450f * w; float pbHeight = 57f / 450f * h; diff --git a/forge-gui-mobile/src/forge/screens/constructed/PlayerPanel.java b/forge-gui-mobile/src/forge/screens/constructed/PlayerPanel.java index 146de6b6217..b1f2c67e1e9 100644 --- a/forge-gui-mobile/src/forge/screens/constructed/PlayerPanel.java +++ b/forge-gui-mobile/src/forge/screens/constructed/PlayerPanel.java @@ -719,7 +719,7 @@ public class PlayerPanel extends FContainer { public Set getAiOptions() { return isSimulatedAi() ? ImmutableSet.of(AIOption.USE_SIMULATION) - : Collections.emptySet(); + : Collections.emptySet(); } private boolean isSimulatedAi() { return isAi() && useAiSimulation; diff --git a/forge-gui-mobile/src/forge/screens/gauntlet/NewGauntletScreen.java b/forge-gui-mobile/src/forge/screens/gauntlet/NewGauntletScreen.java index 869730c6237..58b5b19c993 100644 --- a/forge-gui-mobile/src/forge/screens/gauntlet/NewGauntletScreen.java +++ b/forge-gui-mobile/src/forge/screens/gauntlet/NewGauntletScreen.java @@ -82,8 +82,7 @@ public class NewGauntletScreen extends LaunchScreen { if (numOpponents == null) { return; } ListChooser chooser = new ListChooser( - "Choose allowed deck types for opponents", 0, 11, Arrays.asList(new DeckType[] { - DeckType.CUSTOM_DECK, + "Choose allowed deck types for opponents", 0, 11, Arrays.asList(DeckType.CUSTOM_DECK, DeckType.PRECONSTRUCTED_DECK, DeckType.QUEST_OPPONENT_DECK, DeckType.COLOR_DECK, @@ -93,8 +92,7 @@ public class NewGauntletScreen extends LaunchScreen { DeckType.MODERN_CARDGEN_DECK, DeckType.LEGACY_CARDGEN_DECK, DeckType.VINTAGE_CARDGEN_DECK, - DeckType.THEME_DECK - }), null, new Callback>() { + DeckType.THEME_DECK), null, new Callback>() { @Override public void run(final List allowedDeckTypes) { if (allowedDeckTypes == null || allowedDeckTypes.isEmpty()) { return; } diff --git a/forge-gui-mobile/src/forge/screens/home/LoadGameMenu.java b/forge-gui-mobile/src/forge/screens/home/LoadGameMenu.java index 1ff05bc4dfd..c38c3f6c48b 100644 --- a/forge-gui-mobile/src/forge/screens/home/LoadGameMenu.java +++ b/forge-gui-mobile/src/forge/screens/home/LoadGameMenu.java @@ -32,7 +32,7 @@ public class LoadGameMenu extends FPopupMenu { private final Class screenClass; private FScreen screen; - private LoadGameScreen(final String caption0, final FImage icon0, final Class screenClass0) { + LoadGameScreen(final String caption0, final FImage icon0, final Class screenClass0) { screenClass = screenClass0; item = new FMenuItem(caption0, icon0, new FEventHandler() { @Override diff --git a/forge-gui-mobile/src/forge/screens/home/NewGameMenu.java b/forge-gui-mobile/src/forge/screens/home/NewGameMenu.java index e1756cf2434..0bd6829888b 100644 --- a/forge-gui-mobile/src/forge/screens/home/NewGameMenu.java +++ b/forge-gui-mobile/src/forge/screens/home/NewGameMenu.java @@ -36,7 +36,7 @@ public class NewGameMenu extends FPopupMenu { private final Class screenClass; private FScreen screen; - private NewGameScreen(final String caption0, final FImage icon0, final Class screenClass0) { + NewGameScreen(final String caption0, final FImage icon0, final Class screenClass0) { screenClass = screenClass0; item = new FMenuItem(caption0, icon0, new FEventHandler() { @Override diff --git a/forge-gui-mobile/src/forge/screens/match/MatchScreen.java b/forge-gui-mobile/src/forge/screens/match/MatchScreen.java index 67e478e7d23..c0fdfdc67ec 100644 --- a/forge-gui-mobile/src/forge/screens/match/MatchScreen.java +++ b/forge-gui-mobile/src/forge/screens/match/MatchScreen.java @@ -3,7 +3,6 @@ package forge.screens.match; import java.util.*; import java.util.Map.Entry; -import forge.properties.ForgeConstants; import org.apache.commons.lang3.tuple.Pair; import com.badlogic.gdx.Input.Keys; @@ -506,12 +505,33 @@ public class MatchScreen extends FScreen { float x = topPlayerPanel.getField().getLeft(); float y = midField - topPlayerPanel.getField().getHeight(); float w = getWidth() - x; - + float bgFullWidth, scaledbgHeight; + float bgHeight = midField + bottomPlayerPanel.getField().getHeight() - y; if(FModel.getPreferences().getPrefBoolean(FPref.UI_DYNAMIC_PLANECHASE_BG) - && hasActivePlane()) //TODO: scale BG to correct aspect ratio/crop center - setPlanarBG(g, getPlaneName(), x, y, w, ForgeConstants.isGdxPortLandscape ? getHeight() : midField); - else - g.drawImage(FSkinTexture.BG_MATCH, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); + && hasActivePlane()) { + String imageName = getPlaneName() + .replace(" ", "_") + .replace("'", "") + .replace("-", ""); + if (FSkinTexture.getValues().contains(imageName)) { + bgFullWidth = bgHeight * FSkinTexture.valueOf(imageName).getWidth() / FSkinTexture.valueOf(imageName).getHeight(); + if (bgFullWidth < w) { + scaledbgHeight = w * (bgHeight / bgFullWidth); + bgFullWidth = w; + bgHeight = scaledbgHeight; + } + g.drawImage(FSkinTexture.valueOf(imageName), x + (w - bgFullWidth) / 2, y, bgFullWidth, bgHeight, true); + } + } + else { + bgFullWidth = bgHeight * FSkinTexture.BG_MATCH.getWidth() / FSkinTexture.BG_MATCH.getHeight(); + if (bgFullWidth < w) { + scaledbgHeight = w * (bgHeight / bgFullWidth); + bgFullWidth = w; + bgHeight = scaledbgHeight; + } + g.drawImage(FSkinTexture.BG_MATCH, x + (w - bgFullWidth) / 2, y, bgFullWidth, bgHeight); + } } } @@ -648,248 +668,5 @@ public class MatchScreen extends FScreen { } return false; } - private void setPlanarBG(Graphics g, String planeName, float x, float y, float w, float midField ){ - switch (planeName) { - case "Academy at Tolaria West": - g.drawImage(FSkinTexture.BG_PLANE1, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Agyrem": - g.drawImage(FSkinTexture.BG_PLANE2, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Akoum": - g.drawImage(FSkinTexture.BG_PLANE3, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Aretopolis": - g.drawImage(FSkinTexture.BG_PLANE4, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Astral Arena": - g.drawImage(FSkinTexture.BG_PLANE5, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Bant": - g.drawImage(FSkinTexture.BG_PLANE6, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Bloodhill Bastion": - g.drawImage(FSkinTexture.BG_PLANE7, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Cliffside Market": - g.drawImage(FSkinTexture.BG_PLANE8, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Edge of Malacol": - g.drawImage(FSkinTexture.BG_PLANE9, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Eloren Wilds": - g.drawImage(FSkinTexture.BG_PLANE10, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Feeding Grounds": - g.drawImage(FSkinTexture.BG_PLANE11, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Fields of Summer": - g.drawImage(FSkinTexture.BG_PLANE12, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Furnace Layer": - g.drawImage(FSkinTexture.BG_PLANE13, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Gavony": - g.drawImage(FSkinTexture.BG_PLANE14, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Glen Elendra": - g.drawImage(FSkinTexture.BG_PLANE15, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Glimmervoid Basin": - g.drawImage(FSkinTexture.BG_PLANE16, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Goldmeadow": - g.drawImage(FSkinTexture.BG_PLANE17, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Grand Ossuary": - g.drawImage(FSkinTexture.BG_PLANE18, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Grixis": - g.drawImage(FSkinTexture.BG_PLANE19, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Grove of the Dreampods": - g.drawImage(FSkinTexture.BG_PLANE20, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Hedron Fields of Agadeem": - g.drawImage(FSkinTexture.BG_PLANE21, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Immersturm": - g.drawImage(FSkinTexture.BG_PLANE22, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Isle of Vesuva": - g.drawImage(FSkinTexture.BG_PLANE23, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Izzet Steam Maze": - g.drawImage(FSkinTexture.BG_PLANE24, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Jund": - g.drawImage(FSkinTexture.BG_PLANE25, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Kessig": - g.drawImage(FSkinTexture.BG_PLANE26, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Kharasha Foothills": - g.drawImage(FSkinTexture.BG_PLANE27, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Kilnspire District": - g.drawImage(FSkinTexture.BG_PLANE28, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Krosa": - g.drawImage(FSkinTexture.BG_PLANE29, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Lair of the Ashen Idol": - g.drawImage(FSkinTexture.BG_PLANE30, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Lethe Lake": - g.drawImage(FSkinTexture.BG_PLANE31, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Llanowar": - g.drawImage(FSkinTexture.BG_PLANE32, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Minamo": - g.drawImage(FSkinTexture.BG_PLANE33, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Mount Keralia": - g.drawImage(FSkinTexture.BG_PLANE34, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Murasa": - g.drawImage(FSkinTexture.BG_PLANE35, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Naar Isle": - g.drawImage(FSkinTexture.BG_PLANE36, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Naya": - g.drawImage(FSkinTexture.BG_PLANE37, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Nephalia": - g.drawImage(FSkinTexture.BG_PLANE38, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Norn's Dominion": - g.drawImage(FSkinTexture.BG_PLANE39, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Onakke Catacomb": - g.drawImage(FSkinTexture.BG_PLANE40, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Orochi Colony": - g.drawImage(FSkinTexture.BG_PLANE41, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Orzhova": - g.drawImage(FSkinTexture.BG_PLANE42, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Otaria": - g.drawImage(FSkinTexture.BG_PLANE43, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Panopticon": - g.drawImage(FSkinTexture.BG_PLANE44, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Pools of Becoming": - g.drawImage(FSkinTexture.BG_PLANE45, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Prahv": - g.drawImage(FSkinTexture.BG_PLANE46, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Quicksilver Sea": - g.drawImage(FSkinTexture.BG_PLANE47, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Raven's Run": - g.drawImage(FSkinTexture.BG_PLANE48, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Sanctum of Serra": - g.drawImage(FSkinTexture.BG_PLANE49, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Sea of Sand": - g.drawImage(FSkinTexture.BG_PLANE50, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Selesnya Loft Gardens": - g.drawImage(FSkinTexture.BG_PLANE51, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Shiv": - g.drawImage(FSkinTexture.BG_PLANE52, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Skybreen": - g.drawImage(FSkinTexture.BG_PLANE53, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Sokenzan": - g.drawImage(FSkinTexture.BG_PLANE54, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Stairs to Infinity": - g.drawImage(FSkinTexture.BG_PLANE55, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Stensia": - g.drawImage(FSkinTexture.BG_PLANE56, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Stronghold Furnace": - g.drawImage(FSkinTexture.BG_PLANE57, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Takenuma": - g.drawImage(FSkinTexture.BG_PLANE58, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Tazeem": - g.drawImage(FSkinTexture.BG_PLANE59, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "The Aether Flues": - g.drawImage(FSkinTexture.BG_PLANE60, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "The Dark Barony": - g.drawImage(FSkinTexture.BG_PLANE61, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "The Eon Fog": - g.drawImage(FSkinTexture.BG_PLANE62, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "The Fourth Sphere": - g.drawImage(FSkinTexture.BG_PLANE63, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "The Great Forest": - g.drawImage(FSkinTexture.BG_PLANE64, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "The Hippodrome": - g.drawImage(FSkinTexture.BG_PLANE65, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "The Maelstrom": - g.drawImage(FSkinTexture.BG_PLANE66, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "The Zephyr Maze": - g.drawImage(FSkinTexture.BG_PLANE67, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Trail of the Mage-Rings": - g.drawImage(FSkinTexture.BG_PLANE68, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Truga Jungle": - g.drawImage(FSkinTexture.BG_PLANE69, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Turri Island": - g.drawImage(FSkinTexture.BG_PLANE70, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Undercity Reaches": - g.drawImage(FSkinTexture.BG_PLANE71, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Velis Vel": - g.drawImage(FSkinTexture.BG_PLANE72, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Windriddle Palaces": - g.drawImage(FSkinTexture.BG_PLANE73, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Tember City": - g.drawImage(FSkinTexture.BG_PLANE74, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Celestine Reef": - g.drawImage(FSkinTexture.BG_PLANE75, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Horizon Boughs": - g.drawImage(FSkinTexture.BG_PLANE76, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Mirrored Depths": - g.drawImage(FSkinTexture.BG_PLANE77, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - case "Talon Gates": - g.drawImage(FSkinTexture.BG_PLANE78, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - break; - - default: { - //draw default - g.drawImage(FSkinTexture.BG_MATCH, x, y, w, midField + bottomPlayerPanel.getField().getHeight() - y); - } - } - } } } diff --git a/forge-gui-mobile/src/forge/screens/match/views/VStack.java b/forge-gui-mobile/src/forge/screens/match/views/VStack.java index c72bcf226e3..563d8d3c765 100644 --- a/forge-gui-mobile/src/forge/screens/match/views/VStack.java +++ b/forge-gui-mobile/src/forge/screens/match/views/VStack.java @@ -325,7 +325,7 @@ public class VStack extends FDropDown { CardZoom.show(stackInstance.getSourceCard()); } })); - }; + } }; menu.show(this, x, y); diff --git a/forge-gui-mobile/src/forge/screens/online/OnlineMenu.java b/forge-gui-mobile/src/forge/screens/online/OnlineMenu.java index 7b7dcf882cb..f796b3d55d3 100644 --- a/forge-gui-mobile/src/forge/screens/online/OnlineMenu.java +++ b/forge-gui-mobile/src/forge/screens/online/OnlineMenu.java @@ -21,7 +21,7 @@ public class OnlineMenu extends FPopupMenu { private final Class screenClass; private FScreen screen; - private OnlineScreen(final String caption0, final FImage icon0, final Class screenClass0) { + OnlineScreen(final String caption0, final FImage icon0, final Class screenClass0) { screenClass = screenClass0; item = new FMenuItem(caption0, icon0, new FEventHandler() { @Override diff --git a/forge-gui-mobile/src/forge/screens/planarconquest/ConquestPlaneSelector.java b/forge-gui-mobile/src/forge/screens/planarconquest/ConquestPlaneSelector.java index 1c78d317915..92303b8dc50 100644 --- a/forge-gui-mobile/src/forge/screens/planarconquest/ConquestPlaneSelector.java +++ b/forge-gui-mobile/src/forge/screens/planarconquest/ConquestPlaneSelector.java @@ -9,6 +9,7 @@ import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import forge.Forge; import forge.Graphics; import forge.assets.FImage; import forge.assets.FSkinColor; @@ -151,6 +152,7 @@ public class ConquestPlaneSelector extends FDisplayObject { @Override public void draw(Graphics g) { + float hmod = Forge.getHeightModifier(); float w = getWidth(); float h = getHeight(); @@ -164,7 +166,7 @@ public class ConquestPlaneSelector extends FDisplayObject { FImage monitor = FSkinImage.PLANE_MONITOR; float monitorLeft = FOptionPane.PADDING / 2; float monitorWidth = w - 2 * monitorLeft; - float monitorHeight = monitorWidth * monitor.getHeight() / monitor.getWidth(); + float monitorHeight = (monitorWidth * monitor.getHeight() / monitor.getWidth()) - hmod; float monitorLeftOffset = monitorWidth * MONITOR_LEFT_MULTIPLIER; float monitorTopOffset = monitorHeight * MONITOR_TOP_MULTIPLIER; float monitorBottomOffset = monitorHeight * MONITOR_BOTTOM_MULTIPLIER; @@ -186,7 +188,7 @@ public class ConquestPlaneSelector extends FDisplayObject { float scaledArtHeight = monitorWidth * (artHeight / fullArtWidth); fullArtWidth = monitorWidth; artHeightClipMod = scaledArtHeight - artHeight; - artHeight = scaledArtHeight; + artHeight = scaledArtHeight; } g.startClip(x, y, artWidth, artHeight - artHeightClipMod); diff --git a/forge-gui-mobile/src/forge/screens/planarconquest/ConquestPlaneswalkScreen.java b/forge-gui-mobile/src/forge/screens/planarconquest/ConquestPlaneswalkScreen.java index 4af66742ffd..2fed378a3fe 100644 --- a/forge-gui-mobile/src/forge/screens/planarconquest/ConquestPlaneswalkScreen.java +++ b/forge-gui-mobile/src/forge/screens/planarconquest/ConquestPlaneswalkScreen.java @@ -46,9 +46,9 @@ public class ConquestPlaneswalkScreen extends FScreen { @Override protected void doLayout(float startY, float width, float height) { planeSelector.setBounds(0, startY, width, height - startY); - + float btnMod = Forge.extrawide.equals("extrawide") ? 1.5f : 2.5f; float buttonWidth = width * 0.6f; - float buttonHeight = btnPlaneswalk.getFont().getCapHeight() * 2.5f; + float buttonHeight = btnPlaneswalk.getFont().getCapHeight() * btnMod; btnPlaneswalk.setBounds((width - buttonWidth) / 2, height - buttonHeight - PADDING, buttonWidth, buttonHeight); } diff --git a/forge-gui-mobile/src/forge/screens/planarconquest/ConquestRewardDialog.java b/forge-gui-mobile/src/forge/screens/planarconquest/ConquestRewardDialog.java index 2cf70553e1a..da194996ee3 100644 --- a/forge-gui-mobile/src/forge/screens/planarconquest/ConquestRewardDialog.java +++ b/forge-gui-mobile/src/forge/screens/planarconquest/ConquestRewardDialog.java @@ -5,6 +5,7 @@ import java.util.List; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.utils.Align; +import forge.Forge; import forge.Graphics; import forge.ImageKeys; import forge.animation.ForgeAnimation; @@ -60,10 +61,22 @@ public class ConquestRewardDialog extends FScrollPane { columnCount = 1; } else if (cardCount < 5) { - columnCount = 2; + if (Forge.extrawide.equals("default")) + columnCount = 2; + else { + if (cardCount == 4) + columnCount = 4; + else + columnCount = 3; + } } else { - columnCount = 3; + if (Forge.extrawide.equals("extrawide")) + columnCount = 5; + else if (Forge.extrawide.equals("wide")) + columnCount = 4; + else + columnCount = 3; } animation = new CardRevealAnimation(); @@ -230,7 +243,10 @@ public class ConquestRewardDialog extends FScrollPane { //ensure current card in view if (getScrollHeight() > getHeight() && index < cardCount) { CardRevealer currentCard = cardRevealers.get(index); - scrollIntoView(currentCard, currentCard.getHeight() / 2 + PADDING); //show half of the card below + if (!Forge.extrawide.equals("default")) + scrollIntoView(currentCard, currentCard.getHeight() / (columnCount * PADDING) / 2); + else + scrollIntoView(currentCard, currentCard.getHeight() / 2 + PADDING); //show half of the card below } } diff --git a/forge-gui-mobile/src/forge/screens/settings/SettingsPage.java b/forge-gui-mobile/src/forge/screens/settings/SettingsPage.java index a17d6666a2b..e796b7eac32 100644 --- a/forge-gui-mobile/src/forge/screens/settings/SettingsPage.java +++ b/forge-gui-mobile/src/forge/screens/settings/SettingsPage.java @@ -519,7 +519,7 @@ public class SettingsPage extends TabPage { g.drawText(value.label, font, foreColor, x, y, w, h, false, Align.left, false); value.drawPrefValue(g, font, foreColor, x, y, w, h); - h += SettingsScreen.SETTING_PADDING; + h += SettingsScreen.SETTING_PADDING;//TODO: adjust settings page description bounds g.drawText(value.description, SettingsScreen.DESC_FONT, SettingsScreen.DESC_COLOR, x, y + h, w, totalHeight - h + SettingsScreen.getInsets(w), true, Align.left, false); } } diff --git a/forge-gui-mobile/src/forge/sound/AudioClip.java b/forge-gui-mobile/src/forge/sound/AudioClip.java index e7ec8c305f0..792125836d5 100644 --- a/forge-gui-mobile/src/forge/sound/AudioClip.java +++ b/forge-gui-mobile/src/forge/sound/AudioClip.java @@ -74,9 +74,6 @@ public class AudioClip implements IAudioClip { } public final boolean isDone() { - if (clip == null) { - return false; - } - return true; //TODO: Make this smarter if Sound supports marking as done + return clip != null;//TODO: Make this smarter if Sound supports marking as done } } diff --git a/forge-gui-mobile/src/forge/toolbox/FDialog.java b/forge-gui-mobile/src/forge/toolbox/FDialog.java index a935e0d72a3..19b8c8aec42 100644 --- a/forge-gui-mobile/src/forge/toolbox/FDialog.java +++ b/forge-gui-mobile/src/forge/toolbox/FDialog.java @@ -145,7 +145,7 @@ public abstract class FDialog extends FOverlay { public boolean isButtonEnabled(int index) { FButton button = getButton(index); - return button != null ? button.isEnabled() : false; + return button != null && button.isEnabled(); } public void setButtonEnabled(int index, boolean enabled) { @@ -283,9 +283,7 @@ public abstract class FDialog extends FOverlay { if (revealPercent != newRevealPercent) { revealPercent = newRevealPercent; updateDisplayTop(); - if (physicsObj.isMoving()) { - return true; - } + return physicsObj.isMoving(); } } diff --git a/forge-gui-mobile/src/forge/toolbox/FEvent.java b/forge-gui-mobile/src/forge/toolbox/FEvent.java index fd6d83ba6bc..7fc207b66d2 100644 --- a/forge-gui-mobile/src/forge/toolbox/FEvent.java +++ b/forge-gui-mobile/src/forge/toolbox/FEvent.java @@ -36,7 +36,7 @@ public class FEvent { return args; } - public static interface FEventHandler { + public interface FEventHandler { void handleEvent(FEvent e); } } diff --git a/forge-gui-mobile/src/forge/toolbox/FScrollPane.java b/forge-gui-mobile/src/forge/toolbox/FScrollPane.java index 809b715c8ad..0534860961e 100644 --- a/forge-gui-mobile/src/forge/toolbox/FScrollPane.java +++ b/forge-gui-mobile/src/forge/toolbox/FScrollPane.java @@ -232,9 +232,7 @@ public abstract class FScrollPane extends FContainer { if (physicsObj.isMoving()) { //avoid storing last fling stop time if scroll manually stopped physicsObj.advance(dt); Vector2 pos = physicsObj.getPosition(); - if (setScrollPositions(pos.x, pos.y) && physicsObj.isMoving()) { - return true; - } + return setScrollPositions(pos.x, pos.y) && physicsObj.isMoving(); } //end fling animation if can't scroll anymore or physics object is no longer moving diff --git a/forge-gui/pom.xml b/forge-gui/pom.xml index 4e4c32c1e39..a557a58da68 100644 --- a/forge-gui/pom.xml +++ b/forge-gui/pom.xml @@ -4,7 +4,7 @@ forge forge - 1.6.28-SNAPSHOT + 1.6.29-SNAPSHOT forge-gui diff --git a/forge-gui/res/cardsfolder/upcoming/aeon_engine.txt b/forge-gui/res/cardsfolder/a/aeon_engine.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/aeon_engine.txt rename to forge-gui/res/cardsfolder/a/aeon_engine.txt diff --git a/forge-gui/res/cardsfolder/upcoming/anje_falkenrath.txt b/forge-gui/res/cardsfolder/a/anje_falkenrath.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/anje_falkenrath.txt rename to forge-gui/res/cardsfolder/a/anje_falkenrath.txt diff --git a/forge-gui/res/cardsfolder/upcoming/anjes_ravager.txt b/forge-gui/res/cardsfolder/a/anjes_ravager.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/anjes_ravager.txt rename to forge-gui/res/cardsfolder/a/anjes_ravager.txt diff --git a/forge-gui/res/cardsfolder/upcoming/apex_altisaur.txt b/forge-gui/res/cardsfolder/a/apex_altisaur.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/apex_altisaur.txt rename to forge-gui/res/cardsfolder/a/apex_altisaur.txt diff --git a/forge-gui/res/cardsfolder/upcoming/archfiend_of_spite.txt b/forge-gui/res/cardsfolder/a/archfiend_of_spite.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/archfiend_of_spite.txt rename to forge-gui/res/cardsfolder/a/archfiend_of_spite.txt diff --git a/forge-gui/res/cardsfolder/upcoming/atla_palani_nest_tender.txt b/forge-gui/res/cardsfolder/a/atla_palani_nest_tender.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/atla_palani_nest_tender.txt rename to forge-gui/res/cardsfolder/a/atla_palani_nest_tender.txt diff --git a/forge-gui/res/cardsfolder/upcoming/backdraft_hellkite.txt b/forge-gui/res/cardsfolder/b/backdraft_hellkite.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/backdraft_hellkite.txt rename to forge-gui/res/cardsfolder/b/backdraft_hellkite.txt diff --git a/forge-gui/res/cardsfolder/upcoming/bloodthirsty_blade.txt b/forge-gui/res/cardsfolder/b/bloodthirsty_blade.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/bloodthirsty_blade.txt rename to forge-gui/res/cardsfolder/b/bloodthirsty_blade.txt diff --git a/forge-gui/res/cardsfolder/upcoming/bone_miser.txt b/forge-gui/res/cardsfolder/b/bone_miser.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/bone_miser.txt rename to forge-gui/res/cardsfolder/b/bone_miser.txt diff --git a/forge-gui/res/cardsfolder/upcoming/chainer_nightmare_adept.txt b/forge-gui/res/cardsfolder/c/chainer_nightmare_adept.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/chainer_nightmare_adept.txt rename to forge-gui/res/cardsfolder/c/chainer_nightmare_adept.txt diff --git a/forge-gui/res/cardsfolder/upcoming/cliffside_rescuer.txt b/forge-gui/res/cardsfolder/c/cliffside_rescuer.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/cliffside_rescuer.txt rename to forge-gui/res/cardsfolder/c/cliffside_rescuer.txt diff --git a/forge-gui/res/cardsfolder/upcoming/commanders_insignia.txt b/forge-gui/res/cardsfolder/c/commanders_insignia.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/commanders_insignia.txt rename to forge-gui/res/cardsfolder/c/commanders_insignia.txt diff --git a/forge-gui/res/cardsfolder/upcoming/curse_of_fools_wisdom.txt b/forge-gui/res/cardsfolder/c/curse_of_fools_wisdom.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/curse_of_fools_wisdom.txt rename to forge-gui/res/cardsfolder/c/curse_of_fools_wisdom.txt diff --git a/forge-gui/res/cardsfolder/upcoming/dockside_extortionist.txt b/forge-gui/res/cardsfolder/d/dockside_extortionist.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/dockside_extortionist.txt rename to forge-gui/res/cardsfolder/d/dockside_extortionist.txt diff --git a/forge-gui/res/cardsfolder/upcoming/doomed_artisan.txt b/forge-gui/res/cardsfolder/d/doomed_artisan.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/doomed_artisan.txt rename to forge-gui/res/cardsfolder/d/doomed_artisan.txt diff --git a/forge-gui/res/cardsfolder/upcoming/elsha_of_the_infinite.txt b/forge-gui/res/cardsfolder/e/elsha_of_the_infinite.txt similarity index 65% rename from forge-gui/res/cardsfolder/upcoming/elsha_of_the_infinite.txt rename to forge-gui/res/cardsfolder/e/elsha_of_the_infinite.txt index d02ad5dae4a..6b4e63b94c7 100644 --- a/forge-gui/res/cardsfolder/upcoming/elsha_of_the_infinite.txt +++ b/forge-gui/res/cardsfolder/e/elsha_of_the_infinite.txt @@ -4,5 +4,5 @@ Types:Legendary Creature Djinn Monk PT:3/3 K:Prowess S:Mode$ Continuous | Affected$ Card.TopLibrary+YouCtrl | AffectedZone$ Library | MayLookAt$ You | Description$ You may look at the top card of your library any time. -S:Mode$ Continuous | Affected$ Creature.TopLibrary+YouCtrl+nonLand+nonCreature | AffectedZone$ Library | MayPlay$ True | MayPlayWithFlash$ True | Description$ You may cast the top card of your library if it's a noncreature, nonland card, and you may cast it as though it had flash. +S:Mode$ Continuous | Affected$ Card.TopLibrary+YouCtrl+nonLand+nonCreature | AffectedZone$ Library | MayPlay$ True | MayPlayWithFlash$ True | Description$ You may cast the top card of your library if it's a noncreature, nonland card, and you may cast it as though it had flash. Oracle:Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)\nYou may look at the top card of your library any time.\nYou may cast the top card of your library if it's a noncreature, nonland card, and you may cast it as though it had flash. diff --git a/forge-gui/res/cardsfolder/upcoming/empowered_autogenerator.txt b/forge-gui/res/cardsfolder/e/empowered_autogenerator.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/empowered_autogenerator.txt rename to forge-gui/res/cardsfolder/e/empowered_autogenerator.txt diff --git a/forge-gui/res/cardsfolder/upcoming/full_flowering.txt b/forge-gui/res/cardsfolder/f/full_flowering.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/full_flowering.txt rename to forge-gui/res/cardsfolder/f/full_flowering.txt diff --git a/forge-gui/res/cardsfolder/upcoming/gerrard_weatherlight_hero.txt b/forge-gui/res/cardsfolder/g/gerrard_weatherlight_hero.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/gerrard_weatherlight_hero.txt rename to forge-gui/res/cardsfolder/g/gerrard_weatherlight_hero.txt diff --git a/forge-gui/res/cardsfolder/upcoming/ghired_conclave_exile.txt b/forge-gui/res/cardsfolder/g/ghired_conclave_exile.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/ghired_conclave_exile.txt rename to forge-gui/res/cardsfolder/g/ghired_conclave_exile.txt diff --git a/forge-gui/res/cardsfolder/upcoming/ghireds_belligerence.txt b/forge-gui/res/cardsfolder/g/ghireds_belligerence.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/ghireds_belligerence.txt rename to forge-gui/res/cardsfolder/g/ghireds_belligerence.txt diff --git a/forge-gui/res/cardsfolder/upcoming/gift_of_doom.txt b/forge-gui/res/cardsfolder/g/gift_of_doom.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/gift_of_doom.txt rename to forge-gui/res/cardsfolder/g/gift_of_doom.txt diff --git a/forge-gui/res/cardsfolder/upcoming/greven_predator_captain.txt b/forge-gui/res/cardsfolder/g/greven_predator_captain.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/greven_predator_captain.txt rename to forge-gui/res/cardsfolder/g/greven_predator_captain.txt diff --git a/forge-gui/res/cardsfolder/upcoming/grismold_the_dreadsower.txt b/forge-gui/res/cardsfolder/g/grismold_the_dreadsower.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/grismold_the_dreadsower.txt rename to forge-gui/res/cardsfolder/g/grismold_the_dreadsower.txt diff --git a/forge-gui/res/cardsfolder/upcoming/hate_mirage.txt b/forge-gui/res/cardsfolder/h/hate_mirage.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/hate_mirage.txt rename to forge-gui/res/cardsfolder/h/hate_mirage.txt diff --git a/forge-gui/res/cardsfolder/upcoming/idol_of_oblivion.txt b/forge-gui/res/cardsfolder/i/idol_of_oblivion.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/idol_of_oblivion.txt rename to forge-gui/res/cardsfolder/i/idol_of_oblivion.txt diff --git a/forge-gui/res/cardsfolder/upcoming/ignite_the_future.txt b/forge-gui/res/cardsfolder/i/ignite_the_future.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/ignite_the_future.txt rename to forge-gui/res/cardsfolder/i/ignite_the_future.txt diff --git a/forge-gui/res/cardsfolder/upcoming/kadena_slinking_sorcerer.txt b/forge-gui/res/cardsfolder/k/kadena_slinking_sorcerer.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/kadena_slinking_sorcerer.txt rename to forge-gui/res/cardsfolder/k/kadena_slinking_sorcerer.txt diff --git a/forge-gui/res/cardsfolder/upcoming/kadenas_silencer.txt b/forge-gui/res/cardsfolder/k/kadenas_silencer.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/kadenas_silencer.txt rename to forge-gui/res/cardsfolder/k/kadenas_silencer.txt diff --git a/forge-gui/res/cardsfolder/upcoming/krrik_son_of_yawgmoth.txt b/forge-gui/res/cardsfolder/k/krrik_son_of_yawgmoth.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/krrik_son_of_yawgmoth.txt rename to forge-gui/res/cardsfolder/k/krrik_son_of_yawgmoth.txt diff --git a/forge-gui/res/cardsfolder/l/lake_of_the_dead.txt b/forge-gui/res/cardsfolder/l/lake_of_the_dead.txt index badb1aee8bc..215a4e90b95 100644 --- a/forge-gui/res/cardsfolder/l/lake_of_the_dead.txt +++ b/forge-gui/res/cardsfolder/l/lake_of_the_dead.txt @@ -5,8 +5,8 @@ A:AB$ Mana | Cost$ T | Produced$ B | SpellDescription$ Add {B}. A:AB$ Mana | Cost$ T Sac<1/Swamp> | Produced$ B | Amount$ 4 | SpellDescription$ Add {B}{B}{B}{B}. R:Event$ Moved | Destination$ Battlefield | ValidCard$ Card.Self | ReplaceWith$ PayBeforeETB | Description$ If CARDNAME would enter the battlefield, sacrifice a Swamp instead. If you do, put CARDNAME onto the battlefield. If you don't, put it into its owner's graveyard. SVar:PayBeforeETB:DB$ Sacrifice | SacValid$ Swamp | Defined$ You | RememberSacrificed$ True | SubAbility$ MoveToGraveyard -SVar:MoveToGraveyard:DB$ ChangeZone | Origin$ All | Destination$ Graveyard | Defined$ ReplacedCard | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | SubAbility$ MoveToBattlefield -SVar:MoveToBattlefield:DB$ ChangeZone | Origin$ All | Destination$ Battlefield | Defined$ ReplacedCard | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ1 | SubAbility$ DBCleanup +SVar:MoveToGraveyard:DB$ ChangeZone | Origin$ All | Destination$ Graveyard | Defined$ ReplacedCard | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | References$ X | SubAbility$ MoveToBattlefield +SVar:MoveToBattlefield:DB$ ChangeZone | Origin$ All | Destination$ Battlefield | Defined$ ReplacedCard | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ1 | References$ X | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:X:Remembered$Amount AI:RemoveDeck:All diff --git a/forge-gui/res/cardsfolder/upcoming/leadership_vacuum.txt b/forge-gui/res/cardsfolder/l/leadership_vacuum.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/leadership_vacuum.txt rename to forge-gui/res/cardsfolder/l/leadership_vacuum.txt diff --git a/forge-gui/res/cardsfolder/upcoming/mandate_of_peace.txt b/forge-gui/res/cardsfolder/m/mandate_of_peace.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/mandate_of_peace.txt rename to forge-gui/res/cardsfolder/m/mandate_of_peace.txt diff --git a/forge-gui/res/cardsfolder/upcoming/marisi_breaker_of_the_coil.txt b/forge-gui/res/cardsfolder/m/marisi_breaker_of_the_coil.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/marisi_breaker_of_the_coil.txt rename to forge-gui/res/cardsfolder/m/marisi_breaker_of_the_coil.txt diff --git a/forge-gui/res/cardsfolder/upcoming/mass_diminish.txt b/forge-gui/res/cardsfolder/m/mass_diminish.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/mass_diminish.txt rename to forge-gui/res/cardsfolder/m/mass_diminish.txt diff --git a/forge-gui/res/cardsfolder/upcoming/mire_in_misery.txt b/forge-gui/res/cardsfolder/m/mire_in_misery.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/mire_in_misery.txt rename to forge-gui/res/cardsfolder/m/mire_in_misery.txt diff --git a/forge-gui/res/cardsfolder/n/narset_parter_of_veils.txt b/forge-gui/res/cardsfolder/n/narset_parter_of_veils.txt index b402d8903a7..f3e54e728bc 100644 --- a/forge-gui/res/cardsfolder/n/narset_parter_of_veils.txt +++ b/forge-gui/res/cardsfolder/n/narset_parter_of_veils.txt @@ -3,5 +3,5 @@ ManaCost:1 U U Types:Legendary Planeswalker Narset Loyalty:5 S:Mode$ Continuous | Affected$ Opponent | AddKeyword$ You can't draw more than one card each turn. | Description$ Each opponent can't draw more than one card each turn. -A:AB$ Dig | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | DigNum$ 4 | ChangeNum$ 1 | Optional$ True | ChangeValid$ Card.nonCreature+nonLand | RestRandomOrder$ True | SpellDescription$ Look at the top four cards of your library. You may reveal a noncreature, nonland card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. +A:AB$ Dig | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | DigNum$ 4 | ChangeNum$ 1 | Optional$ True | ChangeValid$ Card.nonCreature+nonLand | RestRandomOrder$ True | ForceRevealToController$ True | SpellDescription$ Look at the top four cards of your library. You may reveal a noncreature, nonland card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. Oracle:Each opponent can't draw more than one card each turn.\n[-2]: Look at the top four cards of your library. You may reveal a noncreature, nonland card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. diff --git a/forge-gui/res/cardsfolder/upcoming/nightmare_unmaking.txt b/forge-gui/res/cardsfolder/n/nightmare_unmaking.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/nightmare_unmaking.txt rename to forge-gui/res/cardsfolder/n/nightmare_unmaking.txt diff --git a/forge-gui/res/cardsfolder/upcoming/ohran_frostfang.txt b/forge-gui/res/cardsfolder/o/ohran_frostfang.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/ohran_frostfang.txt rename to forge-gui/res/cardsfolder/o/ohran_frostfang.txt diff --git a/forge-gui/res/cardsfolder/upcoming/pendant_of_prosperity.txt b/forge-gui/res/cardsfolder/p/pendant_of_prosperity.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/pendant_of_prosperity.txt rename to forge-gui/res/cardsfolder/p/pendant_of_prosperity.txt diff --git a/forge-gui/res/cardsfolder/upcoming/pramikon_sky_rampart.txt b/forge-gui/res/cardsfolder/p/pramikon_sky_rampart.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/pramikon_sky_rampart.txt rename to forge-gui/res/cardsfolder/p/pramikon_sky_rampart.txt diff --git a/forge-gui/res/cardsfolder/upcoming/rayami_first_of_the_fallen.txt b/forge-gui/res/cardsfolder/r/rayami_first_of_the_fallen.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/rayami_first_of_the_fallen.txt rename to forge-gui/res/cardsfolder/r/rayami_first_of_the_fallen.txt diff --git a/forge-gui/res/cardsfolder/r/reprobation.txt b/forge-gui/res/cardsfolder/r/reprobation.txt index 70bee1efe39..31e57175382 100644 --- a/forge-gui/res/cardsfolder/r/reprobation.txt +++ b/forge-gui/res/cardsfolder/r/reprobation.txt @@ -3,5 +3,5 @@ ManaCost:1 W Types:Enchantment Aura K:Enchant creature A:SP$ Attach | Cost$ 1 W | ValidTgts$ Creature | AILogic$ Curse -S:Mode$ Continuous | Affected$ Card.EnchantedBy | SetPower$ 0 | SetToughness$ 1 | RemoveAllAbilities$ True | AddType$ Coward | Description$ Enchanted creature loses all abilities and is a Coward creature with base power and toughness 0/1. +S:Mode$ Continuous | Affected$ Card.EnchantedBy | SetPower$ 0 | SetToughness$ 1 | RemoveAllAbilities$ True | AddType$ Creature & Coward | RemoveCardTypes$ True | Description$ Enchanted creature loses all abilities and is a Coward creature with base power and toughness 0/1. Oracle:Enchant creature\nEnchanted creature loses all abilities and is a Coward creature with base power and toughness 0/1. (It keeps all supertypes but loses all other types and creature types.) diff --git a/forge-gui/res/cardsfolder/upcoming/road_of_return.txt b/forge-gui/res/cardsfolder/r/road_of_return.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/road_of_return.txt rename to forge-gui/res/cardsfolder/r/road_of_return.txt diff --git a/forge-gui/res/cardsfolder/upcoming/sanctum_of_eternity.txt b/forge-gui/res/cardsfolder/s/sanctum_of_eternity.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/sanctum_of_eternity.txt rename to forge-gui/res/cardsfolder/s/sanctum_of_eternity.txt diff --git a/forge-gui/res/cardsfolder/upcoming/scaretiller.txt b/forge-gui/res/cardsfolder/s/scaretiller.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/scaretiller.txt rename to forge-gui/res/cardsfolder/s/scaretiller.txt diff --git a/forge-gui/res/cardsfolder/upcoming/scroll_of_fate.txt b/forge-gui/res/cardsfolder/s/scroll_of_fate.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/scroll_of_fate.txt rename to forge-gui/res/cardsfolder/s/scroll_of_fate.txt diff --git a/forge-gui/res/cardsfolder/upcoming/selesnya_eulogist.txt b/forge-gui/res/cardsfolder/s/selesnya_eulogist.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/selesnya_eulogist.txt rename to forge-gui/res/cardsfolder/s/selesnya_eulogist.txt diff --git a/forge-gui/res/cardsfolder/upcoming/sevinne_the_chronoclasm.txt b/forge-gui/res/cardsfolder/s/sevinne_the_chronoclasm.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/sevinne_the_chronoclasm.txt rename to forge-gui/res/cardsfolder/s/sevinne_the_chronoclasm.txt diff --git a/forge-gui/res/cardsfolder/upcoming/sevinnes_reclamation.txt b/forge-gui/res/cardsfolder/s/sevinnes_reclamation.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/sevinnes_reclamation.txt rename to forge-gui/res/cardsfolder/s/sevinnes_reclamation.txt diff --git a/forge-gui/res/cardsfolder/upcoming/skyfire_phoenix.txt b/forge-gui/res/cardsfolder/s/skyfire_phoenix.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/skyfire_phoenix.txt rename to forge-gui/res/cardsfolder/s/skyfire_phoenix.txt diff --git a/forge-gui/res/cardsfolder/upcoming/song_of_the_worldsoul.txt b/forge-gui/res/cardsfolder/s/song_of_the_worldsoul.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/song_of_the_worldsoul.txt rename to forge-gui/res/cardsfolder/s/song_of_the_worldsoul.txt diff --git a/forge-gui/res/cardsfolder/upcoming/tahngarth_first_mate.txt b/forge-gui/res/cardsfolder/t/tahngarth_first_mate.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/tahngarth_first_mate.txt rename to forge-gui/res/cardsfolder/t/tahngarth_first_mate.txt diff --git a/forge-gui/res/cardsfolder/upcoming/tectonic_hellion.txt b/forge-gui/res/cardsfolder/t/tectonic_hellion.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/tectonic_hellion.txt rename to forge-gui/res/cardsfolder/t/tectonic_hellion.txt diff --git a/forge-gui/res/cardsfolder/upcoming/thalias_geistcaller.txt b/forge-gui/res/cardsfolder/t/thalias_geistcaller.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/thalias_geistcaller.txt rename to forge-gui/res/cardsfolder/t/thalias_geistcaller.txt diff --git a/forge-gui/res/cardsfolder/t/the_hippodrome.txt b/forge-gui/res/cardsfolder/t/the_hippodrome.txt index b90de6b14ce..206af01743d 100644 --- a/forge-gui/res/cardsfolder/t/the_hippodrome.txt +++ b/forge-gui/res/cardsfolder/t/the_hippodrome.txt @@ -3,7 +3,7 @@ ManaCost:no cost Types:Plane Segovia S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature | AddPower$ -5 | Description$ All Creatures get -5/-0. T:Mode$ PlanarDice | Result$ Chaos | OptionalDecider$ You | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll {CHAOS}, you may destroy target creature if it's power is 0 or less. -SVar:RolledChaos:DB$ Destroy | ValidTgts$ Creature | ConditionCheckSVar$ TgtPow | ConditionCompareSVar$ EQ1 | AITgts$ Creature.OpponentCtrl+powerLE0 +SVar:RolledChaos:DB$ Destroy | ValidTgts$ Creature | ConditionCheckSVar$ TgtPow | ConditionSVarCompare$ EQ1 | AITgts$ Creature.OpponentCtrl+powerLE0 SVar:TgtPow:Targeted$Valid Creature.powerLE0 SVar:Picture:http://www.wizards.com/global/images/magic/general/the_hippodrome.jpg SVar:AIRollPlanarDieParams:Mode$ Always diff --git a/forge-gui/res/cardsfolder/upcoming/thieving_amalgam.txt b/forge-gui/res/cardsfolder/t/thieving_amalgam.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/thieving_amalgam.txt rename to forge-gui/res/cardsfolder/t/thieving_amalgam.txt diff --git a/forge-gui/res/cardsfolder/upcoming/thought_sponge.txt b/forge-gui/res/cardsfolder/t/thought_sponge.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/thought_sponge.txt rename to forge-gui/res/cardsfolder/t/thought_sponge.txt diff --git a/forge-gui/res/cardsfolder/t/titanias_song.txt b/forge-gui/res/cardsfolder/t/titanias_song.txt index 73bdbd4da82..ed181a83062 100644 --- a/forge-gui/res/cardsfolder/t/titanias_song.txt +++ b/forge-gui/res/cardsfolder/t/titanias_song.txt @@ -1,7 +1,7 @@ Name:Titania's Song ManaCost:3 G Types:Enchantment -S:Mode$ Continuous | Affected$ Artifact.nonCreature | SetPower$ AffectedX | SetToughness$ AffectedX | AddType$ Creature | RemoveAllAbilities$ True | Description$ Each noncreature artifact loses all abilities and is an artifact creature with power and toughness each equal to its converted mana cost. +S:Mode$ Continuous | Affected$ Artifact.nonCreature | SetPower$ AffectedX | SetToughness$ AffectedX | AddType$ Artifact & Creature | RemoveCardTypes$ True | RemoveAllAbilities$ True | Description$ Each noncreature artifact loses all abilities and is an artifact creature with power and toughness each equal to its converted mana cost. T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | Execute$ TrigEffect | Static$ True | TriggerDescription$ If CARDNAME leaves the battlefield, this effect continues until end of turn. SVar:TrigEffect:DB$ Effect | Name$ Titania's Song Effect | StaticAbilities$ KWAnimateAll | SVars$ AffectedX | References$ AffectedX SVar:KWAnimateAll:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Artifact.nonCreature | SetPower$ AffectedX | SetToughness$ AffectedX | AddType$ Creature | RemoveAllAbilities$ True | Description$ Each noncreature artifact loses all abilities and is an artifact creature with power and toughness each equal to its converted mana cost. diff --git a/forge-gui/res/cardsfolder/t/transmute_artifact.txt b/forge-gui/res/cardsfolder/t/transmute_artifact.txt index e50e51028e4..8ccedb74d00 100644 --- a/forge-gui/res/cardsfolder/t/transmute_artifact.txt +++ b/forge-gui/res/cardsfolder/t/transmute_artifact.txt @@ -6,8 +6,8 @@ SVar:StoreCanSearch:DB$ StoreSVar | SVar$ SackedCMC | Type$ Number | Expression$ SVar:StoreCMC:DB$ StoreSVar | SVar$ SackedCMC | Type$ Calculate | Expression$ Y | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 | SubAbility$ DBClear SVar:DBClear:DB$ Cleanup | ClearRemembered$ True | SubAbility$ SearchLibrary SVar:SearchLibrary:DB$ ChangeZone | Origin$ Library | Destination$ Library | ChangeType$ Artifact | ChangeNum$ 1 | SubAbility$ EqualTransmute | StackDescription$ None | RememberChanged$ True | ConditionCheckSVar$ SackedCMC | ConditionSVarCompare$ GE0 -SVar:EqualTransmute:DB$ ChangeZone | Origin$ Library | Destination$ Battlefield | NoLooking$ True | Mandatory$ True | Defined$ Remembered | ChangeNum$ 1 | ConditionCheckSVar$ SackedCMC | ConditionSVarCompare$ GEY | SubAbility$ PayForTransmute | StackDescription$ None -SVar:PayForTransmute:DB$ ChangeZone | Origin$ Library | Destination$ Battlefield | NoLooking$ True | Mandatory$ True | Defined$ Remembered | ChangeNum$ 1 | ConditionCheckSVar$ SackedCMC | ConditionSVarCompare$ LTY | UnlessCost$ X | UnlessPayer$ You | UnlessSwitched$ True | StackDescription$ None | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 +SVar:EqualTransmute:DB$ ChangeZone | Origin$ Library | Destination$ Battlefield | NoLooking$ True | Mandatory$ True | Defined$ Remembered | ChangeNum$ 1 | ConditionCheckSVar$ SackedCMC | ConditionSVarCompare$ GEY | References$ Y | SubAbility$ PayForTransmute | StackDescription$ None +SVar:PayForTransmute:DB$ ChangeZone | Origin$ Library | Destination$ Battlefield | NoLooking$ True | Mandatory$ True | Defined$ Remembered | ChangeNum$ 1 | ConditionCheckSVar$ SackedCMC | ConditionSVarCompare$ LTY | UnlessCost$ X | References$ X,Y | UnlessPayer$ You | UnlessSwitched$ True | StackDescription$ None | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 # Everything working but when no artifact is sacrificed # SackedCMC to be overridden to see if a sacrifice actually happened SVar:Y:Remembered$CardManaCost diff --git a/forge-gui/res/cardsfolder/upcoming/alela_artful_provocateur.txt b/forge-gui/res/cardsfolder/upcoming/alela_artful_provocateur.txt new file mode 100644 index 00000000000..90269915dfc --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/alela_artful_provocateur.txt @@ -0,0 +1,14 @@ +Name:Alela, Artful Provocateur +ManaCost:1 W U B +Types:Legendary Creature Faerie Warlock +PT:2/3 +K:Flying +K:Deathtouch +K:Lifelink +S:Mode$ Continuous | Affected$ Creature.withFlying+Other+YouCtrl | AddPower$ 1 | Description$ Other creatures you control with flying get +1/+0. +SVar:PlayMain1:TRUE +T:Mode$ SpellCast | ValidCard$ Artifact,Enchantment | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigToken | TriggerDescription$ Whenever you cast an artifact or enchantment spell, create a 1/1 blue Faerie creature token with flying. +SVar:TrigToken:DB$ Token | TokenAmount$ 1 | TokenScript$ u_1_1_faerie_flying | TokenOwner$ You | LegacyImage$ u 1 1 faerie flying eld +SVar:BuffedBy:Artifact,Enchantment +DeckHints:Type$Artifact | Enchantment +Oracle:Flying, deathtouch, lifelink\nOther creatures you control with flying get +1/+0.\nWhenever you cast an artifact or enchantment spell, create a 1/1 blue Faerie creature token with flying. diff --git a/forge-gui/res/cardsfolder/upcoming/all_that_glitters.txt b/forge-gui/res/cardsfolder/upcoming/all_that_glitters.txt new file mode 100644 index 00000000000..c010c289fc2 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/all_that_glitters.txt @@ -0,0 +1,10 @@ +Name:All That Glitters +ManaCost:1 W +Types:Enchantment Aura +K:Enchant creature +A:SP$ Attach | Cost$ 1 W | ValidTgts$ Creature | AILogic$ Pump +S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ X | AddToughness$ X | References$ X | Description$ Enchanted creature gets +1/+1 for each artifact and/or enchantment you control. +SVar:X:Count$Valid Artifact.YouCtrl,Enchantment.YouCtrl +SVar:BuffedBy:Artifact,Enchantment +DeckHints:Type$Artifact|Enchantment +Oracle:Enchant creature\nEnchanted creature gets +1/+1 for each artifact and/or enchantment you control. diff --git a/forge-gui/res/cardsfolder/upcoming/arcanists_owl.txt b/forge-gui/res/cardsfolder/upcoming/arcanists_owl.txt new file mode 100644 index 00000000000..bc1a12c4223 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/arcanists_owl.txt @@ -0,0 +1,8 @@ +Name:Arcanist's Owl +ManaCost:W/U W/U W/U W/U +Types:Artifact Creature Bird +PT:3/3 +K:Flying +T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigDig | TriggerDescription$ When CARDNAME enters the battlefield, look at the top four cards of your library. You may reveal an artifact or enchantment card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. +SVar:TrigDig:DB$ Dig | DigNum$ 4 | ChangeNum$ 1 | Optional$ True | ForceRevealToController$ True | ChangeValid$ Artifact,Enchantment | RestRandomOrder$ True | RestRandomOrder$ True +Oracle:Flying\nWhen Arcanist's Owl enters the battlefield, look at the top four cards of your library. You may reveal an artifact or enchantment card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. diff --git a/forge-gui/res/cardsfolder/upcoming/bake_into_a_pie.txt b/forge-gui/res/cardsfolder/upcoming/bake_into_a_pie.txt new file mode 100644 index 00000000000..1f226e4432c --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/bake_into_a_pie.txt @@ -0,0 +1,7 @@ +Name:Bake into a Pie +ManaCost:2 B B +Types:Instant +A:SP$ Destroy | Cost$ 2 B B | ValidTgts$ Creature | TgtPrompt$ Select target creature | SubAbility$ DBToken | SpellDescription$ Destroy target creature. Create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") +SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenScript$ c_a_food_sac | TokenOwner$ You | LegacyImage$ c a food sac eld +DeckHas:Ability$LifeGain +Oracle:Destroy target creature. Create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") diff --git a/forge-gui/res/cardsfolder/upcoming/banish_into_fable.txt b/forge-gui/res/cardsfolder/upcoming/banish_into_fable.txt new file mode 100644 index 00000000000..4aab936b038 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/banish_into_fable.txt @@ -0,0 +1,10 @@ +Name:Banish into Fable +ManaCost:4 W U +Types:Instant +T:Mode$ SpellCast | ValidCard$ Card.Self+wasCastFromHand | Execute$ TrigCopy | TriggerDescription$ When you cast this spell from your hand, copy it if you control an artifact, then copy it if you control an enchantment. You may choose new targets for the copies. +SVar:TrigCopy:DB$ CopySpellAbility | Defined$ TriggeredSpellAbility | ConditionPresent$ Artifact.YouCtrl | ConditionCompare$ GE1 | SubAbility$ DBCopy +SVar:DBCopy:DB$ CopySpellAbility| Defined$ TriggeredSpellAbility | ConditionPresent$ Enchantment.YouCtrl | ConditionCompare$ GE1 +A:SP$ ChangeZone | Cost$ 4 W U | ValidTgts$ Permanent.nonLand | TgtPrompt$ Select target nonland permanent | Origin$ Battlefield | Destination$ Hand | SubAbility$ DBToken | SpellDescription$ Return target nonland permanent to its owner's hand. You create a 2/2 white Knight creature token with vigilance. +SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenScript$ w_2_2_knight_vigilance | TokenOwner$ You | LegacyImage$ w 2 2 knight vigilance eld +DeckHas:Ability$Token +Oracle:When you cast this spell from your hand, copy it if you control an artifact, then copy it if you control an enchantment. You may choose new targets for the copies.\nReturn target nonland permanent to its owner's hand. You create a 2/2 white Knight creature token with vigilance. diff --git a/forge-gui/res/cardsfolder/upcoming/belle_of_the_brawl.txt b/forge-gui/res/cardsfolder/upcoming/belle_of_the_brawl.txt new file mode 100644 index 00000000000..0f28dc9cafc --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/belle_of_the_brawl.txt @@ -0,0 +1,9 @@ +Name:Belle of the Brawl +ManaCost:2 B +Types:Creature Human Knight +PT:3/2 +K:Menance +T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigPumpAll | TriggerDescription$ Whenever CARDNAME attacks, other Knights you control get +1/+0 until end of turn. +SVar:TrigPumpAll:DB$ PumpAll | ValidCards$ Knight.YouCtrl+Other | NumAtt$ 1 +DeckHints:Type$Knight +Oracle:Menance\nWhenever Belle of the Brawl attacks, other Knights you control get +1/+0 until end of turn. diff --git a/forge-gui/res/cardsfolder/upcoming/chittering_witch.txt b/forge-gui/res/cardsfolder/upcoming/chittering_witch.txt new file mode 100644 index 00000000000..f2130f0197b --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/chittering_witch.txt @@ -0,0 +1,10 @@ +Name:Chittering Witch +ManaCost:3 B +Types:Creature Human Warlock +PT:2/2 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ When CARDNAME enters the battlefield, create a number of 1/1 black Rat creature tokens equal to the number of opponents you have. +SVar:TrigToken:DB$ Token | TokenAmount$ X | TokenScript$ b_1_1_rat | TokenOwner$ You | LegacyImage$ b 1 1 rat eld | References$ X +SVar:X:PlayerCountOpponents$Amount +A:AB$ Pump | Cost$ 1 B Sac<1/Creature> | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ -2 | NumDef$ -2 | IsCurse$ True | SpellDescription$ Target creature gets -2/-2 until end of turn. +AI:RemoveDeck:All +Oracle:When Chittering Witch enters the battlefield, create a number of 1/1 black Rat creature tokens equal to the number of opponents you have.\n{1}{B}, Sacrifice a creature: Target creature gets -2/-2 until end of turn. diff --git a/forge-gui/res/cardsfolder/upcoming/corridor_monitor.txt b/forge-gui/res/cardsfolder/upcoming/corridor_monitor.txt new file mode 100644 index 00000000000..a7c4ab70133 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/corridor_monitor.txt @@ -0,0 +1,7 @@ +Name:Corridor Monitor +ManaCost:1 U +Types:Artifact Creature Construct +PT:1/4 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigUntap | TriggerDescription$ When CARDNAME enters the battlefield, untap target artifact or creature you control. +SVar:TrigUntap:DB$ Untap | ValidTgts$ Artifact.YouCtrl,Creature.YouCtrl | TgtPrompt$ Choose target artifact or creature you control. +Oracle:When Corridor Monitor enters the battlefield, untap target artifact or creature you control. diff --git a/forge-gui/res/cardsfolder/upcoming/crystal_slipper.txt b/forge-gui/res/cardsfolder/upcoming/crystal_slipper.txt new file mode 100644 index 00000000000..5d89ec8c092 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/crystal_slipper.txt @@ -0,0 +1,6 @@ +Name:Crystal Slipper +ManaCost:1 R +Types:Artifact Equipment +S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 1 | AddKeyword$ Haste | Description$ Equipped creature gets +1/+0 and has haste. +K:Equip:1 +Oracle:Equipped creature gets +1/+0 and has haste.\nEquip {1} diff --git a/forge-gui/res/cardsfolder/upcoming/embereth_paladin.txt b/forge-gui/res/cardsfolder/upcoming/embereth_paladin.txt new file mode 100644 index 00000000000..b76ada65fcd --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/embereth_paladin.txt @@ -0,0 +1,9 @@ +Name:Embereth Paladin +ManaCost:3 R +Types:Creature Human Knight +PT:4/1 +K:Haste +R:Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | Adamant$ Red | ReplaceWith$ ETBAddCounter | Description$ Adamant — If at least three red mana was spent to cast this spell, CARDNAME enters the battlefield with a +1/+1 counter on it. +SVar:ETBAddCounter:DB$ PutCounter | ETB$ True | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ MoveToPlay +SVar:MoveToPlay:DB$ ChangeZone | Hidden$ True | Origin$ All | Destination$ Battlefield | Defined$ ReplacedCard +Oracle:Haste\nAdamant — If at least three red mana was spent to cast this spell, Embereth Paladin enters the battlefield with a +1/+1 counter on it. diff --git a/forge-gui/res/cardsfolder/upcoming/embereth_skyblazer.txt b/forge-gui/res/cardsfolder/upcoming/embereth_skyblazer.txt new file mode 100644 index 00000000000..9d234610c0f --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/embereth_skyblazer.txt @@ -0,0 +1,9 @@ +Name:Embereth Skyblazer +ManaCost:3 R +Types:Creature Human Knight +PT:4/3 +S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Flying | Condition$ PlayerTurn | Description$ As long as it's your turn, CARDNAME has flying. +T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigPumpAll | TriggerDescription$ Whenever CARDNAME attacks, you may pay {2}{R}. If you do, creatures you control get +X/+0 until end of turn, where X is the number of opponents you have. +SVar:TrigPumpAll:AB$ PumpAll | Cost$ 2 R | ValidCards$ Creature.YouCtrl | NumAtt$ +X | References$ X +SVar:X:PlayerCountOpponents$Amount +Oracle:As long as it's your turn, Embereth Skyblazer has flying.\nWhenever Embereth Skyblazer attacks, you may pay {2}{R}. If you do, creatures you control get +X/+0 until end of turn, where X is the number of opponents you have. diff --git a/forge-gui/res/cardsfolder/upcoming/eye_collector.txt b/forge-gui/res/cardsfolder/upcoming/eye_collector.txt new file mode 100644 index 00000000000..d7c466491f5 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/eye_collector.txt @@ -0,0 +1,8 @@ +Name:Eye Collector +ManaCost:B +Types:Creature Faerie +PT:1/1 +K:Flying +T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigMill | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, each player puts the top card of their library into their graveyard. +SVar:TrigMill:DB$Mill | NumCards$ 1 | Defined$ Player +Oracle:Flying\nWhenever Eye Collector deals combat damage to a player, each player puts the top card of their library into their graveyard. diff --git a/forge-gui/res/cardsfolder/upcoming/faerie_formation.txt b/forge-gui/res/cardsfolder/upcoming/faerie_formation.txt new file mode 100644 index 00000000000..d5951dffad7 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/faerie_formation.txt @@ -0,0 +1,8 @@ +Name:Faerie Formation +ManaCost:4 U +Types:Creature Faerie +PT:5/4 +K:Flying +A:AB$ Token | Cost$ 3 U | TokenAmount$ 1 | TokenScript$ u_1_1_faerie_flying | TokenOwner$ You | LegacyImage$ u 1 1 faerie flying eld | SubAbility$ DBDraw | SpellDescription$ Create a 1/1 blue Faerie creature token with flying. Draw a card. +SVar:DBDraw:DB$Draw | NumCards$ 1 +Oracle:Flying\n{3}{U}: Create a 1/1 blue Faerie creature token with flying. Draw a card. diff --git a/forge-gui/res/cardsfolder/upcoming/faerie_vandal.txt b/forge-gui/res/cardsfolder/upcoming/faerie_vandal.txt new file mode 100644 index 00000000000..d75cabc8602 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/faerie_vandal.txt @@ -0,0 +1,10 @@ +Name:Faerie Vandal +ManaCost:1 U +Types:Creature Faerie Rogue +PT:1/2 +K:Flash +K:Flying +T:Mode$ Drawn | ValidCard$ Card.YouCtrl | Number$ 2 | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ Whenever you draw your second card each turn, put a +1/+1 counter on CARDNAME. +SVar:TrigPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 +AI:RemoveDeck:Random +Oracle:Flash\nFlying\nWhenever you draw your second card each turn, put a +1/+1 counter on Faerie Vandal. diff --git a/forge-gui/res/cardsfolder/upcoming/fireborn_knight.txt b/forge-gui/res/cardsfolder/upcoming/fireborn_knight.txt new file mode 100644 index 00000000000..eec17b67b89 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/fireborn_knight.txt @@ -0,0 +1,7 @@ +Name:Fireborn Knight +ManaCost:R/W R/W R/W R/W +Types:Creature Human Knight +PT:2/3 +K:Double Strike +A:AB$ Pump | Cost$ RW RW RW RW | NumAtt$ +1 | NumDef$ +1 | SpellDescription$ CARDNAME gets +1/+1 until end of turn. +Oracle:Double strike\n{R/W}{R/W}{R/W}{R/W}: Fireborn Knight gets +1/+1 until end of turn. diff --git a/forge-gui/res/cardsfolder/upcoming/frogify.txt b/forge-gui/res/cardsfolder/upcoming/frogify.txt new file mode 100644 index 00000000000..bc07c2bdbb5 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/frogify.txt @@ -0,0 +1,7 @@ +Name:Frogify +ManaCost:1 U +Types:Enchantment Aura +K:Enchant creature +A:SP$ Attach | Cost$ 1 U | ValidTgts$ Creature | AILogic$ Curse +S:Mode$ Continuous | Affected$ Creature.EnchantedBy | SetPower$ 1 | SetToughness$ 1 | SetColor$ Blue | RemoveAllAbilities$ True | AddType$ Creature & Frog | RemoveCardTypes$ True | RemoveCreatureTypes$ True | Description$ Enchanted creature loses all abilities and is a blue Frog creature with base power and toughness 1/1. +Oracle:Enchant creature\nEnchanted creature loses all abilities and is a blue Frog creature with base power and toughness 1/1. (It loses all other card types and creature types.) diff --git a/forge-gui/res/cardsfolder/upcoming/garruk_cursed_huntsman.txt b/forge-gui/res/cardsfolder/upcoming/garruk_cursed_huntsman.txt new file mode 100644 index 00000000000..b5decbca13e --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/garruk_cursed_huntsman.txt @@ -0,0 +1,11 @@ +Name:Garruk, Cursed Huntsman +Types:Legendary Planeswalker Garruk +ManaCost:4 B G +Loyalty:5 +A:AB$ Token | Cost$ AddCounter<0/LOYALTY> | Planeswalker$ True | LegacyImage$ bg 2 2 wolf garruk eld | TokenAmount$ 2 | TokenScript$ bg_2_2_wolf_garruk | TokenOwner$ You | SpellDescription$ Create two 2/2 black and green Wolf creature tokens with "When this creature dies, put a loyalty counter on each Garruk you control." +A:AB$ Destroy | Cost$ SubCounter<3/LOYALTY> | ValidTgts$ Creature | TgtPrompt$ Select target creature | Planeswalker$ True | SubAbility$ DBDraw | SpellDescription$ Destroy target creature. Draw a card. +SVar:DBDraw:DB$ Draw | NumCards$ 1 +A:AB$ Effect | Cost$ SubCounter<6/LOYALTY> | Name$ Emblem - Garruk, Cursed Hunstman | Image$ emblem_garruk_cursed_hunstman | StaticAbilities$ STTrample | Planeswalker$ True | Ultimate$ True | Duration$ Permanent | AILogic$ Always | SpellDescription$ You get an emblem with "Creatures you control get +3/+3 and have trample." +SVar:STTrample:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AffectedZone$ Battlefield | AddKeyword$ Trample | AddPower$ 3 | AddToughness$ 3 | Description$ Creatures you control get +3/+3 and have trample. +DeckHas:Ability$Token +Oracle:[0]: Create two 2/2 black and green Wolf creature tokens with "When this creature dies, put a loyalty counter on each Garruk you control."\n[-3]: Destroy target creature. Draw a card.\n:[-6]: You get an emblem with "Creatures you control get +3/+3 and have trample." diff --git a/forge-gui/res/cardsfolder/upcoming/gilded_goose.txt b/forge-gui/res/cardsfolder/upcoming/gilded_goose.txt new file mode 100644 index 00000000000..dd8cd58571c --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/gilded_goose.txt @@ -0,0 +1,11 @@ +Name:Gilded Goose +ManaCost:G +Types:Creature Bird +PT:0/2 +K:Flying +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigFood | TriggerDescription$ When CARDNAME enters the battlefield, create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") +SVar:TrigFood:DB$ Token | TokenAmount$ 1 | TokenScript$ c_a_food_sac | TokenOwner$ You | LegacyImage$ c a food sac eld +A:AB$ Token | Cost$ 1 G T | TokenAmount$ 1 | TokenScript$ c_a_food_sac | TokenOwner$ You | LegacyImage$ c a food sac eld | SpellDescription$ Create a Food Token. +A:AB$ Mana | Cost$ T Sac<1/Food> | Produced$ Any | SpellDescription$ Add one mana of any color. +DeckHas:Ability$LifeGain +Oracle:Flying\nWhen Gilded Goose enters the battlefield, create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.")\n{1}{G}, {T}: Create a Food token.\n{T}, Sacrifice a Food: Add one mana of any color. diff --git a/forge-gui/res/cardsfolder/upcoming/gluttonous_troll.txt b/forge-gui/res/cardsfolder/upcoming/gluttonous_troll.txt new file mode 100644 index 00000000000..96c2f493bf0 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/gluttonous_troll.txt @@ -0,0 +1,12 @@ +Name:Gluttonous Troll +ManaCost:2 B G +Types:Creature Troll +PT:3/3 +K:Trample +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ When CARDNAME enters the battlefield, create a number of Food tokens equal to the number of opponents you have. (Food tokens are artifacts with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") +SVar:TrigToken:DB$ Token | TokenAmount$ X | References$ X | TokenScript$ c_a_food_sac | TokenOwner$ You | LegacyImage$ c a food sac eld +SVar:X:PlayerCountOpponents$Amount +SVar:PlayMain1:TRUE +DeckHas:Ability$Token +A:AB$ Pump | Cost$ 1 G Sac<1/Permanent.Other/another nonland permanent> | NumAtt$ +2 | NumDef$ +2 | SpellDescription$ CARDNAME gets +2/+2 until end of turn. +Oracle:Trample\nWhen Gluttonous Troll enters the battlefield, create a number of Food tokens equal to the number of opponents you have. (Food tokens are artifacts with "{2}, {T}, Sacrifice this artifact: You gain 3 life.")\n{1}{G}, Sacrifice another nonland permanent: Gluttonous Troll gets +2/+2 until end of turn. diff --git a/forge-gui/res/cardsfolder/upcoming/golden_egg.txt b/forge-gui/res/cardsfolder/upcoming/golden_egg.txt new file mode 100644 index 00000000000..da8a981a901 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/golden_egg.txt @@ -0,0 +1,8 @@ +Name:Golden Egg +ManaCost:2 +Types:Artifact Food +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ FreeCard | TriggerDescription$ When CARDNAME enters the battlefield, draw a card. +SVar:FreeCard:DB$ Draw | Defined$ You | NumCards$ 1 +A:AB$ Mana | Cost$ 1 T Sac<1/CARDNAME> | Produced$ Any | SpellDescription$ Add one mana of any color. +A:AB$ GainLife | Cost$ 2 T Sac<1/CARDNAME> | Defined$ You | LifeAmount$ 3 | SpellDescription$ You gain 3 life. +Oracle:When Golden Egg enters the battlefield, draw a card.\n{1}, {T}, Sacrifice Golden Egg: Add one mana of any color.\n{2}, {T}, Sacrifice Golden Egg: You gain 3 life. diff --git a/forge-gui/res/cardsfolder/upcoming/heraldic_banner.txt b/forge-gui/res/cardsfolder/upcoming/heraldic_banner.txt new file mode 100644 index 00000000000..4146dfe3285 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/heraldic_banner.txt @@ -0,0 +1,9 @@ +Name:Heraldic Banner +ManaCost:3 +Types:Artifact +K:ETBReplacement:Other:ChooseColor +SVar:ChooseColor:DB$ ChooseColor | Defined$ You | SpellDescription$ As CARDNAME enters the battlefield, choose a color. | AILogic$ MostProminentHumanCreatures +S:Mode$ Continuous | Affected$ Creature.ChosenColor+YouCtrl | AddPower$ 1 | Description$ Creatures you control of the chosen color get +1/+0. +A:AB$ Mana | Cost$ T | Produced$ Chosen | SpellDescription$ Add one mana of the chosen color. +SVar:PlayMain1:TRUE +Oracle:As Heraldic Banner enters the battlefield, choose a color.\nCreatures you control of the chosen color get +1/+0.\n{T}: Add one mana of the chosen color. diff --git a/forge-gui/res/cardsfolder/upcoming/inspiring_veteran.txt b/forge-gui/res/cardsfolder/upcoming/inspiring_veteran.txt new file mode 100644 index 00000000000..3ab04271a23 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/inspiring_veteran.txt @@ -0,0 +1,8 @@ +Name:Inspiring Veteran +ManaCost:R W +Types:Creature Human Knight +PT:2/2 +S:Mode$ Continuous | Affected$ Knight.YouCtrl+Other | AddPower$ 1 | AddToughness$ 1 | Description$ Other Knights you control get +1/+1. +SVar:PlayMain1:TRUE +DeckHints:Type$Knight +Oracle:Other Knights you control get +1/+1. diff --git a/forge-gui/res/cardsfolder/upcoming/keeper_of_fables.txt b/forge-gui/res/cardsfolder/upcoming/keeper_of_fables.txt new file mode 100644 index 00000000000..514c6fba44e --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/keeper_of_fables.txt @@ -0,0 +1,7 @@ +Name:Keeper of Fables +ManaCost:3 G G +Types:Creature Cat +PT:4/5 +T:Mode$ DamageDoneOnce | ValidSource$ Creature.nonHuman+YouCtrl | TriggerZones$ Battlefield | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigDraw | TriggerDescription$ Whenever one or more non-Human creatures you control deal combat damage to a player, draw a card. +SVar:TrigDraw:DB$ Draw | NumCards$ 1 +Oracle:Whenever one or more non-Human creatures you control deal combat damage to a player, draw a card. diff --git a/forge-gui/res/cardsfolder/upcoming/knights_charge.txt b/forge-gui/res/cardsfolder/upcoming/knights_charge.txt new file mode 100644 index 00000000000..d02512c705b --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/knights_charge.txt @@ -0,0 +1,10 @@ +Name:Knights' Charge +ManaCost:1 W B +Types:Enchantment +T:Mode$ Attacks | ValidCard$ Card.Knight+YouCtrl | TriggerZones$ Battlefield | Execute$ TrigDrain | TriggerDescription$ Whenever a Knight you control attacks, each opponent loses 1 life and you gain 1 life. +SVar:TrigDrain:DB$ LoseLife | Defined$ Player.Opponent | LifeAmount$ 1 | SubAbility$ DBGainLife +SVar:DBGainLife:DB$ GainLife | LifeAmount$ 1 +A:AB$ ChangeZoneAll | Cost$ 6 W B Sac<1/CARDNAME> | ChangeType$ Card.Knight+Creature+YouCtrl | Origin$ Graveyard | Destination$ Battlefield | SpellDescription$ Return all Knight creature cards from your graveyard to the battlefield. +DeckHints:Type$Knight +SVar:BuffedBy:Knight +Oracle:Whenever a Knight you control attacks, each opponent loses 1 life and you gain 1 life.\n{6}{W}{B}, Sacrifice Knights' Charge: Return all Knight creature cards from your graveyard to the battlefield. diff --git a/forge-gui/res/cardsfolder/upcoming/korvold_fae_cursed_king.txt b/forge-gui/res/cardsfolder/upcoming/korvold_fae_cursed_king.txt new file mode 100644 index 00000000000..cf1098c79c2 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/korvold_fae_cursed_king.txt @@ -0,0 +1,15 @@ +Name:Korvold, Fae-Cursed King +ManaCost:2 B R G +Types:Legendary Creature Dragon Noble +PT:4/4 +K:Flying +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigSac | TriggerDescription$ Whenever CARDNAME enters the battlefield or attacks, sacrifice another permanent. +T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigSac | Secondary$ True | TriggerDescription$ Whenever CARDNAME enters the battlefield or attacks, sacrifice another permanent. +SVar:TrigSac:DB$ Sacrifice | Defined$ You | SacValid$ Permanent.Other +SVar:NeedsToPlay:Permanent.YouCtrl+cmcLE2 +T:Mode$ Sacrificed | ValidCard$ Permanent | ValidPlayer$ You | Execute$ TrigPutCounter | TriggerZones$ Battlefield | TriggerDescription$ Whenever you sacrifice a permanent, put a +1/+1 counter on CARDNAME and draw a card. +SVar:TrigPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBDraw +SVar:DBDraw:DB$ Draw | Defined$ You | NumCards$ 1 +AI:RemoveDeck:Random +SVar:BuffedBy:Permanent.YouCtrl +Oracle:Flying\nWhenever Korvold, Fae-Cursed King enters the battlefield or attacks, sacrifice another permanent.\nWhenever you sacrifice a permanent, put a +1/+1 counter on Korvold and draw a card. diff --git a/forge-gui/res/cardsfolder/upcoming/mace_of_the_valiant.txt b/forge-gui/res/cardsfolder/upcoming/mace_of_the_valiant.txt new file mode 100644 index 00000000000..74a5c24fddb --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/mace_of_the_valiant.txt @@ -0,0 +1,12 @@ +Name:Mace of the Valiant +ManaCost:2 W +Types:Artifact Equipment +S:Mode$ Continuous | Affected$ Card.EquippedBy | AddPower$ X | AddToughness$ X | AddKeyword$ Vigilance | Description$ Equipped creature gets +1/+1 for each charge counter on CARDNAME and has vigilance. +SVar:X:Count$CardCounters.CHARGE +SVar:NeedsToPlayVar:X GE3 +AI:RemoveDeck:Random +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ Whenever a creature enters the battlefield under your control, put a charge counter on CARDNAME. +SVar:TrigPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ CHARGE | CounterNum$ 1 +SVar:BuffedBy:Creature +K:Equip:3 +Oracle:Equipped creature gets +1/+1 for each charge counter on Mace of the Valiant and has vigilance.\nWhenever a creature enters the battlefield under your control, put a charge counter on Mace of the Valiant.\nEquip {3} diff --git a/forge-gui/res/cardsfolder/upcoming/maraleaf_pixie.txt b/forge-gui/res/cardsfolder/upcoming/maraleaf_pixie.txt new file mode 100644 index 00000000000..c337e03e800 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/maraleaf_pixie.txt @@ -0,0 +1,8 @@ +Name:Maraleaf Pixie +ManaCost:G U +Types:Creature Faerie +PT:2/2 +K:Flying +A:AB$ Mana | Cost$ T | Produced$ U | SpellDescription$ Add {U}. +A:AB$ Mana | Cost$ T | Produced$ G | SpellDescription$ Add {G}. +Oracle:Flying\n{T}: Add {G} or {U}. diff --git a/forge-gui/res/cardsfolder/upcoming/midnight_clock.txt b/forge-gui/res/cardsfolder/upcoming/midnight_clock.txt new file mode 100644 index 00000000000..a92cf6c1230 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/midnight_clock.txt @@ -0,0 +1,13 @@ +Name:Midnight Clock +ManaCost:2 U +Types:Artifact +A:AB$ Mana | Cost$ T | Produced$ U | SpellDescription$ Add {U}. +A:AB$ PutCounter | Cost$ 2 U | CounterType$ HOUR | CounterNum$ 1 | SpellDescription$ Put an hour counter on CARDNAME. +AI:RemoveDeck:Random +T:Mode$ Phase | Phase$ Upkeep | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of each upkeep, put an hour counter on CARDNAME. +SVar:TrigPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ HOUR | CounterNum$ 1 +T:Mode$ CounterAdded | ValidCard$ Card.Self | TriggerZones$ Battlefield | CounterType$ HOUR | CounterAmount$ EQ12 | Execute$ TrigChangeAll | TriggerDescription$ When the twelfth hour counter is put on CARDNAME, shuffle your hand and graveyard into your library, then draw seven cards. Exile CARDNAME. +SVar:TrigChangeAll:DB$ ChangeZoneAll | Origin$ Graveyard,Hand | Destination$ Library | ChangeType$ Card.YouOwn | SubAbility$ DBDraw +SVar:DBDraw:DB$ Draw | Defined$ You | NumCards$ 7 | SubAbility$ DBExile +SVar:DBChange:DB$ ChangeZone | Origin$ Stack | Destination$ Exile +Oracle:{T}: Add {U}.\n{2}{U}: Put an hour counter on Midnight Clock.\nAt the beginning of each upkeep, put an hour counter on Midnight Clock.\nWhen the twelfth hour counter is put on Midnight Clock, shuffle your hand and graveyard into your library, then draw seven cards. Exile Midnight Clock. diff --git a/forge-gui/res/cardsfolder/upcoming/oko_thief_of_crowns.txt b/forge-gui/res/cardsfolder/upcoming/oko_thief_of_crowns.txt new file mode 100644 index 00000000000..84dd9bc8ab8 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/oko_thief_of_crowns.txt @@ -0,0 +1,9 @@ +Name:Oko, Thief of Crowns +ManaCost:1 G U +Types:Legendary Planeswalker Oko +Loyalty:4 +A:AB$ Token | Cost$ AddCounter<2/LOYALTY> | Planeswalker$ True | TokenAmount$ 1 | TokenScript$ c_a_food_sac | TokenOwner$ You | LegacyImage$ c a food sac eld | SpellDescription$ Create a Food Token. +A:AB$ Animate | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | ValidTgts$ Artifact,Creature | TgtPrompt$ Select target artifact or creature | Power$ 3 | Toughness$ 3 | RemoveAllAbilities$ True | Colors$ Green | OverwriteColors$ True | Types$ Creature,Elk | RemoveCreatureTypes$ True | RemoveCardTypes$ True | Permanent$ True | SpellDescription$ Target artifact or creature loses all abilities and becomes a green Elk creature with base power and toughness 3/3. +A:AB$ Pump | Cost$ SubCounter<5/LOYALTY> | Planeswalker$ True | Ultimate$ True | AITgts$ Artifact.YouCtrl+cmcLE1 | ValidTgts$ Artifact.YouCtrl,Creature.YouCtrl | TgtPrompt$ Choose target artifact or creature you control | SubAbility$ OkoExchange | SpellDescription$ Exchange control of target artifact or creature you control and target creature an opponent controls with power 3 or less. +SVar:OkoExchange:DB$ ExchangeControl | Defined$ ParentTarget | ValidTgts$ Creature.OppCtrl+powerLE3 | TgtPrompt$ Choose target creature an opponent controls with power 3 or less +Oracle:[+2]: Create a Food Token.\n[+1]: Target artifact or creature loses all abilities and becomes a green Elk creature with base power and toughness 3/3.\n[-5]: Exchange control of target artifact or creature you control and target creature an opponent controls with power 3 or less. diff --git a/forge-gui/res/cardsfolder/upcoming/piper_of_the_swarm.txt b/forge-gui/res/cardsfolder/upcoming/piper_of_the_swarm.txt new file mode 100644 index 00000000000..cf376559189 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/piper_of_the_swarm.txt @@ -0,0 +1,11 @@ +Name:Piper of the Swarm +ManaCost:1 B +Types:Creature Human Warlock +PT:1/3 +S:Mode$ Continuous | Affected$ Rat.YouCtrl | AddKeyword$ Menace | Description$ Rats you control have menace. +SVar:PlayMain1:TRUE +DeckHints:Type$Rat +A:AB$ Token | Cost$ 1 B T | TokenAmount$ 1 | TokenScript$ b_1_1_rat | TokenOwner$ You | LegacyImage$ b 1 1 rat eld | SpellDescription$ Create a 1/1 black Rat creature token. +A:AB$ GainControl | Cost$ 2 B B T Sac<3/Rat> | ValidTgts$ Creature | TgtPrompt$ Select target creature | SpellDescription$ Gain control of target creature. +AI:RemoveDeck:All +Oracle:Rats you control have menace.\n{1}{B}, {T}: Create a 1/1 black Rat creature token.\n{2}{B}{B}, {T}, Sacrifice three Rats: Gain control of target creature. diff --git a/forge-gui/res/cardsfolder/upcoming/rankle_master_of_pranks.txt b/forge-gui/res/cardsfolder/upcoming/rankle_master_of_pranks.txt new file mode 100644 index 00000000000..dc56299cd37 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/rankle_master_of_pranks.txt @@ -0,0 +1,13 @@ +Name:Rankle, Master of Pranks +ManaCost:2 B B +Types:Legendary Creature Faerie Rogue +PT:3/3 +K:Flying +K:Haste +T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigCharm | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, ABILITY +SVar:TrigCharm:DB$ Charm | Choices$ DBDiscard,DBLoseLife,DBSac | MinCharmNum$ 0 | CharmNum$ 3 +SVar:DBDiscard:DB$ Discard | NumCards$ 1 | Mode$ TgtChoose | Defined$ Player | SpellDescription$ Each player discards a card. +SVar:DBLoseLife:DB$ LoseLife | LifeAmount$ 1 | Defined$ Player | SubAbility$ DBDraw | SpellDescription$ Each player loses 1 life and draws a card. +SVar:DBDraw:DB$ Draw | Defined$ Player | NumCards$ 1 +SVar:DBSac:DB$ Sacrifice | SacValid$ Creature | Defined$ Player | SpellDescription$ Each player sacrifices a creature. +Oracle:Flying, haste\nWhenever Rankle, Master of Pranks deals combat damage to a player, choose any number —\n• Each player discards a card.\n• Each player loses 1 life and draws a card.\n• Each player sacrifices a creature. diff --git a/forge-gui/res/cardsfolder/upcoming/run_away_together.txt b/forge-gui/res/cardsfolder/upcoming/run_away_together.txt new file mode 100644 index 00000000000..7d039ac73cd --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/run_away_together.txt @@ -0,0 +1,5 @@ +Name:Run Away Together +ManaCost:1 U +Types:Instant +A:SP$ ChangeZone | Cost$ 1 U | TargetMin$ 2 | TargetMax$ 2 | TargetsWithDifferentControllers$ True | ValidTgts$ Creature | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Choose two target creatures by different players. Return those creatures to their owners' hands. +Oracle:Choose two target creatures controlled by different players. Return those creatures to their owners' hands. diff --git a/forge-gui/res/cardsfolder/upcoming/savvy_hunter.txt b/forge-gui/res/cardsfolder/upcoming/savvy_hunter.txt new file mode 100644 index 00000000000..e165dc5b962 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/savvy_hunter.txt @@ -0,0 +1,10 @@ +Name:Savvy Hunter +ManaCost:1 B G +Types:Creature Human Warrior +PT:3/3 +T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ Whenever CARDNAME attacks or blocks, create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") +T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ TrigToken | TriggerZones$ Battlefield | Secondary$ True | TriggerDescription$ Whenever CARDNAME attacks or blocks, create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") +SVar:TrigToken:DB$ Token | TokenAmount$ 1 | TokenScript$ c_a_food_sac | TokenOwner$ You | LegacyImage$ c a food sac eld +SVar:HasAttackEffect:TRUE +A:AB$ Draw | Cost$ Sac<2/Food> | NumCards$ 1 | SpellDescription$ Draw a card. +Oracle:Whenever Savvy Hunter attacks or blocks, create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.")\nSacrifice two Foods: Draw a card. diff --git a/forge-gui/res/cardsfolder/upcoming/shambling_suit.txt b/forge-gui/res/cardsfolder/upcoming/shambling_suit.txt new file mode 100644 index 00000000000..04c4dc70ae6 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/shambling_suit.txt @@ -0,0 +1,7 @@ +Name:Shambling Suit +ManaCost:3 +Types:Artifact Creature Construct +PT:*/3 +S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ X | References$ X | Description$ CARDNAME's power is equal to the number of artifacts and/or enchantments you control. +SVar:X:Count$Valid Artifact.YouCtrl,Enchantment.YouCtrl +Oracle:Shambling Suit's power is equal to the number of artifacts and/or enchantments you control. diff --git a/forge-gui/res/cardsfolder/upcoming/shimmer_dragon.txt b/forge-gui/res/cardsfolder/upcoming/shimmer_dragon.txt new file mode 100644 index 00000000000..f76836c523d --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/shimmer_dragon.txt @@ -0,0 +1,10 @@ +Name:Shimmer Dragon +ManaCost:4 U U +Types:Creature Dragon +PT:5/6 +K:Flying +S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Hexproof | IsPresent$ Artifact.YouCtrl | PresentCompare$ GE4 | Description$ As long as you control four or more artifacts, CARDNAME has hexproof. +A:AB$ Draw | Cost$ tapXType<2/Artifact> | NumCards$ 1 | SpellDescription$ Draw a card. +SVar:BuffedBy:Artifact +DeckHints:Type$Artifact +Oracle:Flying\nAs long as you control four or more artifacts, Shimmer Dragon has hexproof.\nTap two untapped artifacts you control: Draw a card. diff --git a/forge-gui/res/cardsfolder/upcoming/shinechaser.txt b/forge-gui/res/cardsfolder/upcoming/shinechaser.txt new file mode 100644 index 00000000000..f8dc1c7309c --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/shinechaser.txt @@ -0,0 +1,10 @@ +Name:Shinechaser +ManaCost:1 W U +Types:Creature Faerie +PT:1/1 +K:Flying +K:Vigilance +S:Mode$ Continuous | Affected$ Card.Self | AddPower$ 1 | AddToughness$ 1 | IsPresent$ Artifact.YouCtrl | Description$ CARDNAME gets +1/+1 as long as you control an artifact. +S:Mode$ Continuous | Affected$ Card.Self | AddPower$ 1 | AddToughness$ 1 | IsPresent$ Enchantment.YouCtrl | Description$ CARDNAME gets +1/+1 as long as you control an enchantment. +SVar:BuffedBy:Enchantment,Artifact +Oracle:Flying, vigilance\nShinechaser gets +1/+1 as long as you control an artifact.\nShinechaser gets +1/+1 as long as you control an enchantment. diff --git a/forge-gui/res/cardsfolder/upcoming/shining_armor.txt b/forge-gui/res/cardsfolder/upcoming/shining_armor.txt new file mode 100644 index 00000000000..68e38c4abe4 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/shining_armor.txt @@ -0,0 +1,11 @@ +Name:Shining Armor +ManaCost:1 W +Types:Artifact Equipment +K:Flash +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigAttach | TriggerDescription$ When CARDNAME enters the battlefield, attach it to target Knight you control. +SVar:TrigAttach:DB$ Attach | ValidTgts$ Knight.YouCtrl | TgtPrompt$ Select target Knight you control +S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddToughness$ 2 | AddKeyword$ Vigilance | Description$ Equipped creature gets +0/+2 and has vigilance. +K:Equip:3 +SVar:BuffedBy:Knight +DeckHints:Type$Knight +Oracle:Flash\nWhen Shining Armor enters the battlefield, attach it to target Knight you control.\nEquipped creature gets +0/+2 and has vigilance.\Equip {3} ({3}: Attach to target creature you control. Equip only as a sorcery.) diff --git a/forge-gui/res/cardsfolder/upcoming/silverflame_ritual.txt b/forge-gui/res/cardsfolder/upcoming/silverflame_ritual.txt new file mode 100644 index 00000000000..7692b568a9b --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/silverflame_ritual.txt @@ -0,0 +1,7 @@ +Name:Silverflame Ritual +ManaCost:3 W +Types:Sorcery +A:SP$ PutCounterAll | Cost$ 3 W | ValidCards$ Creature.YouCtrl | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBPumpAll | SpellDescription$ Put a +1/+1 counter on each creature you control. Adamant — If at least three white mana was spent to cast this spell, creatures you control gain vigilance until end of turn. +SVar:DBPumpAll:DB$ PumpAll | ValidCards$ Creature.YouCtrl | KW$ Vigilance | ConditionCheckSVar$ X | References$ X +SVar:X:Count$Adamant.White.1.0 +Oracle:Put a +1/+1 counter on each creature you control.\nAdamant — If at least three white mana was spent to cast this spell, creatures you control gain vigilance until end of turn. diff --git a/forge-gui/res/cardsfolder/upcoming/silverwing_squadron.txt b/forge-gui/res/cardsfolder/upcoming/silverwing_squadron.txt new file mode 100644 index 00000000000..ec7e1b888ad --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/silverwing_squadron.txt @@ -0,0 +1,14 @@ +Name:Silverwing Squadron +ManaCost:5 W +Types:Creature Human Knight +PT:*/* +K:Flying +K:Vigilance +S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ X | SetToughness$ X | Description$ CARDNAME's power and toughness are each equal to the number of creatures you control. +SVar:X:Count$Valid Creature.YouCtrl +SVar:BuffedBy:Creature +SVar:NoZeroToughnessAI:True +T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ Whenever CARDNAME attacks, create a number of 2/2 white Knight creature tokens with vigilance equal to the number of opponents you have. +SVar:TrigToken:DB$ Token | TokenOwner$ You | TokenAmount$ Y | TokenScript$ w_2_2_knight_vigilance | LegacyImage$ w 2 2 knight vigilance eld | References$ Y +SVar:Y:PlayerCountOpponents$Amount +Oracle:Flying, vigilance\nSilverwing Squadron's power and toughness are each equal to the number of creatures you control.\nWhenever Silverwing Squadron attacks, create a number of 2/2 white Knight creature tokens with vigilance equal to the number of opponents you have. diff --git a/forge-gui/res/cardsfolder/upcoming/slaying_fire.txt b/forge-gui/res/cardsfolder/upcoming/slaying_fire.txt new file mode 100644 index 00000000000..8476797dfaa --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/slaying_fire.txt @@ -0,0 +1,6 @@ +Name:Slaying Fire +ManaCost:2 R +Types:Instant +A:SP$ DealDamage | Cost$ 2 R | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ X | References$ X | SpellDescription$ CARDNAME deals 3 damage to any target. Adamant — If at least three red mana was spent to cast this spell, it deals 4 damage instead. +SVar:X:Count$Adamant.Red.4.3 +Oracle:Slaying Fire deals 3 damage to any target.\nAdamant — If at least three red mana was spent to cast this spell, it deals 4 damage instead. diff --git a/forge-gui/res/cardsfolder/upcoming/steelbane_hydra.txt b/forge-gui/res/cardsfolder/upcoming/steelbane_hydra.txt new file mode 100644 index 00000000000..600dcc1b8fb --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/steelbane_hydra.txt @@ -0,0 +1,8 @@ +Name:Steelbane Hydra +ManaCost:X G G +Types:Creature Turtle Hydra +PT:0/0 +K:etbCounter:P1P1:X +SVar:X:Count$xPaid +A:AB$ Destroy | Cost$ 2 G SubCounter<1/P1P1> | ValidTgts$ Artifact,Enchantment | TgtPrompt$ Select target artifact or enchantment | SpellDescription$ Destroy target artifact or enchantment. +Oracle:Steelbane Hydra enters the battlefield with X +1/+1 counters on it.\n{2}{G}, Remove a +1/+1 counter from Steelbane Hydra: Destroy target artifact or enchantment. diff --git a/forge-gui/res/cardsfolder/upcoming/steelclaw_lance.txt b/forge-gui/res/cardsfolder/upcoming/steelclaw_lance.txt new file mode 100644 index 00000000000..0247261b16f --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/steelclaw_lance.txt @@ -0,0 +1,7 @@ +Name:Steelclaw Lance +ManaCost:B R +Types:Artifact Equipment +S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 2 | AddToughness$ 2 | Description$ Equipped creature gets +2/+2. +K:Equip:1:Creature.Knight+YouCtrl:Knight +K:Equip:3 +Oracle:Equipped creature gets +2/+2.\nEquip Knight {1} ({1}: Attach to target Knight creature you control. Equip only as a sorcery.)\nEquip {3} ({3}: Attach to target creature you control. Equip only as a sorcery.) diff --git a/forge-gui/res/cardsfolder/upcoming/syr_gwyn_hero_of_ashvale.txt b/forge-gui/res/cardsfolder/upcoming/syr_gwyn_hero_of_ashvale.txt new file mode 100644 index 00000000000..2aca904bcd0 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/syr_gwyn_hero_of_ashvale.txt @@ -0,0 +1,11 @@ +Name:Syr Gwyn, Hero of Ashvale +ManaCost:3 R W B +Types:Legendary Creature Human Knight +PT:5/5 +K:Vigilance +K:Menace +T:Mode$ Attacks | ValidCard$ Creature.YouCtrl+equipped | TriggerZones$ Battlefield | Execute$ TrigDraw | TriggerDescription$ Whenever an equipped creature you control attacks, you draw a card and you lose 1 life. +SVar:TrigDraw:DB$ Draw | NumCards$ 1 | SubAbility$ DBLoseLife +SVar:DBLoseLife:DB$ LoseLife | LifeAmount$ 1 +S:Mode$ Continuous | Affected$ Equipment.YouCtrl | AddKeyword$ Equip:0:Creature.YouCtrl+Knight:Knight | Description$ Equipment you control have equip Knight {0}. +Oracle:Vigilance, menace\nWhenever an equipped creature you control attacks, you draw a card and you lose 1 life.\nEquipment you control have equip Knight {0}. diff --git a/forge-gui/res/cardsfolder/upcoming/syr_konrad_the_grim.txt b/forge-gui/res/cardsfolder/upcoming/syr_konrad_the_grim.txt new file mode 100644 index 00000000000..3d7b61f5af9 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/syr_konrad_the_grim.txt @@ -0,0 +1,10 @@ +Name:Syr Konrad, the Grim +ManaCost:3 B B +Types:Legendary Creature Human Knight +PT:5/4 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Creature.Other | TriggerZones$ Battlefield | Execute$ TrigDmg | TriggerDescription$ Whenever another creature dies, or a creature card is put into a graveyard from anywhere than the battlefield, or a creature card leaves your graveyard, CARDNAME deals 1 damage to each opponent. +T:Mode$ ChangesZone | Origin$ Graveyard | Destination$ Any | ValidCard$ Card.Creature+Other | TriggerZones$ Battlefield | Execute$ TrigDmg | Secondary$ True | TriggerDescription$ Whenever another creature dies, or a creature card is put into a graveyard from anywhere than the battlefield, or a creature card leaves your graveyard, CARDNAME deals 1 damage to each opponent. +SVar:TrigDmg:DB$ DealDamage | Defined$ Player.Opponent | NumDmg$ 1 +A:AB$ Mill | Cost$ 1 B | NumCards$ 1 | Defined$ Player | SpellDescription$ Each player puts the top card of their library into their graveyard. +AI:RemoveDeck:All +Oracle:Whenever another creature dies, or a creature card is put into a graveyard from anywhere other than the battlefield, or a creature card leaves your graveyard, Syr Konrad, the Grim deals 1 damage to each opponent.\n{1}{B}: Each player puts the top card of their library into their graveyard. diff --git a/forge-gui/res/cardsfolder/upcoming/taste_of_death.txt b/forge-gui/res/cardsfolder/upcoming/taste_of_death.txt new file mode 100644 index 00000000000..f3e9b865f9c --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/taste_of_death.txt @@ -0,0 +1,7 @@ +Name:Taste of Death +ManaCost:4 B B +Types:Sorcery +A:SP$ Sacrifice | Cost$ 4 B B | Amount$ 3 | Defined$ Player | SacValid$ Creature | SpellDescription$ Each player sacrifices three creatures. You create three Food tokens. | SubAbility$ DBToken +SVar:DBToken:DB$ Token | TokenAmount$ 3 | TokenScript$ c_a_food_sac | TokenOwner$ You | LegacyImage$ c a food sac eld +DeckHas:Ability$LifeGain +Oracle:Each player sacrifices three creatures. You create three Food tokens. diff --git a/forge-gui/res/cardsfolder/upcoming/the_circle_of_loyalty.txt b/forge-gui/res/cardsfolder/upcoming/the_circle_of_loyalty.txt new file mode 100644 index 00000000000..16efcc7b77e --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/the_circle_of_loyalty.txt @@ -0,0 +1,14 @@ +Name:The Circle of Loyalty +ManaCost:4 W W +Types:Legendary Artifact +S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ X | References$ X | EffectZone$ All | Description$ CARDNAME costs {1} less to cast for each Knight you control. +SVar:X:Count$Valid Knight.YouCtrl +S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Creatures you control get +1/+1. +T:Mode$ SpellCast | ValidCard$ Card.Legendary | ValidActivatingPlayer$ You | Execute$ TrigToken | TriggerZones$ Battlefield | TriggerDescription$ Whenever you cast a legendary spell, create a 2/2 white Knight creature token with vigilance. +SVar:TrigToken:DB$ Token | TokenAmount$ 1 | TokenScript$ w_2_2_knight_vigilance | TokenOwner$ You | LegacyImage$ w 2 2 knight vigilance eld +A:AB$ Token | Cost$ 3 W T | TokenAmount$ 1 | TokenScript$ w_2_2_knight_vigilance | TokenOwner$ You | LegacyImage$ w 2 2 knight vigilance eld | SpellDescription$ Create a 2/2 white Knight creature token with vigilance. +SVar:PlayMain1:TRUE +SVar:BuffedBy:Legendary +DeckHas:Ability$Token +DeckHints:Type$Knight +Oracle:This spell costs {1} less to cast for each Knight you control.\nCreatures you control get +1/+1.\nWhenever you cast a legendary spell, create a 2/2 white Knight creature token with vigilance.\n{3}{W}, {T}: Create a 2/2 white Knight creature token with vigilance. diff --git a/forge-gui/res/cardsfolder/upcoming/thorn_mammoth.txt b/forge-gui/res/cardsfolder/upcoming/thorn_mammoth.txt new file mode 100644 index 00000000000..06cfcb29fb2 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/thorn_mammoth.txt @@ -0,0 +1,9 @@ +Name:Thorn Mammoth +ManaCost:5 G G +Types:Creature Elephant +PT:6/6 +K:Trample +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigFight | TriggerDescription$ Whenever CARDNAME or another creature enters the battlefield under your control, CARDNAME fights up to one target creature you don't control. +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Other+YouCtrl | TriggerZones$ Battlefield | Execute$ TrigFight | Secondary$ True | TriggerDescription$ Whenever CARDNAME or another creature enters the battlefield under your control, CARDNAME fights up to one target creature you don't control. +SVar:TrigFight:DB$ Fight | Defined$ TriggeredCardLKICopy | ValidTgts$ Creature.YouDontCtrl | TgtPrompt$ Choose target creature you don't control | TargetMin$ 0 | TargetMax$ 1 +Oracle:Trample\nWhenever Thorn Mammoth or another creature enters the battlefield under your control, Thorn Mammoth fights up to one target creature you don't control. diff --git a/forge-gui/res/cardsfolder/upcoming/tome_of_legends.txt b/forge-gui/res/cardsfolder/upcoming/tome_of_legends.txt new file mode 100644 index 00000000000..c2becfeeed6 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/tome_of_legends.txt @@ -0,0 +1,11 @@ +Name:Tome of Legends +ManaCost:2 +Types:Artifact +K:etbCounter:PAGE:1 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.IsCommander+YouOwn+YouCtrl | Execute$ TrigPutCounter | TriggerDescription$ Whenever your commander enters the battlefield or attacks, put a page counter on CARDNAME. +T:Mode$ Attacks | ValidCard$ Card.IsCommander+YouOwn+YouCtrl | TriggerZones$ Battlefield | Execute$ TrigPutCounter | Secondary$ True | TriggerDescription$ Whenever your commander enters the battlefield or attacks, put a page counter on CARDNAME. +SVar:TrigPutCounter:DB$PutCounter | Defined$ Self | CounterType$ PAGE | CounterNum$ 1 +SVar:HasAttackEffect:TRUE +DeckHints:Type$IsCommander +A:AB$ Draw | Cost$ 1 T SubCounter<1/PAGE> | NumCards$ 1 | SpellDescription$ Draw a card. +Oracle:Tome of Legends enters the battlefield with a page counter on it.\nWhenever your commander enters the battlefield or attacks, put a page counter on Tome of Legends.\n{1}, {T}, Remove a page counter from Tome of Legends: Draw a card. diff --git a/forge-gui/res/cardsfolder/upcoming/tome_raider.txt b/forge-gui/res/cardsfolder/upcoming/tome_raider.txt new file mode 100644 index 00000000000..f28b1077eda --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/tome_raider.txt @@ -0,0 +1,8 @@ +Name:Tome Raider +ManaCost:2 U +Types:Creature Faerie +PT:1/1 +K:Flying +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDraw | TriggerDescription$ When CARDNAME enters the battlefield, draw a card. +SVar:TrigDraw:DB$ Draw | Defined$ You | NumCards$ 1 +Oracle:Flying\nWhen Tome Raider enters the battlefield, draw a card. diff --git a/forge-gui/res/cardsfolder/upcoming/tournament_grounds.txt b/forge-gui/res/cardsfolder/upcoming/tournament_grounds.txt new file mode 100644 index 00000000000..dfaf64e80d0 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/tournament_grounds.txt @@ -0,0 +1,9 @@ +Name:Tournament Grounds +ManaCost:no cost +Types:Land +A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}. +A:AB$ Mana | Cost$ T | Produced$ R | RestrictValid$ Card.Knight,Card.Equipment | SpellDescription$ Add {R}. Spend this mana only to cast a Knight or Equipment spell. +A:AB$ Mana | Cost$ T | Produced$ W | RestrictValid$ Card.Knight,Card.Equipment | SpellDescription$ Add {W}. Spend this mana only to cast a Knight or Equipment spell. +A:AB$ Mana | Cost$ T | Produced$ B | RestrictValid$ Card.Knight,Card.Equipment | SpellDescription$ Add {B}. Spend this mana only to cast a Knight or Equipment spell. +AI:RemoveDeck:Random +Oracle:{T}: Add {C}.\n{T}: Add {R}, {W}, or {B}. Spend this mana only to cast a Knight or Equipment spell. diff --git a/forge-gui/res/cardsfolder/upcoming/venerable_knight.txt b/forge-gui/res/cardsfolder/upcoming/venerable_knight.txt new file mode 100644 index 00000000000..90adcc55028 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/venerable_knight.txt @@ -0,0 +1,8 @@ +Name:Venerable Knight +ManaCost:W +Types:Creature Human Knight +PT:2/1 +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigPutCounter | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME dies, put a +1/+1 counter on target Knight you control. +SVar:TrigPutCounter:DB$ PutCounter | ValidTgts$ Knight.YouCtrl | TgtPrompt$ Select target Knight you control | CounterType$ P1P1 | CounterNum$ 1 +DeckHints:Type$Knight +Oracle:When Venerable Knight dies, put a +1/+1 counter on target Knight you control. diff --git a/forge-gui/res/cardsfolder/upcoming/wintermoor_commander.txt b/forge-gui/res/cardsfolder/upcoming/wintermoor_commander.txt new file mode 100644 index 00000000000..8ae9de01b7f --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/wintermoor_commander.txt @@ -0,0 +1,12 @@ +Name:Wintermoor Commander +ManaCost:W B +Types:Creature Human Knight +PT:2/* +K:Deathtouch +S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetToughness$ X | References$ X | Description$ CARDNAME's toughness is equal to the number of Knights you control. +SVar:X:Count$Valid Knight.YouCtrl +SVar:BuffedBy:Knight +T:Mode$ Attacks | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigPump | TriggerDescription$ Whenever CARDNAME attacks, another target Knight you control gains indestructible until end of turn. (Damage and effects that say "destroy" don't destroy it.) +SVar:TrigPump:DB$ Pump | ValidTgts$ Knight.YouCtrl+Other | TgtPrompt$ Select another target Knight you control | KW$ Indestructible +DeckHints:Type$Knight +Oracle:Deathtouch\nWintermoor Commander's toughness is equal to the number of Knights you control.\nWhenever Wintermoor Commander attacks, another target Knight you control gains indestructible until end of turn. (Damage and effects that say "destroy" don't destroy it.) diff --git a/forge-gui/res/cardsfolder/upcoming/wishful_merfolk.txt b/forge-gui/res/cardsfolder/upcoming/wishful_merfolk.txt new file mode 100644 index 00000000000..fe1d0778d33 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/wishful_merfolk.txt @@ -0,0 +1,8 @@ +Name:Wishful Merfolk +ManaCost:1 U +Types:Creature Merfolk +PT:3/2 +K:Defender +A:AB$ Debuff | Cost$ 1 U | Defined$ Self | Keywords$ Defender | SubAbility$ DBAnimate | SpellDescription$ CARDNAME loses defender and becomes a Human until end of turn. +SVar:DBAnimate:DB$Animate | Defined$ Self | Types$ Human | RemoveCreatureTypes$ True +Oracle:Defender\n{1}{U}: Wishful Merfolk loses defender and becomes a Human until end of turn. diff --git a/forge-gui/res/cardsfolder/upcoming/witching_well.txt b/forge-gui/res/cardsfolder/upcoming/witching_well.txt new file mode 100644 index 00000000000..d0899ba9348 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/witching_well.txt @@ -0,0 +1,7 @@ +Name:Witching Well +ManaCost:U +Types:Artifact +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigScry | TriggerDescription$ When CARDNAME enters the battlefield, scry 2. (Look at the top two cards of your library, then put any number of them on the bottom of your library and the rest on the top in any order.) +SVar:TrigScry:DB$ Scry | ScryNum$ 2 +A:AB$ Draw | Cost$ 3 U Sac<1/CARDNAME> | NumCards$ 2 | SpellDescription$ Draw two cards. +Oracle:When Witching Well enters the battlefield, scry 2. (Look at the top two cards of your library, then put any number of them on the bottom of your library and the rest on the top in any order.)\n{3}{U}, Sacrifice Witching Well: Draw two cards. diff --git a/forge-gui/res/cardsfolder/upcoming/witchs_cottage.txt b/forge-gui/res/cardsfolder/upcoming/witchs_cottage.txt new file mode 100644 index 00000000000..b6b9625fad9 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/witchs_cottage.txt @@ -0,0 +1,10 @@ +Name:Witch's Cottage +ManaCost:no cost +Types:Land Swamp +R:Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | ReplaceWith$ LandTapped | Description$ CARDNAME enters the battlefield tapped unless you control three or more other Swamps. +SVar:LandTapped:DB$ Tap | Defined$ Self | ETB$ True | ConditionCheckSVar$ ETBCheckSVar | ConditionSVarCompare$ LT3 | References$ ETBCheckSVar | SubAbility$ MoveToPlay +SVar:MoveToPlay:DB$ ChangeZone | Defined$ Self | Origin$ All | Destination$ Battlefield +SVar:ETBCheckSVar:Count$Valid Swamp.YouCtrl+Other +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChange | OptionalDecider$ You | TriggerDescription$ When CARDNAME enters the battlefield, you may put target creature card from your graveyard on top of your library. +SVar:TrigChange:DB$ ChangeZone | TgtPrompt$ Choose target creature card in your graveyard | ValidTgts$ Creature.YouOwn | Origin$ Graveyard | Destination$ Library +Oracle:({T}: Add {B}.)\nWitch's Cottage enters the battlefield tapped unless you control three or more other Swamps.\nWhen Witch's Cottage enters the battlefield untapped, you may put target creature card from your graveyard on top of your library. diff --git a/forge-gui/res/cardsfolder/upcoming/witchs_oven.txt b/forge-gui/res/cardsfolder/upcoming/witchs_oven.txt new file mode 100644 index 00000000000..43954e3ade5 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/witchs_oven.txt @@ -0,0 +1,9 @@ +Name:Witch's Oven +ManaCost:1 +Types:Artifact +A:AB$ Token | Cost$ T Sac<1/Creature> | TokenAmount$ X | References$ X,Y | TokenScript$ c_a_food_sac | TokenOwner$ You | LegacyImage$ c a food sac eld | SpellDescription$ Create a Food token. If the sacrificed creature's toughness was 4 or greater, create two Food tokens instead. (They're artifacts with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") +SVar:AIPreference:SacCost$Creature.token +SVar:X:Count$Compare Y GE4.2.1 +SVar:Y:Sacrificed$CardToughness +AI:RemoveDeck:Random +Oracle:{T}, Sacrifice a creature: Create a Food token. If the sacrificed creature's toughness was 4 or greater, create two Food tokens instead. (They're artifacts with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") diff --git a/forge-gui/res/cardsfolder/upcoming/workshop_elders.txt b/forge-gui/res/cardsfolder/upcoming/workshop_elders.txt new file mode 100644 index 00000000000..8d4ae5b13f5 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/workshop_elders.txt @@ -0,0 +1,10 @@ +Name:Workshop Elders +ManaCost:6 U +Types:Creature Human Artificer +PT:4/4 +S:Mode$ Continuous | Affected$ Creature.Artifact+YouCtrl | AddKeyword$ Flying | Description$ Artifact creatures you control have flying. +SVar:PlayMain1:TRUE +T:Mode$ Phase | Phase$ BeginCombat | ValidPlayer$ You | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TrigAnimate | TriggerDescription$ At the beginning of combat on your turn, you may have target noncreature artifact you control becomes a 0/0 artifact creature. If you do, put four +1/+1 counters on it. +SVar:TrigAnimate:DB$ Animate | ValidTgts$ Artifact.nonCreature+YouCtrl | TgtPrompt$ Select noncreature artifact | Power$ 0 | Toughness$ 0 | Types$ Artifact,Creature | RemoveCardTypes$ True | Permanent$ True | SubAbility$ DBPutCounter +SVar:DBPutCounter:DB$ PutCounter | Defined$ Targeted | CounterType$ P1P1 | CounterNum$ 4 +Oracle:Artifact creatures you control have flying.\nAt the beginning of combat on your turn, you may have target noncreature artifact you control become a 0/0 artifact creature. If you do, put four +1/+1 counters on it. diff --git a/forge-gui/res/cardsfolder/upcoming/voice_of_many.txt b/forge-gui/res/cardsfolder/v/voice_of_many.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/voice_of_many.txt rename to forge-gui/res/cardsfolder/v/voice_of_many.txt diff --git a/forge-gui/res/cardsfolder/upcoming/volrath_the_shapestealer.txt b/forge-gui/res/cardsfolder/v/volrath_the_shapestealer.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/volrath_the_shapestealer.txt rename to forge-gui/res/cardsfolder/v/volrath_the_shapestealer.txt diff --git a/forge-gui/res/cardsfolder/v/vraskas_stoneglare.txt b/forge-gui/res/cardsfolder/v/vraskas_stoneglare.txt index f4801d7b67f..1a6c3cb90d1 100644 --- a/forge-gui/res/cardsfolder/v/vraskas_stoneglare.txt +++ b/forge-gui/res/cardsfolder/v/vraskas_stoneglare.txt @@ -4,5 +4,6 @@ Types:Sorcery A:SP$ Destroy | Cost$ 4 B G | ValidTgts$ Creature | TgtPrompt$ Select target creature | SubAbility$ DBGainLife | SpellDescription$ Destroy target creature. You gain life equal to its toughness. You may search your library and/or graveyard from a card named Vraska, Regal Gorgon, reveal it, and put it into your hand. If you search your library this way, shuffle it. SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ X | SubAbility$ DBCleanup | References$ X | SubAbility$ DBSearch SVar:DBSearch:DB$ ChangeZone | Origin$ Library,Graveyard | Destination$ Hand | ChangeType$ Card.namedVraska; Regal Gorgon | ChangeNum$ 1 | Optional$ True +SVar:X:TargetedLKI$CardToughness DeckNeeds:Name$Vraska, Regal Gorgon Oracle:Destroy target creature. You gain life equal to its toughness. You may search your library and/or graveyard from a card named Vraska, Regal Gorgon, reveal it, and put it in to your hand. If you search your library this way, shuffle it. diff --git a/forge-gui/res/cardsfolder/upcoming/wall_of_stolen_identity.txt b/forge-gui/res/cardsfolder/w/wall_of_stolen_identity.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/wall_of_stolen_identity.txt rename to forge-gui/res/cardsfolder/w/wall_of_stolen_identity.txt diff --git a/forge-gui/res/cardsfolder/upcoming/wildfire_devils.txt b/forge-gui/res/cardsfolder/w/wildfire_devils.txt similarity index 100% rename from forge-gui/res/cardsfolder/upcoming/wildfire_devils.txt rename to forge-gui/res/cardsfolder/w/wildfire_devils.txt diff --git a/forge-gui/res/cube/Ryan Overturf's Grixis Cube (MTGO).dck b/forge-gui/res/cube/Ryan Overturf's Grixis Cube (MTGO).dck new file mode 100644 index 00000000000..c92da263279 --- /dev/null +++ b/forge-gui/res/cube/Ryan Overturf's Grixis Cube (MTGO).dck @@ -0,0 +1,543 @@ +[metadata] +Name=Ryan Overturf's Grixis Cube (MTGO) +[Main] +1 Abbot of Keral Keep|ORI +1 Abrade|HOU +1 Academy Ruins|TSP +1 Agent of Treachery|M20 +1 All Is Dust|ROE +1 Aminatou's Augury|C18 +1 Ancestral Vision|TSP +1 Ancient Tomb|UMA +1 Anger of the Gods|IMA +1 Angrath's Rampage|WAR +1 Animate Dead|EMA +1 Arc Trail|DDN +1 Arcane Artisan|BBD +1 Arguel's Blood Fast|V17 +1 Aria of Flame|MH1 +1 Ash Zealot|RTR +1 Augur of Bolas|WAR +1 Avalanche Riders|TSB +1 Badlands|VMA +1 Baleful Strix|PC2 +1 Baral, Chief of Compliance|AER +1 Basalt Monolith|CM2 +1 Batterskull|NPH +1 Bedevil|RNA +1 Bedlam Reveler|EMN +1 Bitterblossom|UMA +1 Blackcleave Cliffs|SOM +1 Blast Zone|WAR +1 Blightsteel Colossus|MBS +1 Blink of an Eye|DOM +1 Blinkmoth Nexus|MM2 +1 Blood Artist|C17 +1 Blood Crypt|DIS +1 Bloodghast|IMA +1 Bloodsoaked Champion|KTK +1 Bloodstained Mire|KTK +1 Bolas's Citadel|WAR +1 Bomat Courier|KLD +1 Braids, Cabal Minion|EMA +1 Brain Freeze|VMA +1 Brain Maggot|JOU +1 Brainstorm|C18 +1 Buried Alive|UMA +1 Burning of Xinye|V14 +1 Burst Lightning|MM2 +1 Cabal Ritual|VMA +1 Candelabra of Tawnos|ME4 +1 Canyon Slough|AKH +1 Careful Study|ODY +1 Carrion Feeder|SCG +1 Cascade Bluffs|A25 +1 Cast Down|DOM +1 Cathartic Reunion|KLD +1 Chain Lightning|BBD +1 Chainer's Edict|UMA +1 Chains of Mephistopheles|MED +1 Champion of Wits|HOU +1 Chandra, Acolyte of Flame|M20 +1 Chandra, Awakened Inferno|M20 +1 Chandra, Fire of Kaladesh|V17 +1 Chandra, Flamecaller|OGW +1 Chandra, Torch of Defiance|KLD +1 Charcoal Diamond|C14 +1 Chart a Course|XLN +1 Chromatic Lantern|GRN +1 Chrome Mox|EMA +1 City of Traitors|EXO +1 Coalition Relic|A25 +1 Coercive Portal|VMA +1 Coldsteel Heart|CSP +1 Collective Brutality|EMN +1 Commence the Endgame|WAR +1 Commit // Memory|AKH +1 Compulsive Research|RAV +1 Consecrated Sphinx|MBS +1 Corpse Dance|TMP +1 Counterspell|EMA +1 Countersquall|UMA +1 Creeping Tar Pit|UMA +1 Crucible of Worlds|M19 +1 Cruel Ultimatum|DDH +1 Crumbling Necropolis|C17 +1 Cryptbreaker|EMN +1 Cryptic Command|IMA +1 Crystal Vein|CMA +1 Cut // Ribbons|AKH +1 Dack Fayden|CNS +1 Dack's Duplicate|CNS +1 Damnation|PLC +1 Daretti, Ingenious Iconoclast|PZ2 +1 Daretti, Scrap Savant|CM2 +1 Dark Confidant|RAV +1 Dark Petition|ORI +1 Dark Ritual|A25 +1 Darkslick Shores|SOM +1 Darksteel Citadel|MM2 +1 Darksteel Ingot|CM2 +1 Davriel, Rogue Shadowmage|WAR +1 Daze|NEM +1 Defense Grid|ULG +1 Defile|MH1 +1 Delver of Secrets|V17 +1 Demonic Tutor|LEA +1 Desperate Ritual|UMA +1 Devastating Summons|ROE +1 Dig Through Time|UMA +1 Dimir Signet|RAV +1 Dire Fleet Daredevil|RIX +1 Disallow|AER +1 Discovery // Dispersal|GRN +1 Dismember|MM2 +1 Doom Whisperer|GRN +1 Dragonlord Silumgar|DTK +1 Dragonskull Summit|XLN +1 Drawn from Dreams|M20 +1 Dread Wanderer|AKH +1 Dreadbore|GK2 +1 Dreadhorde Arcanist|WAR +1 Dreadship Reef|CM2 +1 Dream Halls|TPR +1 Dreamstealer|HOU +1 Drill Bit|RNA +1 Drowned Catacomb|XLN +1 Duplicant|C18 +1 Duress|M20 +1 Earthshaker Khenra|HOU +1 Echo of Eons|MH1 +1 Eidolon of the Great Revel|A25 +1 Eldrazi Obligator|OGW +1 Eldrazi Temple|DDP +1 Electrodominance|RNA +1 Electrolyze|GK1 +1 Empty the Warrens|DDS +1 Emrakul, the Aeons Torn|ROE +1 Emrakul, the Promised End|EMN +1 Enclave Cryptologist|ROE +1 Endbringer|OGW +1 Entomb|UMA +1 Epochrasite|CM2 +1 Erebos, God of the Dead|THS +1 Everflowing Chalice|CM2 +1 Exhume|TD2 +1 Expansion // Explosion|GRN +1 Experimental Frenzy|GRN +1 Fact or Fiction|MH1 +1 Faithless Looting|UMA +1 Falkenrath Aristocrat|MM3 +1 Falkenrath Gorger|SOI +1 Fatal Push|AER +1 Fellwar Stone|CM2 +1 Fetid Pools|AKH +1 Fiery Confluence|CM2 +1 Fiery Islet|MH1 +1 Figure of Destiny|DDL +1 Filigree Familiar|GNT +1 Finale of Eternity|WAR +1 Finale of Promise|WAR +1 Finale of Revelation|WAR +1 Fire // Ice|UMA +1 Fire Diamond|CM2 +1 Fireblast|JVC +1 Firebolt|MH1 +1 Firemind Vessel|WAR +1 Flame Slash|CN2 +1 Flusterstorm|MH1 +1 Forbid|EXO +1 Force of Negation|MH1 +1 Force of Will|EMA +1 Force Spike|ME3 +1 Forked Bolt|ROE +1 Frantic Search|ULG +1 Frost Titan|C14 +1 Fulminator Mage|SHM +1 Future Sight|MH1 +1 Gatekeeper of Malakir|ZEN +1 Geralf's Messenger|DKA +1 Gifted Aetherborn|AER +1 Gilded Lotus|DOM +1 Gitaxian Probe|NPH +1 Glen Elendra Archmage|UMA +1 Glint-Nest Crane|KLD +1 Glorybringer|AKH +1 Go for the Throat|C17 +1 Goblin Bombardment|TPR +1 Goblin Bushwhacker|ZEN +1 Goblin Chainwhirler|DOM +1 Goblin Cratermaker|GRN +1 Goblin Dark-Dwellers|OGW +1 Goblin Electromancer|GRN +1 Goblin Engineer|MH1 +1 Goblin Guide|ZEN +1 Goblin Rabblemaster|M15 +1 Goblin Ruinblaster|ZEN +1 Goblin Welder|CM2 +1 God-Eternal Kefnet|WAR +1 Gonti, Lord of Luxury|KLD +1 Goryo's Vengeance|UMA +1 Grand Architect|TD2 +1 Grave Titan|M11 +1 Gravecrawler|DKA +1 Graven Cairns|FUT +1 Gray Merchant of Asphodel|THS +1 Great Furnace|MRD +1 Greater Gargadon|MMA +1 Grim Lavamancer|E01 +1 Grim Monolith|ULG +1 Griselbrand|MM3 +1 Guardian Idol|IMA +1 Gutterbones|RNA +1 Hangarback Walker|ORI +1 Harbinger of the Tides|DDT +1 Hazoret the Fervent|AKH +1 Heart of Kiran|AER +1 Hedron Archive|C18 +1 Hellrider|DKA +1 Hero's Downfall|THS +1 High Tide|VMA +1 Hordeling Outburst|A25 +1 Hostage Taker|XLN +1 Hour of Devastation|HOU +1 Hydroblast|EMA +1 Hymn to Tourach|EMA +1 Hypnotic Specter|M10 +1 Ichor Wellspring|MBS +1 Ilharg, the Raze-Boar|WAR +1 Imperial Seal|ME2 +1 Impulse|BBD +1 Inferno Titan|M12 +1 Inkwell Leviathan|CFX +1 Innocent Blood|DDR +1 Inquisition of Kozilek|CN2 +1 Intuition|TPR +1 Ionize|GRN +1 Izzet Charm|DDJ +1 Izzet Signet|DDJ +1 Jace Beleren|SS1 +1 Jace, Architect of Thought|DDM +1 Jace, the Mind Sculptor|VMA +1 Jace, Vryn's Prodigy|ORI +1 Judith, the Scourge Diva|RNA +1 Kalitas, Traitor of Ghet|OGW +1 Kari Zev, Skyship Raider|AER +1 Karn Liberated|NPH +1 Karn, Scion of Urza|DOM +1 Keranos, God of Storms|JOU +1 Kess, Dissident Mage|MH1 +1 Kitesail Freebooter|XLN +1 Knight of the Ebon Legion|M20 +1 Kolaghan's Command|DTK +1 Koth of the Hammer|DDI +1 Kozilek's Return|OGW +1 Kozilek, Butcher of Truth|UMA +1 Kuldotha Forgemaster|TD2 +1 Languish|GNT +1 Lashwrithe|C14 +1 Lavaclaw Reaches|UMA +1 Legion Warboss|GRN +1 Light Up the Stage|RNA +1 Lightning Bolt|LEA +1 Lightning Greaves|CM2 +1 Lightning Mauler|AVR +1 Liliana of the Veil|UMA +1 Liliana's Triumph|WAR +1 Liliana, Death's Majesty|AKH +1 Liliana, Dreadhorde General|WAR +1 Liliana, Heretical Healer|V17 +1 Liliana, the Last Hope|EMN +1 Lion's Eye Diamond|VMA +1 Lodestone Golem|MM2 +1 Looter il-Kor|TSP +1 Lotus Bloom|TSP +1 Lotus Petal|TMP +1 Magma Jet|JVC +1 Magus of the Wheel|A25 +1 Magus of the Will|C16 +1 Makeshift Mannequin|LRW +1 Man-o'-War|EMA +1 Mana Flare|MED +1 Mana Leak|IMA +1 Manamorphose|MMA +1 Manic Vandal|M12 +1 Manifold Key|M20 +1 Massacre Wurm|MBS +1 Master of Etherium|C16 +1 Master of Waves|DDT +1 Matter Reshaper|OGW +1 Memory Jar|VMA +1 Memory Lapse|EMA +1 Mesmeric Fiend|A25 +1 Metalworker|UDS +1 Meteor Golem|M20 +1 Midnight Reaper|GRN +1 Mind Stone|WTH +1 Mind's Desire|VMA +1 Mindslaver|MRD +1 Miscalculation|ULG +1 Mishra's Factory|A25 +1 Mission Briefing|GRN +1 Mizzium Mortars|GK1 +1 Mizzix's Mastery|PZ1 +1 Mogg War Marshal|EMA +1 Molten Rain|MM3 +1 Molten Slagheap|CMA +1 Moment of Craving|RIX +1 Monastery Swiftspear|IMA +1 Mox Diamond|TPR +1 Mox Opal|MM2 +1 Mu Yanling, Sky Dancer|M20 +1 Mulldrifter|MMA +1 Mutavault|M14 +1 Myr Battlesphere|C18 +1 Myriad Landscape|C14 +1 Mystic Confluence|BBD +1 Mystic Forge|M20 +1 Mystical Tutor|MIR +1 Narset, Parter of Veils|WAR +1 Necromancy|VIS +1 Negate|M20 +1 Never // Return|AKH +1 Nicol Bolas, Dragon-God|WAR +1 Nicol Bolas, Planeswalker|CFX +1 Nicol Bolas, the Ravager|M19 +1 Night's Whisper|EMA +1 Nightveil Specter|GK1 +1 Niv-Mizzet, Parun|GRN +1 Notion Thief|A25 +1 Noxious Gearhulk|KLD +1 Nykthos, Shrine to Nyx|THS +1 Oona's Prowler|LRW +1 Ophiomancer|C13 +1 Opt|DOM +1 Overmaster|TOR +1 Pack Rat|RTR +1 Painful Truths|BFZ +1 Palladium Myr|SOM +1 Peat Bog|MMQ +1 Pentad Prism|HOP +1 Phantasmal Image|MM3 +1 Phyrexian Arena|CN2 +1 Phyrexian Metamorph|NPH +1 Phyrexian Obliterator|A25 +1 Phyrexian Revoker|M15 +1 Pia and Kiran Nalaar|DDU +1 Pia Nalaar|KLD +1 Pilgrim's Eye|GNT +1 Pillage|MH1 +1 Pithing Needle|SOK +1 Plaguecrafter|GRN +1 Polluted Delta|EXP +1 Ponder|LRW +1 Precursor Golem|MM2 +1 Preordain|M11 +1 Priest of Forgotten Gods|RNA +1 Prismatic Lens|UMA +1 Prismatic Vista|MH1 +1 Prophetic Bolt|C15 +1 Pteramander|RNA +1 Putrid Imp|TOR +1 Pyretic Ritual|M11 +1 Pyroblast|EMA +1 Pyroclasm|A25 +1 Quicken|DDS +1 Rain of Filth|USG +1 Rakdos Cackler|GK2 +1 Rakdos Signet|GK2 +1 Rakdos's Return|GK2 +1 Ral Zarek|DGM +1 Ral's Outburst|WAR +1 Ral, Storm Conduit|WAR +1 Ramunap Ruins|HOU +1 Ravenous Chupacabra|A25 +1 Reality Smasher|OGW +1 Reanimate|UMA +1 Reckless Bushwhacker|OGW +1 Recurring Nightmare|TPR +1 Rekindling Phoenix|RIX +1 Release the Gremlins|AER +1 Relentless Dead|SOI +1 Relic of Progenitus|EMA +1 Remand|MM2 +1 Repeal|IMA +1 Riftwing Cloudskate|MMA +1 Rishadan Port|A25 +1 Risk Factor|GRN +1 Rite of Flame|CSP +1 Rix Maadi Reveler|RNA +1 Ruinous Path|C18 +1 Runaway Steam-Kin|GRN +1 Saheeli, Sublime Artificer|WAR +1 Sandstone Needle|MMQ +1 Saprazzan Skerry|MMQ +1 Sarkhan the Masterless|WAR +1 Scalding Tarn|ZEN +1 Scavenger Grounds|HOU +1 Scheming Symmetry|M20 +1 Scrapheap Scrounger|KLD +1 Scroll Rack|TMP +1 Search for Azcanta|XLN +1 Seasoned Pyromancer|MH1 +1 Seat of the Synod|C18 +1 Seething Song|DDG +1 Sensei's Divining Top|EMA +1 Sentinel Tower|BBD +1 Serum Visions|5DN +1 Shallow Grave|MIR +1 Shelldock Isle|LRW +1 Sheoldred, Whispering One|IMA +1 Shivan Reef|DDU +1 Show and Tell|CN2 +1 Shrine of Burning Rage|NPH +1 Siege-Gang Commander|GNT +1 Silumgar's Command|C17 +1 Simian Spirit Guide|A25 +1 Sire of Insanity|DGM +1 Skullclamp|C17 +1 Sky Diamond|C14 +1 Slavering Nulls|DDH +1 Sling-Gang Lieutenant|MH1 +1 Smokestack|V14 +1 Smoldering Marsh|EXP +1 Smuggler's Copter|KLD +1 Snapcaster Mage|UMA +1 Sneak Attack|EMA +1 Solemn Simulacrum|MRD +1 Sorcerous Spyglass|XLN +1 Spell Pierce|XLN +1 Spellseeker|BBD +1 Spellskite|MM2 +1 Spire of Industry|AER +1 Spirebluff Canal|KLD +1 Staff of Nin|CM2 +1 Star Compass|IMA +1 Steam Vents|GPT +1 Steel Hellkite|C18 +1 Stoke the Flames|M15 +1 Stormblood Berserker|M12 +1 Stratus Dancer|DTK +1 Strip Mine|EXP +1 Stromkirk Noble|ISD +1 Sulfur Falls|DOM +1 Sulfuric Vortex|EMA +1 Sulfurous Springs|ICE +1 Sundering Titan|ARC +1 Sunken Hollow|BFZ +1 Sunken Ruins|SHM +1 Supreme Will|HOU +1 Sweltering Suns|AKH +1 Sword of Fire and Ice|MMA +1 Sword of Sinew and Steel|MH1 +1 Sygg, River Cutthroat|SHM +1 Talisman of Creativity|MH1 +1 Talisman of Dominance|E01 +1 Talisman of Indulgence|MRD +1 Talrand, Sky Summoner|UMA +1 Tamiyo, the Moon Sage|AVR +1 Tangle Wire|V13 +1 Tectonic Edge|WWK +1 Teferi, Mage of Zhalfir|IMA +1 Tempest Djinn|DOM +1 Temple of Deceit|THS +1 Temple of Epiphany|M20 +1 Temple of Malice|BNG +1 Tendrils of Agony|VMA +1 Terminate|C17 +1 Tezzeret the Seeker|ALA +1 Tezzeret, Agent of Bolas|MBS +1 Thassa, God of the Sea|THS +1 The Antiquities War|DOM +1 The Elderspell|WAR +1 The Eldest Reborn|DOM +1 The Scarab God|HOU +1 Theater of Horrors|RNA +1 Thief of Sanity|GRN +1 Thing in the Ice|SOI +1 Thirst for Knowledge|C18 +1 Thought Erasure|GRN +1 Thought Vessel|CM2 +1 Thought-Knot Seer|OGW +1 Thoughtseize|IMA +1 Thousand-Year Storm|GRN +1 Thran Dynamo|IMA +1 Through the Breach|UMA +1 Thundermaw Hellkite|IMA +1 Tidespout Tyrant|BBD +1 Time Spiral|USG +1 Time Warp|E02 +1 Timetwister|VMA +1 To the Slaughter|SOI +1 Tolarian Academy|VMA +1 Torrential Gearhulk|KLD +1 Toxic Deluge|EMA +1 Trash for Treasure|C16 +1 Treachery|UDS +1 Treasure Cruise|UMA +1 Treasure Map|XLN +1 Trinket Mage|DDU +1 True-Name Nemesis|BBD +1 Turnabout|VMA +1 Tyrant's Scorn|WAR +1 Ugin, the Ineffable|WAR +1 Ugin, the Spirit Dragon|FRF +1 Ulamog, the Ceaseless Hunger|BFZ +1 Ultimate Price|GK2 +1 Umezawa's Jitte|V16 +1 Underground River|CM2 +1 Underground Sea|VMA +1 Undermine|DDH +1 Upheaval|V14 +1 Urborg, Tomb of Yawgmoth|UMA +1 Urza, Lord High Artificer|MH1 +1 Vampire Hexmage|CNS +1 Vampire Nighthawk|C17 +1 Vampiric Tutor|EMA +1 Vault of Whispers|HOP +1 Vedalken Shackles|5DN +1 Vendilion Clique|A25 +1 Venser, Shaper Savant|MM3 +1 Viashino Pyromancer|M19 +1 Vilis, Broker of Blood|M20 +1 Volcanic Island|LEB +1 Volrath's Stronghold|TPR +1 Vraska's Contempt|XLN +1 Walking Ballista|AER +1 Wandering Fumarole|OGW +1 Wasteland|EMA +1 Watery Grave|GRN +1 Wayfarer's Bauble|CM2 +1 Wheel of Fortune|VMA +1 Whirler Rogue|GNT +1 Wildfire|MM2 +1 Winter Orb|EMA +1 Worn Powerstone|EMA +1 Wretched Confluence|CMA +1 Wurmcoil Engine|CM2 +1 Yawgmoth's Will|VMA +1 Yawgmoth, Thran Physician|MH1 +1 Young Pyromancer|UMA +1 Zealous Conscripts|MM3 +1 Zulaport Cutthroat|GNT +1 Zurgo Bellstriker|DTK diff --git a/forge-gui/res/deckgendecks/Commander.dat b/forge-gui/res/deckgendecks/Commander.dat index 902522e5612..dd6afe4308a 100644 Binary files a/forge-gui/res/deckgendecks/Commander.dat and b/forge-gui/res/deckgendecks/Commander.dat differ diff --git a/forge-gui/res/deckgendecks/Oathbreaker.dat b/forge-gui/res/deckgendecks/Oathbreaker.dat new file mode 100644 index 00000000000..6ecd6a9e84a Binary files /dev/null and b/forge-gui/res/deckgendecks/Oathbreaker.dat differ diff --git a/forge-gui/res/deckgendecks/Standard.lda.dat b/forge-gui/res/deckgendecks/Standard.lda.dat index 65fa3aa9f50..e5487bcf6bd 100644 Binary files a/forge-gui/res/deckgendecks/Standard.lda.dat and b/forge-gui/res/deckgendecks/Standard.lda.dat differ diff --git a/forge-gui/res/deckgendecks/Standard.raw.dat b/forge-gui/res/deckgendecks/Standard.raw.dat index 663154bac63..cf78609fe0a 100644 Binary files a/forge-gui/res/deckgendecks/Standard.raw.dat and b/forge-gui/res/deckgendecks/Standard.raw.dat differ diff --git a/forge-gui/res/draft/Ryan Overturf's Grixis Cube (MTGO).draft b/forge-gui/res/draft/Ryan Overturf's Grixis Cube (MTGO).draft new file mode 100644 index 00000000000..b05bd980243 --- /dev/null +++ b/forge-gui/res/draft/Ryan Overturf's Grixis Cube (MTGO).draft @@ -0,0 +1,6 @@ +Name:Ryan Overturf's Grixis Cube (MTGO) +DeckFile:Ryan Overturf's Grixis Cube (MTGO) +Singleton:True + +Booster: 15 Any +NumPacks: 3 diff --git a/forge-gui/res/formats/Sanctioned/Modern.txt b/forge-gui/res/formats/Sanctioned/Modern.txt index f7be8d3870a..df29bc5345f 100644 --- a/forge-gui/res/formats/Sanctioned/Modern.txt +++ b/forge-gui/res/formats/Sanctioned/Modern.txt @@ -4,4 +4,4 @@ Order:102 Subtype:Modern Type:Sanctioned Sets:8ED, MRD, DST, 5DN, CHK, BOK, SOK, 9ED, RAV, GPT, DIS, CSP, TSP, TSB, PLC, FUT, 10E, LRW, EVE, SHM, MOR, ALA, CFX, ARB, M10, ZEN, WWK, ROE, M11, SOM, MBS, NPH, M12, ISD, DKA, AVR, M13, RTR, GTC, DGM, M14, THS, BNG, JOU, M15, KTK, FRF, DTK, MM2, ORI, BFZ, OGW, SOI, EMN, KLD, AER, AKH, W17, HOU, XLN, RIX, DOM, M19, G18, GRN, RNA, WAR, MH1, M20 -Banned:Ancient Den; Birthing Pod; Blazing Shoal; Bridge From Below; Chrome Mox; Cloudpost; Dark Depths; Deathrite Shaman; Dig Through Time; Dread Return; Eye of Ugin; Gitaxian Probe; Glimpse of Nature; Golgari Grave-Troll; Great Furnace; Green Sun's Zenith; Hypergenesis; Krark-Clan Ironworks; Mental Misstep; Ponder; Preordain; Punishing Fire; Rite of Flame; Seat of the Synod; Second Sunrise; Seething Song; Sensei's Divining Top; Skullclamp; Splinter Twin; Stoneforge Mystic; Summer Bloom; Treasure Cruise; Tree of Tales; Umezawa's Jitte; Vault of Whispers +Banned:Ancient Den; Birthing Pod; Blazing Shoal; Bridge From Below; Chrome Mox; Cloudpost; Dark Depths; Deathrite Shaman; Dig Through Time; Dread Return; Eye of Ugin; Faithless Looting; Gitaxian Probe; Glimpse of Nature; Golgari Grave-Troll; Great Furnace; Green Sun's Zenith; Hogaak, Arisen Necropolis; Hypergenesis; Krark-Clan Ironworks; Mental Misstep; Ponder; Preordain; Punishing Fire; Rite of Flame; Seat of the Synod; Second Sunrise; Seething Song; Sensei's Divining Top; Skullclamp; Splinter Twin; Summer Bloom; Treasure Cruise; Tree of Tales; Umezawa's Jitte; Vault of Whispers diff --git a/forge-gui/res/formats/Sanctioned/Standard.txt b/forge-gui/res/formats/Sanctioned/Standard.txt index 8997b52a7c8..b0be1c482f3 100644 --- a/forge-gui/res/formats/Sanctioned/Standard.txt +++ b/forge-gui/res/formats/Sanctioned/Standard.txt @@ -4,4 +4,4 @@ Order:101 Subtype:Standard Type:Sanctioned Sets:XLN, RIX, DOM, M19, G18, GRN, RNA, WAR, M20 -Banned: Rampaging Ferocidon +Banned: diff --git a/forge-gui/res/formats/Sanctioned/Vintage.txt b/forge-gui/res/formats/Sanctioned/Vintage.txt index f7dc5c7c4c8..8d31690ff2d 100644 --- a/forge-gui/res/formats/Sanctioned/Vintage.txt +++ b/forge-gui/res/formats/Sanctioned/Vintage.txt @@ -4,5 +4,5 @@ Order:104 Subtype:Vintage Type:Sanctioned Banned:Adriana's Valor; Advantageous Proclamation; Assemble the Rank and Vile; Backup Plan; Brago's Favor; Double Stroke; Echoing Boon; Emissary's Ploy; Hired Heist; Hold the Perimeter; Hymn of the Wilds; Immediate Action; Incendiary Dissent; Iterative Analysis; Muzzio's Preparations; Natural Unity; Power Play; Secret Summoning; Secrets of Paradise; Sentinel Dispatch; Sovereign's Realm; Summoner's Bond; Unexpected Potential; Weight Advantage; Worldknit; Amulet of Quoz; Bronze Tablet; Contract from Below; Darkpact; Demonic Attorney; Jeweled Bird; Rebirth; Tempest Efreet; Timmerian Fiends; Chaos Orb; Falling Star; Shahrazad -Restricted:Ancestral Recall; Balance; Black Lotus; Brainstorm; Chalice of the Void; Channel; Demonic Consultation; Demonic Tutor; Dig Through Time; Fastbond; Flash; Gitaxian Probe; Gush; Imperial Seal; Library of Alexandria; Lion's Eye Diamond; Lodestone Golem; Lotus Petal; Mana Crypt; Mana Vault; Memory Jar; Merchant Scroll; Mind's Desire; Monastery Mentor; Mox Emerald; Mox Jet; Mox Pearl; Mox Ruby; Mox Sapphire; Mystical Tutor; Necropotence; Ponder; Sol Ring; Strip Mine; Thorn of Amethyst; Time Vault; Time Walk; Timetwister; Tinker; Tolarian Academy; Treasure Cruise; Trinisphere; Vampiric Tutor; Wheel of Fortune; Windfall; Yawgmoth's Will +Restricted:Ancestral Recall; Balance; Black Lotus; Brainstorm; Chalice of the Void; Channel; Demonic Consultation; Demonic Tutor; Dig Through Time; Flash; Gitaxian Probe; Golgari Grave-Troll; Gush; Imperial Seal; Karn, the Great Creator; Library of Alexandria; Lion's Eye Diamond; Lodestone Golem; Lotus Petal; Mana Crypt; Mana Vault; Memory Jar; Mental Misstep; Merchant Scroll; Mind's Desire; Monastery Mentor; Mox Emerald; Mox Jet; Mox Pearl; Mox Ruby; Mox Sapphire; Mystic Forge; Mystical Tutor; Necropotence; Ponder; Sol Ring; Strip Mine; Thorn of Amethyst; Time Vault; Time Walk; Timetwister; Tinker; Tolarian Academy; Treasure Cruise; Trinisphere; Vampiric Tutor; Wheel of Fortune; Windfall; Yawgmoth's Will diff --git a/forge-gui/res/languages/zh-CN.properties b/forge-gui/res/languages/zh-CN.properties new file mode 100644 index 00000000000..8f96e54bcac --- /dev/null +++ b/forge-gui/res/languages/zh-CN.properties @@ -0,0 +1,890 @@ +language.name=Chinese (ZH) +#SplashScreen.java +splash.loading.examining-cards=加载牌张,检查文件夹 +splash.loading.cards-folders=从文件夹加载牌张 +splash.loading.cards-archive=从存档中加载牌张 +splash.loading.decks=加载套牌 +splash.loading.processingimagesprites=处理精灵图 +#FControl.java +lblOpeningMainWindow=打开主窗口中 +lblCloseScreen=关闭屏幕 +txCloseAction1=Forge现在支持选项卡导航,可以轻松关闭和切换不同屏幕。因此,您不再需要使用右上角X按钮关闭当前屏幕并返回 +txCloseAction2=请选择右上角的X按钮选择接下来将要进行的操作。此选项保留给未来使用,您将不会再看到此消息,您可以随时在“首选项”中更改此行为 +titCloseAction=选择您的关闭行动 +lblAreYouSureYouWishRestartForge=你确定要重启Forge吗? +lblAreYouSureYouWishExitForge=你确定要退出Forge吗? +lblOneOrMoreGamesActive=一个或多个游戏正处于活动状态 +lblerrLoadingLayoutFile=无法读取您的布局文件:%s。按OK然后删除。\n游戏将以默认布局进行。 +lblLoadingQuest=加载时空竞逐中... +#FScreen.java +lblHome=主页 +lblWorkshop=作坊页面 +lblBacktoHome=回退到主页 +lblDeckEditor=套牌编辑器 +lblCloseEditor=关闭编辑器 +lblCommanderDeckEditor=指挥官套牌编辑器 +lblOathbreakerDeckEditor=破誓者套牌编辑器 +lblTinyLeadersDeckEditor=小指挥官套牌编辑器 +lblBrawlDeckEditor=争锋套牌编辑器 +lblDraftDeckEditor=轮抓套牌编辑器 +lblSealedDeckEditor=现开套牌编辑器 +lblTokenViewer=衍生物查看器 +lblCloseViewer=关闭查看器 +lblQuestDeckEditor=竞逐套牌编辑器 +lblQuestTournamentDeckEditor=竞逐比赛套牌编辑器 +lblSpellShop=轮替商店 +lblLeaveShop=离开商店 +lblLeaveDraft=离开轮抓 +lblBazaar=珍宝集市 +lblConcedeGame=认输这场游戏 +txerrFailedtodeletelayoutfile=删除布局文件失败。 +#VSubmenuPreferences.java +Preferences=偏好 +btnReset=重置到默认偏好 +btnDeleteMatchUI=重置匹配布局 +btnDeleteEditorUI=重置编辑器布局 +btnDeleteWorkshopUI=重置游戏界面 +btnUserProfileUI=打开用户目录 +btnContentDirectoryUI=打开内容目录 +btnResetJavaFutureCompatibilityWarnings=重置Java兼容性警告 +btnClearImageCache=清除图片缓存 +btnTokenPreviewer=衍生物预览器 +btnCopyToClipboard=复制到剪切板 +cbpSelectLanguage=语言 +nlSelectLanguage=选择语言(除了正在进行中的游戏)(需要重新启动) +cbRemoveSmall=删除小生物 +cbCardBased=包括基于单卡生成的套牌 +cbSingletons=单张模式 +cbRemoveArtifacts=删除神器 +cbAnte=赌博模式 +cbAnteMatchRarity=赌注稀有度匹配 +cbEnableAICheats=允许AI作弊 +cbManaBurn=法术力灼烧 +cbManaLostPrompt=提示法术力池将要清空 +cbDevMode=开发人员模式 +cbLoadCardsLazily=惰性加载卡牌脚本 +cbLoadHistoricFormats=加载史记赛制 +cbWorkshopSyntax=作坊语法检查 +cbEnforceDeckLegality=套牌一致性 +cbSideboardForAI=玩家为AI换备 +cbPerformanceMode=性能模式 +cbFilteredHands=手牌过滤 +cbImageFetcher=自动下载缺失的图片 +cbCloneImgSource=复制使用原始的图片 +cbScaleLarger=将图像缩放的更大 +cbRenderBlackCardBorders=渲染黑卡边框 +cbLargeCardViewers=使用大图查看器 +cbSmallDeckViewer=使用小套牌查看器 +cbDisplayFoil=显示闪卡 +cbRandomFoil=随机闪卡 +cbRandomArtInPools=在生成的卡池中随机加入闪卡 +cbEnableSounds=启用音效 +cbEnableMusic=启用背景音乐 +cbAltSoundSystem=使用备用音效系统 +cbUiForTouchScreen=触摸屏UI增强 +cbTimedTargOverlay=启用定位叠加优化 +cbCompactMainMenu=使用紧凑的主侧边栏菜单 +cbDetailedPaymentDesc=在付费提示中详细描述咒语 +cbPromptFreeBlocks=不阻塞句柄 +cbPauseWhileMinimized=暂停时最小化 +cbCompactPrompt=紧凑型提示 +cbEscapeEndsTurn=使用空格结束回合 +cbPreselectPrevAbOrder=预选能力的顺序 +cbHideReminderText=隐藏提示文字 +cbOpenPacksIndiv=逐个打开补充包 +cbTokensInSeparateRow=在单独一行中显示衍生物 +cbStackCreatures=堆叠生物 +cbFilterLandsByColorId=在启动式异能中按颜色筛选地 +cbShowStormCount=在提示窗中显示风暴计数 +cbRemindOnPriority=获得优先权时高亮提示 +cbUseSentry=自动提交错误报告 +cbpGameLogEntryType=游戏日志详细程度 +cbpCloseAction=关闭动作 +cbpDefaultFontSize=默认字体大小 +cbpAiProfiles=AI强度 +cbpDisplayCurrentCardColors=显示牌张颜色详情 +cbpAutoYieldMode=自动让过 +cbpCounterDisplayType=计数器显示类型 +cbpCounterDisplayLocation=计数器显示区域 +cbpGraveyardOrdering=允许指衍生物进入墓地 +Troubleshooting=故障排除 +GeneralConfiguration=常规配置 +lblPlayerName=玩家名称 +nlPlayerName=设置游戏中Forge将引用的名称 +nlCompactMainMenu=启用节省空间的侧边栏,一次只显示一个菜单组(需要重新启动)。 +nlUseSentry=启用后,会自动向开发人员提交错误报告。 +GamePlay=游戏 +nlpMulliganRule=选择调度规则 +nlpAiProfiles=选择你的AI对手 +nlAnte=确定游戏是否使用赌注 +nlAnteMatchRarity=尝试为所有玩家生成同稀有度赌注 +nlEnableAICheats=允许AI进行作弊以获得优势(对于已经设置了作弊洗牌的AI)。 +nlManaBurn=使用法术力灼烧(M10之前的规则) +nlManaLostPrompt=启用后,如果让过优先权会导致法术力池清空,你将收到一个警告提示。 +nlEnforceDeckLegality=强制每个与环境相关的套牌合法性(最小单卡数,最大单卡数等)。 +nlSideboardForAI=允许用户在构筑赛制中为AI换备牌。 +nlPerformanceMode=禁止其他静态能力检查以加速游戏引擎(警告:对手手牌有闪现单卡能使用时可能会跳过)。 +nlFilteredHands=生成两个起手并发给你最接近套牌地比例的起手(需要重启) +nlCloneImgSource=启用克隆的时候将使用原画而不是克隆牌的画 +nlPromptFreeBlocks=启用后如果你需要支付0来阻挡,则不会提示自动支付0。 +nlPauseWhileMinimized=启用后,Forge将在暂停时最小化(主要用于AI VS AI)。 +nlEscapeEndsTurn=启用后,空格键可以用于结束当前回合的替代按键。 +nlDetailedPaymentDesc=启用后,选择目标和支付费用的时候会显示详细的咒语/异能说明。 +nlShowStormCount=启用后,提示窗格将会显示当前的风暴计数 +nlRemindOnPriority=启用后,获得优先权时玩家区域将闪烁。 +nlPreselectPrevAbOrder=启用后,将预先将异能排序。 +nlpGraveyardOrdering=确定何时让玩家确定同时进入坟场的牌的顺序(最好只在关键操作时启用此选项,比如:瓦拉司的变形兽) +nlpAutoYieldMode=定义自动让过的详细程度(每个异能或者每张卡)。 +RandomDeckGeneration=生成随机套牌 +nlRemoveSmall=在生成的套牌中禁用1/1和0/X生物 +nlSingletons=禁止在生成的套牌中非地牌重复出现 +nlRemoveArtifacts=在生成的套牌中禁用神器牌 +nlCardBased=构建具有更多协同效应的套牌(需要重启) +DeckEditorOptions=套牌编辑器选项 +nlFilterLandsByColorId=当使用牌张颜色筛选器时,过滤地可以更容易找到产数相关法术力的地 +AdvancedSettings=高级设置 +nlDevMode=启用在开发期间进行测试的功能菜单 +nlWorkshopSyntax=在作坊中启用卡牌脚本检查。注意:该功能任在测试阶段。 +nlGameLogEntryType=更改游戏中日志显示的信息量。排序为最少到最详细。 +nlCloseAction=更改单击右上角X按钮时的行为 +nlLoadCardsLazily=如果打开该选项Forge将在使用到卡牌脚本时才加载(警告:实验状态)。 +nlLoadHistoricFormats=如果打开,Forge将加载史记赛制,这个能会导致游戏载入时间变长。 +GraphicOptions=图形选项 +nlDefaultFontSize=UI中字体的默认大小。所有字体元素都相对于此缩放。(需要重启) +cbpMulliganRule = 调度规则 +nlImageFetcher=允许从在线资源中实时获取缺失的图片 +nlDisplayFoil=显示闪卡 +nlRandomFoil=随机将牌设置为闪卡 +nlScaleLarger=允许卡牌图片缩放为初始大小 +nlRenderBlackCardBorders=为牌周围渲染黑色边框 +nlLargeCardViewers=是所有牌看起来更大以便高分辨率图片看起来更舒适,不适合低分辨率设备使用 +nlSmallDeckViewer=将套牌查看器设置为800X600而不是按屏幕大小等比缩放 +nlRandomArtInPools=限制赛生成的卡池中带有闪卡。 +nlUiForTouchScreen=增加一些UI元素以提高触屏体验(需要重启)。 +nlCompactPrompt=隐藏标题并在“提示”窗格中使用较小的字体使其更紧凑。 +nlHideReminderText=在“卡牌详情“窗格中隐藏提醒文本 +nlOpenPacksIndiv=打开肥包或者补充盒的时候一包一包开。 +nlTokensInSeparateRow=生物与衍生物分不同的行显示。 +nlStackCreatures=在战场上如同地、神器、结界一般堆叠一样的生物。 +nlTimedTargOverlay=启用基于限制目标的覆盖优化以减少CPU使用率(仅在旧设备上需要使用,需要重启游戏)。 +nlCounterDisplayType=选择指示物的样式。基于文本还是基于图片还是二者混合。 +nlCounterDisplayLocation=确定牌张上指示物的位置:靠近底部还是顶部 +nlDisplayCurrentCardColors=在卡牌详情窗格中显示当前牌的颜色 +SoundOptions=声音选项 +nlEnableSounds=在游戏中启用声音效果 +nlEnableMusic=在游戏中启用背景音乐 +nlAltSoundSystem=使用备用音效系统(仅在声音消失的情况使用) +KeyboardShortcuts=键盘快捷键 +# VSubmenuAchievements.java +lblAchievements=成就 +# VSubmenuDownloaders.java +btnDownloadSetPics=下载低清系列图 +btnDownloadPicsHQ=下载高清卡图(这很慢!) +btnDownloadPics=下载低清卡图 +btnDownloadQuestImages=下载冒险图片 +btnDownloadAchievementImages=下载成就图片 +btnReportBug=报告错误 +btnListImageData=统计牌和图片数据 +lblListImageData=统计Forge实现且缺少的图片的牌 +btnImportPictures=导入数据 +btnHowToPlay=如何玩 +btnDownloadPrices=下载牌张价格 +btnLicensing=许可证详情 +lblDownloadPics=下载缺省牌的图片 +lblDownloadPicsHQ=下载缺省牌的高清图片 +lblDownloadSetPics=下载每张牌的图片(每张牌出现一次) +lblDownloadQuestImages=下载冒险之旅里使用的衍生物与图标 +lblDownloadAchievementImages=下载成就图片,让你的奖杯更引人注目。 +lblDownloadPrices=下载卡牌商店最新的价格表 +lblYourVersionOfJavaIsTooOld=你的Java版本太旧无法开始下载内容 +lblPleaseUpdateToTheLatestVersionOfJava=请更新到最新版本的JRE +lblYoureRunning=你在运行 +lblYouNeedAtLeastJavaVersion=您的JRE版本至少需要为1.8.0_101。 +lblImportPictures=从本地目录导入数据 +lblReportBug=什么东西坏了? +lblHowToPlay=游戏规则。 +lblLicensing=Forge合法性。 +ContentDownloaders=内容下载 +ReleaseNotes=发布说明 +# CSubmenuPreferences.java +CantChangeDevModeWhileNetworkMath=网络匹配时无法更改开发模式 +CompatibilityWarningsReEnabled=兼容性警告重新启用 +AresetForgeSettingsToDefault=这将把所有首选项设置为默认并重新启动Forge。\n\n重置并重启Forge? +TresetForgeSettingsToDefault=重置设置 +AresetDeckEditorLayout=这将重置套牌编辑器布局。\n所有选项卡将恢复到其默认位置。\n\n重置布局? +TresetDeckEditorLayout=重置套牌编辑器布局 +OKresetDeckEditorLayout=套牌编辑器布局已重置。 +AresetWorkshopLayout=这将重置游戏屏幕布局。\n所有选项卡将恢复至其默认位置。\n\n重置布局? +TresetWorkshopLayout=重置游戏界面 +OKresetWorkshopLayout=游戏界面已重置 +AresetMatchScreenLayout=这将重置匹配屏幕的布局。\n如果要保存当前的布局,请使用“匹配”屏幕中的“保存布局”选项。\n\n重置布局? +TresetMatchScreenLayout=重置匹配布局 +OKresetMatchScreenLayout=匹配布局已重置。 +#EMenuGroup.java +lblSanctionedFormats=单人游戏 +lblOnlineMultiplayer=多人联机 +lblQuestMode=冒险之旅 +lblPuzzleMode=谜题模式 +lblGauntlets=决斗之巅 +lblGameSettings=游戏设置 +#VLobby.java +lblHeaderConstructedMode=游戏模式:构筑 +lblGetNewRandomName=获取一个随机名称 +lbltypeofName=您想要生成什么类型的名称? +lblconfirmName=你想使用名称%s,还是想重试 +lblUseThisName=使用这个名称 +lblTryAgain=再试一次 +lblAddAPlayer=增加一个玩家 +lblVariants=变种 +lblRandom=随机 +#VSubmenuConstructed.java +lblConstructedMode=构筑模式 +lblConstructed=构筑 +#PlayerPanel.java +lblSelectaDeck=选择一个套牌 +lblSelectaSchemeDeck=选择一个套牌类型 +lblSchemeDeckEditor=套牌类型编辑器 +lblSelectaCommanderDeck=选择一个指挥官套牌 +lblSelectaPlanarDeck=选择一个时空竞逐套牌 +lblPlanarDeckEditor=时空竞逐套牌编辑器 +lblSelectaVanguardAvatar=选择一个先锋头像 +lblVanguardAvatar=先锋头像 +lblDeck=套牌 +lblSchemeDeck=魔王套牌 +lblCommanderDeck=指挥官套牌 +lblPlanarDeck=时空竞逐套牌 +lblVanguard=先锋 +lblHuman=人类 +lblAI=AI +lblOpen=打开 +lblUseSimulation=使用模拟 +lblGetaNewRandomName=获取一个新的随机名称 +lblArchenemy=魔王 +lblHeroes=英雄 +lblRemove=移除 +ttlblAvatar=左击:选择头像,右击:随机头像 +lblReady=准备好 +lblKick=踢 +lblReallyKick=准备好踢 %s? +#ForgeMenu.java +lblRestart=重启 +lblExit=退出 +#LayoutMenu.java +lblLayout=布局 +lblView=视图 +lblFile=文件 +lblTheme=主题 +lblBackgroundImage=背景图片 +lblPanelTabs=窗格表格 +lblSaveCurrentLayout=保存当前布局 +lblRefresh=刷新 +lblSetWindowSize=设置窗口大小 +lblChooseNewWindowSize=选择一个新的窗口大小 +lblFullScreen=全屏 +lblExitFullScreen=退出全屏 +#HelpMenu.java +lblHelp=帮助 +lblAboutForge=关于Forge +lblTroubleshooting=故障排除 +lblArticles=文章 +lblGettingStarted=如何开始 +lblHowtoPlay=如何玩 +lblForgeLicense=Forge许可证 +lblReleaseNotes=更新日志 +#GameMenu.java +lblGame=游戏 +lblSoundEffects=音效 +lblUndo=撤销 +lblAlphaStrike=先攻 +lblEndTurn=结束回合 +lblTargetingArcs=瞄准弧 +lblOff=关闭 +lblCardMouseOver=卡牌悬停 +lblAlwaysOn=总是打开 +lblAutoYields=自动让过 +lblDeckList=套牌列表 +lblClose=关闭 +lblExitForge=退出Forge +#ConstructedGameMenu.java +lblSelectAvatarFor=选择头像为%s +lblRemoveSmallCreatures=将1/1和0/X生物从生成套牌中移除。 +lblRemoveArtifacts=将神器从生成套牌中移除 +PreventNonLandDuplicates=防止生成套牌中出现重复的非地牌 +#PlayerPanel.java +lblName=名称 +lblTeam=团队 +#InputConfirmMulligan.java +lblKeep=保留 +lblYouAreGoingFirst=你先手 +lblIsGoingFirst=是先手 +lblYouAreGoing=你将 +lblMulligan=调度 +lblDoYouWantToKeepYourHand=你想保留这个手牌吗? +lblReturnForLondon=放回%n张牌到牌库底 +lblOk=确认 +lblReset=重置 +lblAuto=自动 +#VAssignDamage.java +lbLAssignDamageDealtBy=分配对%s造成的伤害 +lblLClickDamageMessage=左键单击:分配一点伤害。(左键加Ctrl):分配致命伤害。 +lblRClickDamageMessage=右键单击:取消分配一点伤害。(左键加Ctrl):取消分配的所有伤害 +lblTotalDamageText=可用的伤害值:未知 +lblAssignRemainingText=对受到致命伤害的对象分配过量的伤害 +lblLethal=致死 +#KeyboardShortcuts.java +lblSHORTCUT_SHOWSTACK=匹配:显示堆叠面板 +lblSHORTCUT_SHOWCOMBAT=匹配:显示战斗面板 +lblSHORTCUT_SHOWCONSOLE=匹配:显示控制台面板 +lblSHORTCUT_SHOWDEV=匹配:显示开发人员模式面板 +lblSHORTCUT_CONCEDE=匹配:认输 +lblSHORTCUT_ENDTURN=匹配:让过优先权直到回合结束或者下一个堆叠事件 +lblSHORTCUT_ALPHASTRIKE=匹配:先攻 +lblSHORTCUT_SHOWTARGETING=匹配:切换视觉叠加层 +lblSHORTCUT_AUTOYIELD_ALWAYS_YES=匹配:自动让过堆叠中的异能(所有都选是) +lblSHORTCUT_AUTOYIELD_ALWAYS_NO=匹配:自动让过堆叠中的异能(所有都选否) +lblSHORTCUT_MACRO_RECORD=匹配:记录操作宏的动作序列 +lblSHORTCUT_MACRO_NEXT_ACTION=匹配:在录制的宏中执行下一个操作 +lblSHORTCUT_CARD_ZOOM=匹配:缩放当前选定的图片 +#VSubmenuDraft.java +lblBoosterDraft=轮抓 +lblHeaderBoosterDraft=游戏模式:轮抓 +lblPlayAnOpponent=所有对手 +lblPlayAll7opponents=全部7个对手 +lblBuildorselectadeck=构建或选择一个套牌 +lblDraftText1=在轮抓模式中,三个补充包在8个玩家中传递 +lblDraftText2=从你选的牌中组一套牌。AI也会这样做 +lblDraftText3=然后对抗一个或多个AI对手 +lblNewBoosterDraftGame=新的补充包轮抓 +lblDraftDecks=轮抓套牌 +#CSubmenuDraft.java +lblNoDeckSelected=没有为人类选择套牌。\n(您可能要建立一个新的套牌) +lblNoDeck=没有套牌 +lblChooseDraftFormat=选择轮抓模式 +#VSubmenuSealed.java +lblSealedDeck=现开 +lblSealedDecks=现开套牌 +lblHeaderSealed=游戏模式:现开 +lblSealedText1=构建或选择一个套牌 +lblSealedText2=在现开模式中,您可以从补充包里(最多10个)构建一套牌 +lblSealedText3=从你得到的牌中组一套牌。AI也会这样做 +lblSealedText4=然后对抗一个或多个AI对手 +btnBuildNewSealedDeck=构建新的现开套牌 +#FDeckChooser.java +lblViewDeck=查看套牌 +lblRandomDeck=随机套牌 +lblRandomColors=随机颜色 +#GameType.java +lblSealed=现开 +lblDraft=轮抓 +lblWinston=温斯顿 +lblGauntlet=决斗 +lblTournament=锦标赛 +lblQuest=冒险 +lblQuestDraft=冒险轮抓 +lblPlanarConquest=时空竞逐征服 +lblPuzzle=谜题 +lblPuzzleDesc=从给定的游戏状态解谜 +lblDeckManager=套牌管理 +lblVanguardDesc=每个牌手在游戏中都有一个具有特殊能力的“Avatar”。 +lblCommander=指挥官 +lblCommanderDesc=每个玩家都有一张传奇牌,可以随时释放并以此确定套牌颜色 +lblOathbreaker=破誓者 +lblOathbreakerDesc=每个玩家都有一张鹏洛克牌作为他的“破誓者”,可以随时释放该鹏洛克并以此鹏洛克确定套牌的颜色。每个玩家还有一个“专属咒语”,当他们的“破誓者”在战场上时才能释放。 +lblTinyLeaders=小指挥官 +lblTinyLeadersDesc=每个玩家都有一张传奇牌,可以随时释放并以此确定套牌颜色,但每张牌的总法术力费用必须小于4 +lblBrawl=争锋 +lblBrawlDesc=每个玩家都有一张传奇牌,可以随时释放并以此确定套牌颜色,但牌池仅限于标准赛制 +lblPlaneswalker=时空幻境 +lblPlaneswalkerDesc=每个牌手都有一个随时可以释放的鹏洛客 +lblPlanechase=时空竞逐 +lblPlanechaseDesc=当玩家掷骰子到“时空牌”时,时空将改变。时空牌对全局生效。 +lblArchenemyDesc=一个玩家是魔王,使用阴谋牌与其他玩家对战 +lblArchenemyRumble=魔王混斗 +lblArchenemyRumbleDesc=每个玩家都是魔王,可以使用阴谋牌 +lblMomirBasic=莫秘维 +lblMomirBasicDesc=每位牌手使用由60基本地组成的套牌和Momir徽记。 +lblMoJhoSto=MoJhoSto +lblMoJhoStoDesc=每位牌手使用60基本地组成的套牌和Momir,Jhoira,Stonehewer徽记。 +#VSubmenuDuels.java +lblQuestDuels=探索决斗 +lblQuestModeDuels=冒险之旅:决斗 +lblSelectNextDuel=选择你将进行的下一场决斗 +lblNoDuelDeck=当前没有设置套牌 +lblNextChallengeNotYet=没有确定下次胜利后的挑战 +btnUnlockSets=解锁系列 +btnTravel=时空旅行 +btnBazaar=珍宝集市 +btnSpellShop=卡牌商店 +cbSummonPlant=召唤植物 +cbLaunchZeppelin=启动飞艇 +#VSubmenuQuest.java +lblQuestData=冒险之旅 +lblLoadQuestData=加载冒险之旅 +lblStartanewQuest=开始新的冒险之旅 +lblOldQuestData=冒险之旅?放入%s并重新启动Forge。 +rbEasy=简单 +rbMedium=中等 +rbHard=困难 +rbExpert=专家 +rbFantasyMode=幻想模式 +rbCommanderSubformat=指挥官模式 +lblStartingWorld=初始时空 +lblStartingPool=初始牌池 +lblAllCardsAvailable=所有牌都可用 +lblStarterEventdeck=初始/活动套牌 +lblSanctionedformat=合法赛制: +lblCustomdeck=自定义套牌 +lblDefineCustomFormat=定义自定义赛制 +lblSelectFormat=选择赛制 +lblStartWithAllCards=从所选系列的所有牌开始 +lblAllowDuplicateCards=允许重复的卡牌 +lblStartingPoolDistribution=初始牌池分配 +lblChooseDistribution=选择分配 +lblPrizedCards=奖励卡 +lblAllCardsAvailableWin=获胜将提供的的所有牌 +lblOnlySetsInStarting=只有初始池才可用 +lblAllowUnlockAdEd=允许解锁其他版本 +lblEmbark=开始! +lblboxCompleteSet=你将使用所选系列的每张卡中的4张开始探索 +lblboxAllowDuplicates=生成初始牌池时,可能包含重复的卡。 +lblSameAsStartingPool=与初始牌池相同 +lblNewLoadQuest=新建/载入 +#CSubmenuQChallenges.java +lblLaunchaZeppelin=启动一个飞艇. +lblPlant=植物 +lblChallenges=挑战 +lblMatchBestof=匹配-BO +lblDuels=决斗 +#CSubmenuQuestData.java +lblNotFormatDefined=你已经将自定义赛制设置为不包含任何系列。\n这将选择所有系列而不受限制为奖品。\n\n继续? +lbldckStartPool=你还没有选择一个套牌来开始。 +lblCannotStartaQuest=无法开始一个探索 +lblFromDeck=从套牌 +MsgQuestNewName=诗人会记住你的探索 +TitQuestNewName=探索名 +lblQuestNameEmpty=请指定探索名 +lblQuestExists=已存在具有该名称的探索。请选择一个其他探索名 +#CSubmenuQuestDecks.java +lblCreateaDeck=创建一个套牌 +#CSubmenuQuestPrefs.java +lblEnteraNumber=输入一个数 +lblSavefailed=保存错误 +#DialogChooseFormats.java +cbWantReprints=允许来自其他系列的重印牌 +lblChooseFormats=选择赛制 +lblSanctioned=合法 +lblOther=其他 +lblHistoric=十几 +lblCancel=取消 +#DialogChoosePoolDistribution.java +lblBlack=黑 +lblBlue=蓝 +lblGreen=绿 +lblRed=红 +lblWhite=白 +lblColorless=无色 +lblIncludeArtifacts=包含神器 +lblBalanced=均衡 +lblTrueRandom=随机 +lblSurpriseMe=惊喜 +lblBoosters=补充包 +lblClearAll=清除所有 +lblNumberofBoosters=补充包数量 +lblColors=颜色 +lblnoSettings=没有可用于此选择的设置 +lblDistribution=分配 +lblHoverforDescription=将鼠标悬停在每个选项上以获得更详细的说明 +lblradBalanced=“均衡”将在每种选定的颜色中提供数量均衡的卡牌。 +lblradRandom=“随机”将随机分配卡牌和颜色。 +lblradSurpriseMe=随机挑选颜色并提供数量均衡的随机卡牌。 +lblradBoosters=忽略所有颜色设置,从指定数量的补充包中生成牌池 +lblcbxArtifacts=选择后无论选择的颜色如何,神器都包涵在牌池中,这模拟了旧牌池的行为。 +#VSubmenuChallenges.java +lblQuestChallenges=冒险挑战 +htmlLaunchZeppelin=启动
飞艇 +lblQuestModeChallenges=冒险之旅:挑战 +lblWhichChallenge=你会尝试哪个挑战? +#VSubmenuQuestDraft.java +lblTournaments=锦标赛 +lblQuestModeDraftTournament=冒险之旅:轮抓锦标赛 +lblSelectaTournament=选择要加入的锦标赛 +lblNoTournaments=目前没有锦标赛 +btnEditDeck=编辑套牌 +btnLeaveTournament=离开锦标赛 +btnSpendToken=比赛门票 +btnStartMatchSmall=开始下一场比赛 +lblUndetermined=未确定 +btnSpendTokenTT=创建一个立即游戏的锦标赛 +lblPastResults=结果 +#VSubmenuQuestDecks.java +lblQuestDecks=套牌管理 +lblQuestDesc1=一开始你可以从有限的牌池中构建套牌。 +lblQuestDesc2=随着冒险之旅的进行,你的牌池逐渐增长,可以构建出更强的套牌。 +lblQuestDesc3=并且在与AI的决斗和挑战对抗中可以解锁更多牌。 +lblBuildaNewDeck=构建一个新套牌 +#Decktype.java +lblCustomUserDecks=自定义用户套牌 +lblConstructedDecks=构筑套牌 +lblCommanderDecks=指挥官套牌 +lblRandomCommanderDecks=随机指挥官套牌 +lblRandomCommanderCard-basedDecks=随机基本牌指挥官套牌 +lblOathbreakerDecks=破誓者套牌 +lblTinyLeadersDecks=小指挥官套牌 +lblBrawlDecks=争锋套牌 +lblSchemeDecks=魔王套牌 +lblPlanarDecks=时空竞逐套牌 +lblPreconstructedDecks=预组套牌 +lblQuestOpponentDecks=冒险之旅套牌 +lblRandomColorDecks=随机颜色套牌 +lblRandomStandardArchetypeDecks=随机标准原型套牌 +lblRandomModernArchetypeDecks=随机摩登原型套牌 +lblRandomLegacyArchetypeDecks=随机薪传原型套牌 +lblRandomVintageArchetypeDecks=随机特选原型套牌 +lblRandomStandardColorDecks=随机标准颜色套牌 +lblRandomModernColorDecks=随机摩登颜色套牌 +lblRandomThemeDecks=随机主题套牌 +lblRandomDecks=随机套牌 +lblNetDecks=网络套牌 +lblNetCommanderDecks=网络指挥官套牌 +#VSubmenuPuzzleSolve.java +lblSolve=解谜 +lblPuzzleModeSolve=谜题模式:解谜 +#VSubmenuPuzzleCreate.java +lblPuzzleModeCreate=谜题模式:创建 +lblCreate=创建 +#VSubmenuGauntletLoad.java +lblQuickGauntlets=快速决斗 +lblQuickGauntlet=快速决斗 +lblLoadGauntlet=载入决斗场 +lblLoadaGauntlet=载入决斗场 +lblLoadaPreviousGauntlet=载入决斗场(使用起始套牌) +#VSubmenuGauntletQuick.java +lblQuickGauntletBuilder=快速进入决斗 +lblDecklistDesc=双击一个非随机套牌作为套牌列表 +lblOptions=选项 +lblMatchesperGauntlet=匹配每场决斗 +lblAllowedDeckTypes=允许的套牌类型 +lblAutosaveInf=生成一个新的决斗场。可以在“载入决斗场”中选择。 +#VSubmenuGauntletContests.java +lblGauntletContests=天命战场 +lblPickaContest=选择一个决斗场 +lblGauntletStartedDesc=使用一个套牌直到战胜所有决斗者。 +#VSubmenuGauntletBuild.java +lblGauntletBuilder=新建决斗场 +lblGauntletDesc1=左/右方向键添加或者删除套牌 +lblGauntletDesc2=上/下箭头改变对手的顺序 +lblDecklist=双击一个非随机套牌作为套牌列表 +btnUp=将这个套牌在决斗中向上移动 +btnDown=将这个套牌在决斗中向下移动 +btnRight=添加套牌至决斗 +btnLeft=将套牌从决斗中移除 +btnSaveGauntlet=保存这个决斗 +btnNewGauntlet=构建一个新的决斗 +btnLoadaGauntlet=载入决斗场 +lblGauntletName=决斗名 +lblBuildAGauntlet=新建决斗场 +lblSave=变更没有保存 +#QuestUtil.java +lblTravelBetweenWorlds=在时空旅行 +lblWhereDoYouWishToTravel=你想去哪里旅行? +lblUncompleteChallengesWarning=警告:未完成挑战 +lblUncompleteChallengesDesc=你当前的时空有未完成的挑战。如果你现在离开,他们将会失败!\n你确定要离开吗?\n(选“否”返回并完成当前的时空挑战。) +lblDontSummonAPet=不要召唤宠物 +lblSummon=召唤%n +lblMatchBestOf1=匹配-BO1 +lblMatchBestOf3=匹配-BO3 +lblMatchBestOf5=匹配-BO5 +lblCredits=积分 +lblLife=生命 +lblWins=胜利 +lblLosses=失败 +lblWorld=时空 +lblNone=没有 +lblnextChallengeInWins0=你的战绩已被注意到。对手挑战了你。 +lblnextChallengeInWins1=赢得1场胜利后,将面临新的挑战。 +lblnextChallengeInWins2=赢得%n场胜利后,将面临新的挑战。 +lblWinStreak=连胜 +lblBest=最好 +lblBuildAndSelectaDeck=构建,然后在“冒险套牌”子菜单中选择一个套牌。 +lblCurrentDeck=你现在的套牌是%n +PleaseCreateAQuestBefore=请在%n之前创建套牌。 +lblNoQuest=没有探索 +lblVisitTheSpellShop=参观卡牌商店 +lblVisitTheBazaar=参观珍宝集市 +lblUnlockEditions=解锁新的时空 +lblUnlocked=你已经成功解锁%n +titleUnlocked=%n解锁! +lblStartADuel=开始决斗! +lblSelectAQuestDeck=请选择一个冒险套牌。 +lblInvalidDeck=错误的套牌 +lblInvalidDeckDesc=您的套牌%n请编辑或者选择其他套牌 +#VSubmenuQuestPrefs.java +lblQuestPreferences=冒险偏好 +lblRewardsError=奖励错误 +lblDifficultyError=难度错误 +lblBoosterError=补充包错误 +lblShopError=商店错误 +lblDraftTournamentsError=轮抓锦标赛错误 +lblRewards=奖励 +lblBoosterPackRatios=补充包比例 +lblDifficultyAdjustments=挑战难度 +lblShopPreferences=商店偏好 +lblDraftTournaments=轮抓锦标赛 +lblBaseWinnings=基本胜利 +lblNoLosses=没有损失 +lblPoisonWin=侵染胜利 +lblMillingWin=磨牌胜利 +lblMulligan0Win=调度到0胜利 +lblAlternativeWin=特殊胜利 +lblBonusMultiplierperWin=每赢一次奖金加倍 +ttBonusMultiplierperWin=赢得比赛后每次胜利奖金都会增加。 +lblMaxWinsforMultiplier=最大胜利倍数 +ttMaxWinsforMultiplier=获得这么多胜利后奖励会停止。 +lblWinbyTurn15=15回合内胜利 +lblWinbyTurn10=10回合内胜利 +lblWinbyTurn5=5回合内胜利 +lblFirstTurnWin=第一回合胜利 +lblMaxLifeDiffBonus=最大生命值差。奖金 +lblEasy=简单 +lblMedium=中等 +lblHard=难 +lblExpert=专家 +lblWinsforBooster=获得补充包所需的胜利 +lblWinsforRankIncrease=排名增加所需的胜利 +lblWinsforMediumAI=匹配中等难度AI所需的胜利 +lblWinsforHardAI=匹配困难难度AI所需的胜利 +lblWinsforExpertAI=匹配专家难度AI所需的胜利 +lblStartingCommons=初始铁 +lblStartingUncommons=初始银 +lblStartingRares=初始金 +lblStartingCredits=初始积分 +lblWinsforNewChallenge=新挑战所需的胜利 +lblStartingSnowLands=初始雪境地 +lblColorBias=颜色偏差(1-100%) +ttColorBias=初始卡池中您选择的颜色的百分比 +lblPenaltyforLoss=失败补偿 +lblMoreDuelChoices=更多决斗选择 +lblCommon=铁 +lblUncommon=银 +lblRare=金 +lblSpecialBoosters=特殊补充包 +ttSpecialBoosters=允许特定颜色补充包出现在商店并作为匹配奖励。 +lblMaximumPacks=最多补充包 +lblMinimumPacks=最少补充包 +lblStartingPacks=初始包 +lblWinsforPack=胜利奖励包 +lblWinsperSetUnlock=胜利解锁系列 +lblAllowFarUnlocks=允许远解锁 +lblUnlockDistanceMultiplier=解锁距离倍数 +lblCommonSingles=单张铁 +lblUncommonSingles=单张银 +lblRareSingles=单张金 +lblCardSalePercentageBase=出售牌的系数 +lblCardSalePercentageCap=出售牌的系数上限 +lblCardSalePriceCap=出售牌的价格上限 +lblWinstoUncapSalePrice=胜利解锁价格系数 +lblPlaysetSize=玩家收藏大小 +ttPlaysetSize=在售卖卡牌时要保留的卡牌数量 +lblPlaysetSizeBasicLand=玩家收藏大小:基本地 +ttPlaysetSizeBasicLand=在售卖卡牌时要保留的基本地数量 +lblPlaysetSizeAnyNumber=玩家收藏大小:任意数量 +ttPlaysetSizeAnyNumber=售卖卡牌时不保留卡牌 +lblItemLevelRestriction=物品等级限制 +lblFoilfilterAlwaysOn=闪卡过滤器始终开启 +lblRatingsfilterAlwaysOn=评级过滤器始终开启。 +lblSimulateAIvsAIResults=模拟AI VS AI的结果。 +ttSimulateAIvsAIResults=如果设置为1,则不会播放AI VS AI的轮抓。而是快速确定其对局结果。 +lblWinsforNewDraft=新轮抓所需的胜利 +lblWinsperDraftRotation=每次轮抓胜利轮替 +ttWinsperDraftRotation=如果轮抓没有赢这么多场,那么它将被删除或者替换。 +lblRotationType=轮替类型 +ttRotationType=如果设置为0,旧系列消失,如果设置为1,则用不同系列替换。 +#StatTypeFilter.java +lblclicktotoogle=单击以切换筛选器,右键单机以仅显示 +#SItemManagerUtil.java +lblWhitecards=白色牌 +lblBluecards=蓝色牌 +lblBlackcards=黑色牌 +lblRedcards=红色牌 +lblGreencards=绿色牌 +lblColorlesscards=无色牌 +lblMulticolorcards=多色牌 +lblPackordeck=卡包和预组套牌 +lblLands=地 +lblArtifacts=神器 +lblCreatures=生物 +lblEnchantments=结界 +lblPlaneswalkers=鹏洛客 +lblInstants=瞬间 +lblSorceries=法术 +lblCCMC0=法术力费用为0的牌 +lblCCMC1=法术力费用为1的牌 +lblCCMC2=法术力费用为2的牌 +lblCCMC3=法术力费用为3的牌 +lblCCMC4=法术力费用为4的牌 +lblCCMC5=法术力费用为5的牌 +lblCCMC6orMore=法术力费用为6+的牌 +lblWhitedecks=白色套牌 +lblBluedecks=蓝色套牌 +lblBlackdecks=黑色套牌 +lblReddecks=红色套牌 +lblGreendecks=绿色套牌 +lblColorlessdecks=无色套牌 +lblMulticolordecks=多色套牌 +lblOldstyleFoilcards=旧风格闪卡 +lblNewstyleFoilcards=新风格闪卡 +lblNon-Foilcards=非闪卡 +lblUnratedcards=未分级的卡 +lbl1starcards=1星级卡 +lbl2starcards=2星级卡 +lbl3starcards=3星级卡 +lbl4starcards=4星级卡 +lbl5starcards=5星级卡 +lblXcopiesof=X个副本 +lblcopiesof=副本 +#ItemListView.java +lblUniqueCardsOnly=每张牌都只显示一个画 +ttUniqueCardsOnly=切换是否每张牌都只显示一个画 +#ACEditorBase.java +lblAddcard=添加牌 +ttAddcard=将选定的牌添加到当前套牌(双击该行或者空格) +lblAdd4ofcard=添加4张牌 +ttAdd4ofcard=将最多4张牌添加到当前套牌 +lblRemovecard=移除卡 +ttRemovecard=从当前套牌移除所选牌(双击该行或者空格) +lblRemove4ofcard=移除4张牌 +ttRemove4ofcard=最多可以将4张所选牌从当前套牌移除 +lblAddBasicLands=添加基本地 +ttAddBasicLands=添加基本地到套牌 +lblCardCatalog=卡牌目录 +lblJumptoprevioustable=跳转到上一个表格 +lblJumptopnexttable=跳转到下一个表格 +lblJumptotextfilter=跳转到文本筛选器 +lblChooseavalueforX=选择X的值 +#VCurrentDeck.java +lblVCurrentDeck=当前套牌 +ttbtnSave=保存套牌(Ctrl+S) +ttbtnSaveAs=保存套牌到(Ctrl+E) +ttbtnLoadDeck=打开套牌(Ctrl+O) +ttbtnNewDeck=新建套牌(Ctrl+N) +ttbtnPrintProxies=打印到HTML文件(Ctrl+P) +lblImport=导入 +ttImportDeck=尝试从非Forge格式导入套牌(Ctrl+I) +lblTitle=标题 +#ImageView.java +lblExpandallgroups=展开所有组 +lblCollapseallgroups=折叠所有组 +lblGroupby=分组 +lblPileby=堆积 +lblColumns=行 +#CEditorVariant.java, CEditorConstructed.java +lblCatalog=目录 +lblAdd=添加 +lbltodeck=到套牌 +lblfromdeck=从套牌 +lbltosideboard=到备牌 +lblfromsideboard=从备牌 +lblascommander=是指挥官 +lblasoathbreaker=是破誓者 +lblassignaturespell=是专属咒语 +lblasavatar=作为头像 +lblfromschemedeck=从魔王套牌 +lblfromplanardeck=从时空竞逐套牌 +lblfromconspiracydeck=从诡局套牌 +lbltoschemedeck=到魔王套牌 +lbltoplanardeck=到时空竞逐套牌 +lbltoconspiracydeck=到诡局套牌 +lblMove=移到 +#VDock.java +lblDock=Dock +lblViewDeckList=查看套牌列表 +lblRevertLayout=还原布局 +lblOpenLayout=打开布局 +lblSaveLayout=保存布局 +#GroupDef.java +lblColor=颜色 +lblColorIdentity=颜色特征 +lblSet=系列 +lblSet2=系列 +#Set word has different meanings in other languages +lblDefault=默认 +lblType=类型 +lblPlaneswalkerDeckSort=鹏洛客套牌排序 +lblRarity=稀有度 +lblConvertToFoil=闪卡 +lblMulticolor=多色 +#DeckFileMenu.java +lblNewDeck=新建套牌 +lblOpenDeck=打开套牌 +lblImportDeck=导入套牌 +lblSaveDeck=保存套牌 +lblSaveDeckAs=保存套牌到 +lblPrinttoHTMLfile=打印成HTML文件 +#PaperCard.java +lblCard=牌 +#CardManager.java +lblFormat=赛制 +lblFormats=赛制 +lblQuestWorld=冒险时空 +lblSets=系列 +lblTypes=类型 +lblConvertedManaCosts=总法术力 +lblCMCRange=总法术力费用范围 +lblPowerRange=力量范围 +lblToughnessRange=防御范围 +lblFoil=闪卡 +lblPersonalRating=个人评价 +lblAdvanced=高级 +#VDeckgen.java +lblDeckGeneration=套牌生成 +btnRandCardpool=随机牌池 +ttbtnRandCardpool=在当前牌池中生成套牌 +btnRandDeck2=构筑(双色) +ttbtnRandDeck2=在当前牌池中生成双色套牌 +btnRandDeck3=构筑(三色) +ttbtnRandDeck3=在当前牌池中生成三色套牌 +btnRandDeck5=构筑(五色) +ttbtnRandDeck5=在当前牌池中生成五色套牌 +#DeckCotroller.java +lblCurrentDeck2=当前标题 +lblUntitled=无标题 +#VPrompt.java +lblPrompt=提示 +lblGameSetup=游戏设置 +#ColumnDef.java +lblAIStatus=AI状态 +lblCMC=总法术力费用 +ttCMC=总法术力费用 +lblCN=编号 +ttCN=收藏编号顺序 +ttColor=颜色 +lblCost=费用 +ttCost=费用 +lblDecks=套牌 +lblDeleteEdit=删除/编辑 +lblSetEdition=神秘行。我们不知道他做了什么和能做什么。 +ttFavorite=喜好 +lblFolder=文件夹 +ttFormats=套牌在赛制中合法 +lblMain=主牌 +ttMain=主牌 +lblQty=数量 +lblQuantity=数量 +lblSide=备牌 +lblSideboard=备牌 +lblNew=新建 +lblOwned=拥有 +lblPower=力量 +ttPower=力量 +lblPrice=价格 +ttPrice=价格 +lblRanking=排名 +lblDraftRanking=轮抓排名 +lblToughness=防御 +ttToughness=防御 +ttType=类型 +#HomeScreen.java +lblNewGame=新游戏 +lblLoadGame=加载游戏 +lblPlayOnline=在线游戏 +lblSettings=设置 \ No newline at end of file diff --git a/forge-gui/res/lists/TypeLists.txt b/forge-gui/res/lists/TypeLists.txt index c8d312fea8e..01da5b29239 100644 --- a/forge-gui/res/lists/TypeLists.txt +++ b/forge-gui/res/lists/TypeLists.txt @@ -156,6 +156,7 @@ Nephilim:Nephilims Nightmare:Nightmares Nightstalker:Nightstalkers Ninja:Ninjas +Noble:Nobles Noggle:Noggles Nomad:Nomads Nymph:Nymphs @@ -243,6 +244,7 @@ Vedalken:Vedalkens Viashino:Viashinos Volver:Volvers Wall:Walls +Warlock:Warlocks Warrior:Warriors Weird:Weirds Werewolf:Werewolves @@ -258,6 +260,7 @@ Yeti:Yetis Zombie:Zombies Zubera:Zuberas [SpellTypes] +Adventure Arcane Trap [EnchantmentTypes] @@ -270,6 +273,7 @@ Shrine Clue Contraption Equipment +Food Fortification Treasure Vehicle @@ -303,6 +307,7 @@ Nahiri Narset Nissa Nixilis +Oko Ral Rowan Saheeli diff --git a/forge-gui/res/puzzle/PS_M207.pzl b/forge-gui/res/puzzle/PS_M207.pzl new file mode 100644 index 00000000000..33a36d6b642 --- /dev/null +++ b/forge-gui/res/puzzle/PS_M207.pzl @@ -0,0 +1,16 @@ +[metadata] +Name:Possibility Storm - Magic Core Set 2020 #07 +URL:http://www.possibilitystorm.com/wp-content/uploads/2019/08/126.-M207.jpg +Goal:Win +Turns:1 +Difficulty:Rare +Description:Win this turn. Your Dauntless Bodyguard chose Shanna, Sisay's Legacy when it entered the battlefield. +[state] +humanlife=20 +ailife=7 +turn=1 +activeplayer=human +activephase=MAIN1 +humanhand=Strength of the Pack;Depose // Deploy;Storm the Citadel;Masterful Replication;Short Sword +humanbattlefield=Gideon Blackblade|Counters:LOYALTY=6;Blackblade Reforged;Omnispell Adept;Shanna, Sisay's Legacy|Id:9;Sigiled Sword of Valeron|AttachedTo:9;Dauntless Bodyguard|ChosenCards:9|Id:10|NoETBTrigs;Forebear's Blade|AttachedTo:10;Hallowed Fountain|NoETBTrigs;Hallowed Fountain|NoETBTrigs;Hallowed Fountain|NoETBTrigs;Temple Garden|NoETBTrigs;Temple Garden|NoETBTrigs;Temple Garden|NoETBTrigs +aibattlefield=Charity Extractor;Looming Altisaur;Gate Colossus;Looming Altisaur;Charity Extractor diff --git a/forge-gui/res/skins/darkforge/bg_chaos_wheel.png b/forge-gui/res/skins/darkforge/bg_chaos_wheel.png new file mode 100644 index 00000000000..e0bb9aef867 Binary files /dev/null and b/forge-gui/res/skins/darkforge/bg_chaos_wheel.png differ diff --git a/forge-gui/res/skins/darkforge/bg_match.jpg b/forge-gui/res/skins/darkforge/bg_match.jpg new file mode 100644 index 00000000000..1b97b6ac4dc Binary files /dev/null and b/forge-gui/res/skins/darkforge/bg_match.jpg differ diff --git a/forge-gui/res/skins/darkforge/bg_splash.png b/forge-gui/res/skins/darkforge/bg_splash.png new file mode 100644 index 00000000000..b8828ce884a Binary files /dev/null and b/forge-gui/res/skins/darkforge/bg_splash.png differ diff --git a/forge-gui/res/skins/darkforge/bg_texture.jpg b/forge-gui/res/skins/darkforge/bg_texture.jpg new file mode 100644 index 00000000000..950a54e2882 Binary files /dev/null and b/forge-gui/res/skins/darkforge/bg_texture.jpg differ diff --git a/forge-gui/res/skins/darkforge/font1.ttf b/forge-gui/res/skins/darkforge/font1.ttf new file mode 100644 index 00000000000..1f5704ed579 Binary files /dev/null and b/forge-gui/res/skins/darkforge/font1.ttf differ diff --git a/forge-gui/res/skins/darkforge/sprite_avatars.png b/forge-gui/res/skins/darkforge/sprite_avatars.png new file mode 100644 index 00000000000..63295091d8e Binary files /dev/null and b/forge-gui/res/skins/darkforge/sprite_avatars.png differ diff --git a/forge-gui/res/skins/darkforge/sprite_icons.png b/forge-gui/res/skins/darkforge/sprite_icons.png new file mode 100644 index 00000000000..e2a5fe0a12f Binary files /dev/null and b/forge-gui/res/skins/darkforge/sprite_icons.png differ diff --git a/forge-gui/res/skins/darkforge/sprite_planar_conquest.png b/forge-gui/res/skins/darkforge/sprite_planar_conquest.png new file mode 100644 index 00000000000..08a535dcf22 Binary files /dev/null and b/forge-gui/res/skins/darkforge/sprite_planar_conquest.png differ diff --git a/forge-gui/res/skins/darkred/bg_match.jpg b/forge-gui/res/skins/darkred/bg_match.jpg new file mode 100644 index 00000000000..f926fee0812 Binary files /dev/null and b/forge-gui/res/skins/darkred/bg_match.jpg differ diff --git a/forge-gui/res/skins/darkred/bg_splash.png b/forge-gui/res/skins/darkred/bg_splash.png new file mode 100644 index 00000000000..20bf087e1f2 Binary files /dev/null and b/forge-gui/res/skins/darkred/bg_splash.png differ diff --git a/forge-gui/res/skins/darkred/bg_texture.jpg b/forge-gui/res/skins/darkred/bg_texture.jpg new file mode 100644 index 00000000000..3c221294890 Binary files /dev/null and b/forge-gui/res/skins/darkred/bg_texture.jpg differ diff --git a/forge-gui/res/skins/darkred/font1.ttf b/forge-gui/res/skins/darkred/font1.ttf new file mode 100644 index 00000000000..ad1efca88ae Binary files /dev/null and b/forge-gui/res/skins/darkred/font1.ttf differ diff --git a/forge-gui/res/skins/darkred/sprite_icons.png b/forge-gui/res/skins/darkred/sprite_icons.png new file mode 100644 index 00000000000..2684a130faf Binary files /dev/null and b/forge-gui/res/skins/darkred/sprite_icons.png differ diff --git a/forge-gui/res/skins/default/bg_match.jpg b/forge-gui/res/skins/default/bg_match.jpg index b82df4692a6..ce143a5381d 100644 Binary files a/forge-gui/res/skins/default/bg_match.jpg and b/forge-gui/res/skins/default/bg_match.jpg differ diff --git a/forge-gui/res/tokenscripts/bg_2_2_wolf_garruk.txt b/forge-gui/res/tokenscripts/bg_2_2_wolf_garruk.txt new file mode 100644 index 00000000000..6f5aeeb6a74 --- /dev/null +++ b/forge-gui/res/tokenscripts/bg_2_2_wolf_garruk.txt @@ -0,0 +1,8 @@ +Name:Wolf +ManaCost:no cost +Types:Creature Wolf +Colors:black,green +PT:2/2 +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.Self | Execute$ TrigPutCounter | TriggerDescription$ When this creature dies, put a loyalty counter on each Garruk you control. +SVar:TrigPutCounter:DB$ PutCounterAll | ValidCards$ Garruk.YouCtrl | CounterType$ LOYALTY | CounterNum$ 1 +Oracle:When this creature dies, put a loyalty counter on each Garruk you control. diff --git a/forge-gui/res/tokenscripts/c_a_food_sac.txt b/forge-gui/res/tokenscripts/c_a_food_sac.txt new file mode 100644 index 00000000000..7d14f0658a2 --- /dev/null +++ b/forge-gui/res/tokenscripts/c_a_food_sac.txt @@ -0,0 +1,5 @@ +Name:Food +ManaCost:no cost +Types:Artifact Food +A:AB$ GainLife | Cost$ 2 T Sac<1/CARDNAME> | Defined$ You | LifeAmount$ 3 | SpellDescription$ You gain 3 life. +Oracle:{2}, {T}, Sacrifice this artifact: You gain 3 life. diff --git a/forge-gui/src/main/java/forge/achievement/AchievementCollection.java b/forge-gui/src/main/java/forge/achievement/AchievementCollection.java index b52029fbb89..178cab2932c 100644 --- a/forge-gui/src/main/java/forge/achievement/AchievementCollection.java +++ b/forge-gui/src/main/java/forge/achievement/AchievementCollection.java @@ -81,7 +81,7 @@ public abstract class AchievementCollection implements Iterable { } protected AchievementCollection(String name0, String filename0, boolean isLimitedFormat0) { - this(name0, filename0, isLimitedFormat0, (String) null); + this(name0, filename0, isLimitedFormat0, null); } protected AchievementCollection(String name0, String filename0, boolean isLimitedFormat0, String path0) { @@ -125,7 +125,7 @@ public abstract class AchievementCollection implements Iterable { final List achievementListFile = FileUtil.readFile(path); for (final String s : achievementListFile) { if (!s.isEmpty()) { - String k[] = StringUtils.split(s, "|"); + String[] k = StringUtils.split(s, "|"); add(k[0],k[1],k[2]); } } diff --git a/forge-gui/src/main/java/forge/achievement/ChallengeAchievements.java b/forge-gui/src/main/java/forge/achievement/ChallengeAchievements.java index 4765d8c9c1f..f159ad97243 100644 --- a/forge-gui/src/main/java/forge/achievement/ChallengeAchievements.java +++ b/forge-gui/src/main/java/forge/achievement/ChallengeAchievements.java @@ -72,11 +72,8 @@ public class ChallengeAchievements extends AchievementCollection { } public static boolean checkValidGameMode(final Game game) { - if (game.getRules().hasAppliedVariant(GameType.MomirBasic) || game.getRules().hasAppliedVariant(GameType.MoJhoSto) - || game.getRules().hasAppliedVariant(GameType.Puzzle)) { - // these modes use a fixed pre-defined deck format, so challenge achievements don't apply in them - return false; - } - return true; + // these modes use a fixed pre-defined deck format, so challenge achievements don't apply in them + return !game.getRules().hasAppliedVariant(GameType.MomirBasic) && !game.getRules().hasAppliedVariant(GameType.MoJhoSto) + && !game.getRules().hasAppliedVariant(GameType.Puzzle); } } diff --git a/forge-gui/src/main/java/forge/achievement/MatchWinStreak.java b/forge-gui/src/main/java/forge/achievement/MatchWinStreak.java index 47bb95c6b56..a876029d2e5 100644 --- a/forge-gui/src/main/java/forge/achievement/MatchWinStreak.java +++ b/forge-gui/src/main/java/forge/achievement/MatchWinStreak.java @@ -15,10 +15,7 @@ public class MatchWinStreak extends StreakAchievement { @Override protected Boolean eval(Player player, Game game) { if (game.getMatch().isMatchOver()) { - if (game.getMatch().isWonBy(player.getLobbyPlayer())) { - return true; - } - return false; + return game.getMatch().isWonBy(player.getLobbyPlayer()); } return null; } diff --git a/forge-gui/src/main/java/forge/achievement/VariantWins.java b/forge-gui/src/main/java/forge/achievement/VariantWins.java index 9e1630dc810..77a7e38f71d 100644 --- a/forge-gui/src/main/java/forge/achievement/VariantWins.java +++ b/forge-gui/src/main/java/forge/achievement/VariantWins.java @@ -24,7 +24,7 @@ public class VariantWins extends ProgressiveAchievement { return true; } if (variant == GameType.Archenemy && game.getRules().hasAppliedVariant(GameType.ArchenemyRumble)) { - return true; //lump Archenemy Rumble into same achievement as Archenemy + return true; //lump Archenemy Rumble into same achievement as Archenemy } } return false; diff --git a/forge-gui/src/main/java/forge/assets/FSkinProp.java b/forge-gui/src/main/java/forge/assets/FSkinProp.java index 2a3fd620fd6..91ac4331eed 100644 --- a/forge-gui/src/main/java/forge/assets/FSkinProp.java +++ b/forge-gui/src/main/java/forge/assets/FSkinProp.java @@ -297,7 +297,7 @@ public enum FSkinProp { private int[] coords; private PropType type; - private FSkinProp(final int[] coords0, final PropType type0) { + FSkinProp(final int[] coords0, final PropType type0) { coords = coords0; type = type0; } diff --git a/forge-gui/src/main/java/forge/card/CardDetailUtil.java b/forge-gui/src/main/java/forge/card/CardDetailUtil.java index 54e92455c8d..e86d433f44e 100644 --- a/forge-gui/src/main/java/forge/card/CardDetailUtil.java +++ b/forge-gui/src/main/java/forge/card/CardDetailUtil.java @@ -46,7 +46,7 @@ public class CardDetailUtil { public final int r, g, b; - private DetailColors(final int r0, final int g0, final int b0) { + DetailColors(final int r0, final int g0, final int b0) { r = r0; g = g0; b = b0; diff --git a/forge-gui/src/main/java/forge/card/CardReaderExperiments.java b/forge-gui/src/main/java/forge/card/CardReaderExperiments.java index 91159243231..88caacc8442 100644 --- a/forge-gui/src/main/java/forge/card/CardReaderExperiments.java +++ b/forge-gui/src/main/java/forge/card/CardReaderExperiments.java @@ -162,7 +162,7 @@ public class CardReaderExperiments { Matcher m = p.matcher(line); if (m.matches()) { StringBuilder newLineBuilder = new StringBuilder(); - newLineBuilder.append(line.substring(0, m.start(1))); + newLineBuilder.append(line, 0, m.start(1)); for (String sym : m.group(1).split(" ")) { newLineBuilder.append("{" + sym + "}"); } diff --git a/forge-gui/src/main/java/forge/card/CardScriptParser.java b/forge-gui/src/main/java/forge/card/CardScriptParser.java index a62037712cc..55947f13095 100644 --- a/forge-gui/src/main/java/forge/card/CardScriptParser.java +++ b/forge-gui/src/main/java/forge/card/CardScriptParser.java @@ -344,10 +344,7 @@ public final class CardScriptParser { if (DEFINED_CARDS.contains(defined)) { return true; } - if (Iterables.any(DEFINED_CARDS_STARTSWITH, startsWith(defined))) { - return true; - } - return false; + return Iterables.any(DEFINED_CARDS_STARTSWITH, startsWith(defined)); } private static boolean isDefinedPlayerLegal(final String defined) { final boolean non = defined.startsWith("Non"), flipped = defined.startsWith("Flipped"); @@ -363,10 +360,7 @@ public final class CardScriptParser { if (DEFINED_PLAYERS.contains(defined)) { return true; } - if (Iterables.any(DEFINED_PLAYERS_STARTSWITH, startsWith(defined))) { - return true; - } - return false; + return Iterables.any(DEFINED_PLAYERS_STARTSWITH, startsWith(defined)); } private static final Set VALID_INCLUSIVE = ImmutableSortedSet.of( @@ -472,10 +466,7 @@ public final class CardScriptParser { if (VALID_EXCLUSIVE.contains(valid)) { return true; } - if (Iterables.any(VALID_EXCLUSIVE_STARTSWITH, startsWith(valid))) { - return true; - } - return false; + return Iterables.any(VALID_EXCLUSIVE_STARTSWITH, startsWith(valid)); } private static final class KeyValuePair { diff --git a/forge-gui/src/main/java/forge/deck/CardArchetypeLDAGenerator.java b/forge-gui/src/main/java/forge/deck/CardArchetypeLDAGenerator.java index 1d38d76c8ac..2cbab5ab4d1 100644 --- a/forge-gui/src/main/java/forge/deck/CardArchetypeLDAGenerator.java +++ b/forge-gui/src/main/java/forge/deck/CardArchetypeLDAGenerator.java @@ -80,7 +80,7 @@ public final class CardArchetypeLDAGenerator { System.out.print("t" + t + ": "); int i = 0; while (topic.size()<=40&&i=0.005d) { topicCards.add(cardName); diff --git a/forge-gui/src/main/java/forge/deck/CardRelationMatrixGenerator.java b/forge-gui/src/main/java/forge/deck/CardRelationMatrixGenerator.java index c8ef0a89a58..9227ae62637 100644 --- a/forge-gui/src/main/java/forge/deck/CardRelationMatrixGenerator.java +++ b/forge-gui/src/main/java/forge/deck/CardRelationMatrixGenerator.java @@ -100,7 +100,7 @@ public final class CardRelationMatrixGenerator { for (PaperCard card:cardList){ int col=cardIntegerMap.get(card.getName()); int[] distances = matrix[col]; - int max = (Integer) Collections.max(Arrays.asList(ArrayUtils.toObject(distances))); + int max = Collections.max(Arrays.asList(ArrayUtils.toObject(distances))); if (max>0) { ArrayIndexComparator comparator = new ArrayIndexComparator(ArrayUtils.toObject(distances)); Integer[] indices = comparator.createIndexArray(); @@ -118,7 +118,7 @@ public final class CardRelationMatrixGenerator { ++j; } deckPool.add(new AbstractMap.SimpleEntry(cardToAdd,distances[indices[cardList.size()-1-k]])); - }; + } if(excludeThisCard){ continue; } @@ -181,7 +181,7 @@ public final class CardRelationMatrixGenerator { for (PaperCard card:legends){ int col=legendIntegerMap.get(card.getName()); int[] distances = matrix[col]; - int max = (Integer) Collections.max(Arrays.asList(ArrayUtils.toObject(distances))); + int max = Collections.max(Arrays.asList(ArrayUtils.toObject(distances))); if (max>0) { List> deckPool=new ArrayList<>(); for(int k=0;k kv : files.entrySet()) { + boolean isJPG = true; + boolean isLogged = false; if (cancel) {//stop prevent sleep GuiBase.getInterface().preventSystemSleep(false); break; } @@ -263,10 +267,14 @@ public abstract class GuiDownloadService implements Runnable { cardSkipped = true; //assume skipped unless saved successfully String url = kv.getValue(); //decode URL Key - String decodedKey = URLDecoder.decode(kv.getKey()); + String decodedKey = ""; + try { decodedKey = URLDecoder.decode(kv.getKey(), StandardCharsets.UTF_8.toString()); } + catch (UnsupportedEncodingException e) { Log.error("UTF-8 is unknown", e); } final File fileDest = new File(decodedKey); + final String filePath = fileDest.getPath(); + final String subLastIndex = filePath.contains("pics") ? "\\pics\\" : "\\db\\"; - System.out.println(count + "/" + totalCount + " - " + fileDest); + System.out.println(count + "/" + totalCount + " - .." + filePath.substring(filePath.lastIndexOf(subLastIndex)+1)); FileOutputStream fos = null; try { @@ -287,8 +295,12 @@ public abstract class GuiDownloadService implements Runnable { // if file is not found and this is a JPG, give PNG a shot... if ((conn.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) && (url.endsWith(".jpg"))) { + isJPG = false; conn.disconnect(); - System.out.println(" File not found: " + url); + if(url.contains("/images/")){ + isLogged = true; + System.out.println("File not found: .." + url.substring(url.lastIndexOf("/images/")+1)); + } url = url.substring(0,url.length() - 4) + ".png"; imageUrl = new URL(url); conn = (HttpURLConnection) imageUrl.openConnection(p); @@ -307,7 +319,8 @@ public abstract class GuiDownloadService implements Runnable { break; case HttpURLConnection.HTTP_NOT_FOUND: conn.disconnect(); - System.out.println(" File not found: " + url); + if(url.contains("/images/") && !isJPG && !isLogged) + System.out.println("File not found: .." + url.substring(url.lastIndexOf("/images/")+1)); break; default: conn.disconnect(); diff --git a/forge-gui/src/main/java/forge/download/GuiDownloadZipService.java b/forge-gui/src/main/java/forge/download/GuiDownloadZipService.java index d7c0c88ddd3..8e13bdca4f3 100644 --- a/forge-gui/src/main/java/forge/download/GuiDownloadZipService.java +++ b/forge-gui/src/main/java/forge/download/GuiDownloadZipService.java @@ -181,7 +181,7 @@ public class GuiDownloadZipService extends GuiDownloadService { int count; long total = 0; - final byte data[] = new byte[1024]; + final byte[] data = new byte[1024]; while ((count = input.read(data)) != -1) { if (cancel) { break; } diff --git a/forge-gui/src/main/java/forge/error/ExceptionHandler.java b/forge-gui/src/main/java/forge/error/ExceptionHandler.java index 18463eca1ed..1851ab83937 100644 --- a/forge-gui/src/main/java/forge/error/ExceptionHandler.java +++ b/forge-gui/src/main/java/forge/error/ExceptionHandler.java @@ -61,7 +61,7 @@ public class ExceptionHandler implements UncaughtExceptionHandler { int i = 0; while (logFile.exists() && !logFile.delete()) { - String pathname = logFile.getPath().replaceAll("[0-9]{0,2}.log$", String.valueOf(i++) + ".log"); + String pathname = logFile.getPath().replaceAll("[0-9]{0,2}.log$", i++ + ".log"); logFile = new File(pathname); } diff --git a/forge-gui/src/main/java/forge/gauntlet/GauntletData.java b/forge-gui/src/main/java/forge/gauntlet/GauntletData.java index 91d2a04967f..c471c546da2 100644 --- a/forge-gui/src/main/java/forge/gauntlet/GauntletData.java +++ b/forge-gui/src/main/java/forge/gauntlet/GauntletData.java @@ -64,7 +64,7 @@ public final class GauntletData { public void stamp() { final DateFormat dateFormat = new SimpleDateFormat("MM-dd-yy, H:m"); - timestamp = dateFormat.format(new Date()).toString(); + timestamp = dateFormat.format(new Date()); } /** Resets a gauntlet data to an unplayed state, then stamps and saves. */ diff --git a/forge-gui/src/main/java/forge/interfaces/IDevModeCheats.java b/forge-gui/src/main/java/forge/interfaces/IDevModeCheats.java index 43d36633c6d..dd62238991e 100644 --- a/forge-gui/src/main/java/forge/interfaces/IDevModeCheats.java +++ b/forge-gui/src/main/java/forge/interfaces/IDevModeCheats.java @@ -61,7 +61,7 @@ public interface IDevModeCheats { * Implementation of {@link IDevModeCheats} that disallows cheating by * performing no action whatsoever when any of its methods is called. */ - public static final IDevModeCheats NO_CHEAT = new IDevModeCheats() { + IDevModeCheats NO_CHEAT = new IDevModeCheats() { @Override public void winGame() { } diff --git a/forge-gui/src/main/java/forge/interfaces/IMayViewCards.java b/forge-gui/src/main/java/forge/interfaces/IMayViewCards.java index 9aeeab0f934..ec84e61ab54 100644 --- a/forge-gui/src/main/java/forge/interfaces/IMayViewCards.java +++ b/forge-gui/src/main/java/forge/interfaces/IMayViewCards.java @@ -22,7 +22,7 @@ public interface IMayViewCards { boolean mayFlip(CardView c); /** {@link IMayViewCards} that lets you view all cards unconditionally. */ - public static final IMayViewCards ALL = new IMayViewCards() { + IMayViewCards ALL = new IMayViewCards() { @Override public boolean mayView(final CardView c) { return true; diff --git a/forge-gui/src/main/java/forge/itemmanager/AdvancedSearch.java b/forge-gui/src/main/java/forge/itemmanager/AdvancedSearch.java index 65cd449f1c3..d02c5e76c97 100644 --- a/forge-gui/src/main/java/forge/itemmanager/AdvancedSearch.java +++ b/forge-gui/src/main/java/forge/itemmanager/AdvancedSearch.java @@ -363,7 +363,7 @@ public class AdvancedSearch { private final FilterOperator[] operatorOptions; private final FilterEvaluator evaluator; - private FilterOption(String name0, Class type0, FilterOperator[] operatorOptions0, FilterEvaluator evaluator0) { + FilterOption(String name0, Class type0, FilterOperator[] operatorOptions0, FilterEvaluator evaluator0) { name = name0; type = type0; operatorOptions = operatorOptions0; @@ -680,7 +680,7 @@ public class AdvancedSearch { private final FilterValueCount valueCount; private final OperatorEvaluator evaluator; - private FilterOperator(String caption0, String formatStr0, FilterValueCount valueCount0, OperatorEvaluator evaluator0) { + FilterOperator(String caption0, String formatStr0, FilterValueCount valueCount0, OperatorEvaluator evaluator0) { caption = caption0; formatStr = formatStr0; valueCount = valueCount0; @@ -1302,7 +1302,7 @@ public class AdvancedSearch { private final String token; - private Operator(String token0) { + Operator(String token0) { token = token0; } diff --git a/forge-gui/src/main/java/forge/itemmanager/ItemColumnConfig.java b/forge-gui/src/main/java/forge/itemmanager/ItemColumnConfig.java index e6e202bba64..c4c8c550464 100644 --- a/forge-gui/src/main/java/forge/itemmanager/ItemColumnConfig.java +++ b/forge-gui/src/main/java/forge/itemmanager/ItemColumnConfig.java @@ -7,7 +7,7 @@ import com.google.common.base.Function; import forge.item.InventoryItem; public class ItemColumnConfig { - public static enum SortState { + public enum SortState { NONE, ASC, DESC diff --git a/forge-gui/src/main/java/forge/itemmanager/ItemManagerConfig.java b/forge-gui/src/main/java/forge/itemmanager/ItemManagerConfig.java index 0280c8ab604..b08cb5247f2 100644 --- a/forge-gui/src/main/java/forge/itemmanager/ItemManagerConfig.java +++ b/forge-gui/src/main/java/forge/itemmanager/ItemManagerConfig.java @@ -114,7 +114,7 @@ public enum ItemManagerConfig { private Prop imageColumnCount; private Prop viewIndex; - private ItemManagerConfig(final Map cols0, boolean showUniqueCardsOption0, boolean uniqueCardsOnly0, boolean hideFilters0, GroupDef groupBy0, ColumnDef pileBy0, int imageColumnCount0, int viewIndex0) { + ItemManagerConfig(final Map cols0, boolean showUniqueCardsOption0, boolean uniqueCardsOnly0, boolean hideFilters0, GroupDef groupBy0, ColumnDef pileBy0, int imageColumnCount0, int viewIndex0) { cols = cols0; for (ItemColumnConfig colConfig : cols.values()) { colConfig.establishDefaults(); diff --git a/forge-gui/src/main/java/forge/itemmanager/ItemManagerModel.java b/forge-gui/src/main/java/forge/itemmanager/ItemManagerModel.java index a55282600a2..4969909ac9d 100644 --- a/forge-gui/src/main/java/forge/itemmanager/ItemManagerModel.java +++ b/forge-gui/src/main/java/forge/itemmanager/ItemManagerModel.java @@ -190,7 +190,7 @@ public final class ItemManagerModel { for (final ItemColumn col : colsToSort) { oneColSorters.add(new ItemPoolSorter( col.getFnSort(), - col.getConfig().getSortState().equals(SortState.ASC) ? true : false)); + col.getConfig().getSortState().equals(SortState.ASC))); } return new Sorter(oneColSorters); diff --git a/forge-gui/src/main/java/forge/itemmanager/SItemManagerUtil.java b/forge-gui/src/main/java/forge/itemmanager/SItemManagerUtil.java index b880cf717b6..78a6a894b06 100644 --- a/forge-gui/src/main/java/forge/itemmanager/SItemManagerUtil.java +++ b/forge-gui/src/main/java/forge/itemmanager/SItemManagerUtil.java @@ -28,7 +28,7 @@ import java.util.Map.Entry; */ public final class SItemManagerUtil { /** An enum to encapsulate metadata for the stats/filter objects. */ - public static enum StatTypes implements IHasSkinProp { + public enum StatTypes implements IHasSkinProp { WHITE (FSkinProp.IMG_MANA_W, CardRulesPredicates.Presets.IS_WHITE, "lblWhitecards"), BLUE (FSkinProp.IMG_MANA_U, CardRulesPredicates.Presets.IS_BLUE, "lblBluecards"), BLACK (FSkinProp.IMG_MANA_B, CardRulesPredicates.Presets.IS_BLACK, "lblBlackcards"), @@ -78,7 +78,7 @@ public final class SItemManagerUtil { public final Predicate predicate; public final String label; - private StatTypes(final FSkinProp skinProp0, final Predicate predicate0, final String label0) { + StatTypes(final FSkinProp skinProp0, final Predicate predicate0, final String label0) { skinProp = skinProp0; predicate = predicate0; final Localizer localizer = Localizer.getInstance(); diff --git a/forge-gui/src/main/java/forge/limited/BoosterDraft.java b/forge-gui/src/main/java/forge/limited/BoosterDraft.java index ef22d7b8e76..09d22dca69e 100644 --- a/forge-gui/src/main/java/forge/limited/BoosterDraft.java +++ b/forge-gui/src/main/java/forge/limited/BoosterDraft.java @@ -346,7 +346,7 @@ public class BoosterDraft implements IBoosterDraft { @Override public Deck[] getDecks() { - Deck decks[] = new Deck[7]; + Deck[] decks = new Deck[7]; for (int i = 1; i < N_PLAYERS; i++) { decks[i - 1] = ((LimitedPlayerAI) this.players.get(i)).buildDeck(); } diff --git a/forge-gui/src/main/java/forge/limited/CardThemedConquestDeckBuilder.java b/forge-gui/src/main/java/forge/limited/CardThemedConquestDeckBuilder.java index b618dd63c6b..b126ef47b27 100644 --- a/forge-gui/src/main/java/forge/limited/CardThemedConquestDeckBuilder.java +++ b/forge-gui/src/main/java/forge/limited/CardThemedConquestDeckBuilder.java @@ -44,7 +44,7 @@ public class CardThemedConquestDeckBuilder extends CardThemedDeckBuilder { } numSpellsNeeded = ((Double)Math.floor(targetSize*(getCreaturePercentage()+getSpellPercentage()))).intValue(); numCreaturesToStart = ((Double)Math.ceil(targetSize*(getCreaturePercentage()))).intValue(); - landsNeeded = ((Double)Math.ceil(targetSize*(getLandPercentage()))).intValue();; + landsNeeded = ((Double)Math.ceil(targetSize*(getLandPercentage()))).intValue(); if (logColorsToConsole) { System.out.println(keyCard.getName()); System.out.println("Pre Colors: " + colors.toEnumSet().toString()); diff --git a/forge-gui/src/main/java/forge/limited/CardThemedDeckBuilder.java b/forge-gui/src/main/java/forge/limited/CardThemedDeckBuilder.java index 769e7a34801..1188f0e943b 100644 --- a/forge-gui/src/main/java/forge/limited/CardThemedDeckBuilder.java +++ b/forge-gui/src/main/java/forge/limited/CardThemedDeckBuilder.java @@ -132,7 +132,7 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase { } numSpellsNeeded = ((Double)Math.floor(targetSize*(getCreaturePercentage()+getSpellPercentage()))).intValue(); numCreaturesToStart = ((Double)Math.ceil(targetSize*(getCreaturePercentage()))).intValue(); - landsNeeded = ((Double)Math.ceil(targetSize*(getLandPercentage()))).intValue();; + landsNeeded = ((Double)Math.ceil(targetSize*(getLandPercentage()))).intValue(); if (logColorsToConsole) { System.out.println(keyCard.getName()); System.out.println("Pre Colors: " + colors.toEnumSet().toString()); diff --git a/forge-gui/src/main/java/forge/limited/LimitedPoolType.java b/forge-gui/src/main/java/forge/limited/LimitedPoolType.java index 2f52015e1e8..7ce7fbd8828 100644 --- a/forge-gui/src/main/java/forge/limited/LimitedPoolType.java +++ b/forge-gui/src/main/java/forge/limited/LimitedPoolType.java @@ -8,7 +8,7 @@ public enum LimitedPoolType { Chaos("Chaos Draft"); private final String displayName; - private LimitedPoolType(String name) { + LimitedPoolType(String name) { displayName = name; } diff --git a/forge-gui/src/main/java/forge/match/GameLobby.java b/forge-gui/src/main/java/forge/match/GameLobby.java index 9951217dcb3..797ecec2a73 100644 --- a/forge-gui/src/main/java/forge/match/GameLobby.java +++ b/forge-gui/src/main/java/forge/match/GameLobby.java @@ -158,7 +158,7 @@ public abstract class GameLobby implements IHasGameType { public void addSlot() { final int newIndex = getNumberOfSlots(); final LobbySlotType type = allowNetworking ? LobbySlotType.OPEN : LobbySlotType.AI; - addSlot(new LobbySlot(type, null, newIndex, newIndex, false, !allowNetworking, Collections.emptySet())); + addSlot(new LobbySlot(type, null, newIndex, newIndex, false, !allowNetworking, Collections.emptySet())); } protected final void addSlot(final LobbySlot slot) { if (slot == null) { @@ -485,7 +485,7 @@ public abstract class GameLobby implements IHasGameType { return null; } } - schemes = schemePool == null ? Collections.emptyList() : schemePool.toFlatList(); + schemes = schemePool == null ? Collections.emptyList() : schemePool.toFlatList(); } //Planechase @@ -498,7 +498,7 @@ public abstract class GameLobby implements IHasGameType { return null; } } - planes = planePool == null ? Collections.emptyList() : planePool.toFlatList(); + planes = planePool == null ? Collections.emptyList() : planePool.toFlatList(); } //Vanguard diff --git a/forge-gui/src/main/java/forge/match/HostedMatch.java b/forge-gui/src/main/java/forge/match/HostedMatch.java index 7535a28d20f..34919b479c2 100644 --- a/forge-gui/src/main/java/forge/match/HostedMatch.java +++ b/forge-gui/src/main/java/forge/match/HostedMatch.java @@ -98,7 +98,7 @@ public class HostedMatch { throw new IllegalArgumentException(); } - this.guis = guis == null ? ImmutableMap.of() : guis; + this.guis = guis == null ? ImmutableMap.of() : guis; final boolean useRandomFoil = FModel.getPreferences().getPrefBoolean(FPref.UI_RANDOM_FOIL); for (final RegisteredPlayer rp : players) { rp.setRandomFoil(useRandomFoil); @@ -160,7 +160,7 @@ public class HostedMatch { final GameView gameView = getGameView(); humanCount = 0; - final MapOfLists playersPerGui = new HashMapOfLists(CollectionSuppliers.arrayLists()); + final MapOfLists playersPerGui = new HashMapOfLists(CollectionSuppliers.arrayLists()); for (int iPlayer = 0; iPlayer < players.size(); iPlayer++) { final RegisteredPlayer rp = match.getPlayers().get(iPlayer); final Player p = players.get(iPlayer); diff --git a/forge-gui/src/main/java/forge/match/LobbySlot.java b/forge-gui/src/main/java/forge/match/LobbySlot.java index 9deb226fe04..bd33cff83e9 100644 --- a/forge-gui/src/main/java/forge/match/LobbySlot.java +++ b/forge-gui/src/main/java/forge/match/LobbySlot.java @@ -137,7 +137,7 @@ public final class LobbySlot implements Serializable { } public void setAiOptions(final Set aiOptions) { - this.aiOptions = aiOptions == null ? ImmutableSet.of() : ImmutableSet.copyOf(aiOptions); + this.aiOptions = aiOptions == null ? ImmutableSet.of() : ImmutableSet.copyOf(aiOptions); } } \ No newline at end of file diff --git a/forge-gui/src/main/java/forge/match/LobbySlotType.java b/forge-gui/src/main/java/forge/match/LobbySlotType.java index 8e764b232b4..2c8e6bce624 100644 --- a/forge-gui/src/main/java/forge/match/LobbySlotType.java +++ b/forge-gui/src/main/java/forge/match/LobbySlotType.java @@ -4,5 +4,5 @@ public enum LobbySlotType { LOCAL, AI, OPEN, - REMOTE; + REMOTE } \ No newline at end of file diff --git a/forge-gui/src/main/java/forge/match/LocalLobby.java b/forge-gui/src/main/java/forge/match/LocalLobby.java index ca7b66724ad..f8fa6f7a8e7 100644 --- a/forge-gui/src/main/java/forge/match/LocalLobby.java +++ b/forge-gui/src/main/java/forge/match/LocalLobby.java @@ -3,7 +3,6 @@ package forge.match; import java.util.Collections; import forge.GuiBase; -import forge.ai.AIOption; import forge.interfaces.IGuiGame; public final class LocalLobby extends GameLobby { @@ -15,10 +14,10 @@ public final class LocalLobby extends GameLobby { final String humanName = localName(); final int[] avatarIndices = localAvatarIndices(); - final LobbySlot slot0 = new LobbySlot(LobbySlotType.LOCAL, humanName, avatarIndices[0], 0, true, true, Collections.emptySet()); + final LobbySlot slot0 = new LobbySlot(LobbySlotType.LOCAL, humanName, avatarIndices[0], 0, true, true, Collections.emptySet()); addSlot(slot0); - final LobbySlot slot1 = new LobbySlot(LobbySlotType.AI, null, avatarIndices[1], 1, false, true, Collections.emptySet()); + final LobbySlot slot1 = new LobbySlot(LobbySlotType.AI, null, avatarIndices[1], 1, false, true, Collections.emptySet()); addSlot(slot1); } diff --git a/forge-gui/src/main/java/forge/match/NextGameDecision.java b/forge-gui/src/main/java/forge/match/NextGameDecision.java index 88e11189c41..52cf84d9b0d 100644 --- a/forge-gui/src/main/java/forge/match/NextGameDecision.java +++ b/forge-gui/src/main/java/forge/match/NextGameDecision.java @@ -3,5 +3,5 @@ package forge.match; public enum NextGameDecision { NEW, CONTINUE, - QUIT; + QUIT } diff --git a/forge-gui/src/main/java/forge/match/input/InputLockUI.java b/forge-gui/src/main/java/forge/match/input/InputLockUI.java index 5b525ee7c69..657f77ec96f 100644 --- a/forge-gui/src/main/java/forge/match/input/InputLockUI.java +++ b/forge-gui/src/main/java/forge/match/input/InputLockUI.java @@ -55,7 +55,7 @@ public class InputLockUI implements Input { } FThreads.invokeInEdtLater(showMessageFromEdt); } - }; + } private final Runnable showMessageFromEdt = new Runnable() { @Override diff --git a/forge-gui/src/main/java/forge/model/FModel.java b/forge-gui/src/main/java/forge/model/FModel.java index edbe8779551..2e2f04ba571 100644 --- a/forge-gui/src/main/java/forge/model/FModel.java +++ b/forge-gui/src/main/java/forge/model/FModel.java @@ -276,7 +276,7 @@ public final class FModel { } else if (s.length() > 1) { if (tList != null) { if (s.contains(":")) { - String k[] = s.split(":"); + String[] k = s.split(":"); tList.add(k[0]); CardType.Constant.pluralTypes.put(k[0], k[1]); } else { diff --git a/forge-gui/src/main/java/forge/model/MetaSet.java b/forge-gui/src/main/java/forge/model/MetaSet.java index 9da30c7dbf7..ee881f7e512 100644 --- a/forge-gui/src/main/java/forge/model/MetaSet.java +++ b/forge-gui/src/main/java/forge/model/MetaSet.java @@ -108,7 +108,7 @@ public class MetaSet { private final String shortHand; public final String descriptiveName; - private MetaSetType(String shortname, String descName) { + MetaSetType(String shortname, String descName) { shortHand = shortname; descriptiveName = descName; } diff --git a/forge-gui/src/main/java/forge/net/OfflineLobby.java b/forge-gui/src/main/java/forge/net/OfflineLobby.java index 18827184027..e8827558e1a 100644 --- a/forge-gui/src/main/java/forge/net/OfflineLobby.java +++ b/forge-gui/src/main/java/forge/net/OfflineLobby.java @@ -2,7 +2,6 @@ package forge.net; import java.util.Collections; -import forge.ai.AIOption; import forge.interfaces.IGuiGame; import forge.match.GameLobby; import forge.match.LobbySlot; @@ -16,10 +15,10 @@ public final class OfflineLobby extends GameLobby { final String humanName = localName(); final int[] avatarIndices = localAvatarIndices(); - final LobbySlot slot0 = new LobbySlot(LobbySlotType.LOCAL, humanName, avatarIndices[0], 0, true, false, Collections.emptySet()); + final LobbySlot slot0 = new LobbySlot(LobbySlotType.LOCAL, humanName, avatarIndices[0], 0, true, false, Collections.emptySet()); addSlot(slot0); - final LobbySlot slot1 = new LobbySlot(LobbySlotType.OPEN, null, -1, -1, false, false, Collections.emptySet()); + final LobbySlot slot1 = new LobbySlot(LobbySlotType.OPEN, null, -1, -1, false, false, Collections.emptySet()); addSlot(slot1); } diff --git a/forge-gui/src/main/java/forge/net/ProtocolMethod.java b/forge-gui/src/main/java/forge/net/ProtocolMethod.java index b75acdce1cf..e220668832f 100644 --- a/forge-gui/src/main/java/forge/net/ProtocolMethod.java +++ b/forge-gui/src/main/java/forge/net/ProtocolMethod.java @@ -101,23 +101,23 @@ public enum ProtocolMethod { CLIENT(IGameController.class); private final Class toInvoke; - private Mode(final Class toInvoke) { + Mode(final Class toInvoke) { this.toInvoke = toInvoke; } - }; + } private final ProtocolMethod.Mode mode; private final Class returnType; private final Class[] args; - private ProtocolMethod(final ProtocolMethod.Mode mode) { + ProtocolMethod(final ProtocolMethod.Mode mode) { this(mode, Void.TYPE); } - private ProtocolMethod(final ProtocolMethod.Mode mode, final Class returnType) { + ProtocolMethod(final ProtocolMethod.Mode mode, final Class returnType) { this(mode, returnType, (Class[]) null); } @SafeVarargs - private ProtocolMethod(final ProtocolMethod.Mode mode, final Class returnType, final Class ... args) { + ProtocolMethod(final ProtocolMethod.Mode mode, final Class returnType, final Class... args) { this.mode = mode; this.returnType = returnType; this.args = args == null ? new Class[] {} : args; diff --git a/forge-gui/src/main/java/forge/net/client/GameClientHandler.java b/forge-gui/src/main/java/forge/net/client/GameClientHandler.java index 93f11d7be96..30d977378a1 100644 --- a/forge-gui/src/main/java/forge/net/client/GameClientHandler.java +++ b/forge-gui/src/main/java/forge/net/client/GameClientHandler.java @@ -231,7 +231,7 @@ final class GameClientHandler extends GameProtocolHandler { if (trackableObject.getTracker() == null) { trackableObject.setTracker(this.tracker); // walk the props - EnumMap props = (EnumMap) trackableObject.getProps(); + EnumMap props = trackableObject.getProps(); if (!(props == null)) { for (Object propObj : props.values()) { updateTrackers(new Object[]{propObj}); diff --git a/forge-gui/src/main/java/forge/net/server/FServerManager.java b/forge-gui/src/main/java/forge/net/server/FServerManager.java index 826dd0ea895..4a17201fd69 100644 --- a/forge-gui/src/main/java/forge/net/server/FServerManager.java +++ b/forge-gui/src/main/java/forge/net/server/FServerManager.java @@ -223,7 +223,7 @@ public final class FServerManager { NetworkInterface n = NetworkInterface.getByInetAddress(s.getLocalAddress()); Enumeration en = n.getInetAddresses(); while (en.hasMoreElements()) { - InetAddress addr = (InetAddress) en.nextElement(); + InetAddress addr = en.nextElement(); if (addr instanceof Inet4Address) { if (preferIPv6) { continue; diff --git a/forge-gui/src/main/java/forge/net/server/ServerGameLobby.java b/forge-gui/src/main/java/forge/net/server/ServerGameLobby.java index 84c489c40c5..9fd87b8b132 100644 --- a/forge-gui/src/main/java/forge/net/server/ServerGameLobby.java +++ b/forge-gui/src/main/java/forge/net/server/ServerGameLobby.java @@ -4,7 +4,6 @@ import java.util.Collections; import org.apache.commons.lang3.StringUtils; -import forge.ai.AIOption; import forge.interfaces.IGuiGame; import forge.match.GameLobby; import forge.match.LobbySlot; @@ -14,8 +13,8 @@ public final class ServerGameLobby extends GameLobby { public ServerGameLobby() { super(true); - addSlot(new LobbySlot(LobbySlotType.LOCAL, localName(), localAvatarIndices()[0], 0, true, false, Collections.emptySet())); - addSlot(new LobbySlot(LobbySlotType.OPEN, null, -1, 1, false, false, Collections.emptySet())); + addSlot(new LobbySlot(LobbySlotType.LOCAL, localName(), localAvatarIndices()[0], 0, true, false, Collections.emptySet())); + addSlot(new LobbySlot(LobbySlotType.OPEN, null, -1, 1, false, false, Collections.emptySet())); } public int connectPlayer(final String name, final int avatarIndex) { diff --git a/forge-gui/src/main/java/forge/planarconquest/ConquestCommander.java b/forge-gui/src/main/java/forge/planarconquest/ConquestCommander.java index 74048caf5b2..6bff8b41e60 100644 --- a/forge-gui/src/main/java/forge/planarconquest/ConquestCommander.java +++ b/forge-gui/src/main/java/forge/planarconquest/ConquestCommander.java @@ -29,10 +29,7 @@ public class ConquestCommander implements InventoryItem, IXmlWritable { @Override public boolean apply(PaperCard pc) { CardRules rules = pc.getRules(); - if (rules.canBeCommander() || rules.getType().isPlaneswalker()) { - return false; //prevent including additional commanders or planeswalkers in starting deck - } - return true; + return !rules.canBeCommander() && !rules.getType().isPlaneswalker(); //prevent including additional commanders or planeswalkers in starting deck } })), false), null); } diff --git a/forge-gui/src/main/java/forge/planarconquest/ConquestPreferences.java b/forge-gui/src/main/java/forge/planarconquest/ConquestPreferences.java index 8e7bec55fe3..e5878551219 100644 --- a/forge-gui/src/main/java/forge/planarconquest/ConquestPreferences.java +++ b/forge-gui/src/main/java/forge/planarconquest/ConquestPreferences.java @@ -27,7 +27,7 @@ public class ConquestPreferences extends PreferencesStore predicate; private String caption; - private AEtherFilter(final FSkinProp skinProp0, final Predicate predicate0, final String caption0) { + AEtherFilter(final FSkinProp skinProp0, final Predicate predicate0, final String caption0) { skinProp = skinProp0; predicate = predicate0; caption = caption0; @@ -509,8 +509,7 @@ public class ConquestUtil { public boolean apply(PaperCard card) { int cardCmc = card.getRules().getManaCost().getCMC(); if (cardCmc < cmcMin) { return false; } - if (cmcMax != -1 && cardCmc > cmcMax) { return false; } - return true; + return cmcMax == -1 || cardCmc <= cmcMax; } } } diff --git a/forge-gui/src/main/java/forge/player/GamePlayerUtil.java b/forge-gui/src/main/java/forge/player/GamePlayerUtil.java index 448670a30ce..a7a93d85006 100644 --- a/forge-gui/src/main/java/forge/player/GamePlayerUtil.java +++ b/forge-gui/src/main/java/forge/player/GamePlayerUtil.java @@ -17,7 +17,7 @@ import forge.util.MyRandom; import forge.util.gui.SOptionPane; public final class GamePlayerUtil { - private GamePlayerUtil() { }; + private GamePlayerUtil() { } private static final LobbyPlayer guiPlayer = new LobbyPlayerHuman("Human"); public static final LobbyPlayer getGuiPlayer() { diff --git a/forge-gui/src/main/java/forge/player/HumanCostDecision.java b/forge-gui/src/main/java/forge/player/HumanCostDecision.java index 02e4ec6c80b..c283bf771e5 100644 --- a/forge-gui/src/main/java/forge/player/HumanCostDecision.java +++ b/forge-gui/src/main/java/forge/player/HumanCostDecision.java @@ -159,7 +159,7 @@ public class HumanCostDecision extends CostDecisionMakerBase { return PaymentDecision.card(discarded); } - final String type = new String(discardType); + final String type = discardType; final String[] validType = type.split(";"); hand = CardLists.getValidCards(hand, validType, player, source, ability); @@ -860,7 +860,7 @@ public class HumanCostDecision extends CostDecisionMakerBase { } if (num == 0) { return PaymentDecision.number(0); - }; + } inp = new InputSelectCardsFromList(controller, num, num, hand, ability); inp.setMessage("Select %d more " + cost.getDescriptiveType() + " card(s) to reveal."); diff --git a/forge-gui/src/main/java/forge/player/HumanPlay.java b/forge-gui/src/main/java/forge/player/HumanPlay.java index c1e1325af7d..fec7ac0844a 100644 --- a/forge-gui/src/main/java/forge/player/HumanPlay.java +++ b/forge-gui/src/main/java/forge/player/HumanPlay.java @@ -514,7 +514,7 @@ public class HumanPlay { } } else if (part instanceof CostPutCardToLib) { - int amount = Integer.parseInt(((CostPutCardToLib) part).getAmount()); + int amount = Integer.parseInt(part.getAmount()); final ZoneType from = ((CostPutCardToLib) part).getFrom(); final boolean sameZone = ((CostPutCardToLib) part).isSameZone(); CardCollectionView listView; @@ -576,7 +576,7 @@ public class HumanPlay { part.payAsDecided(p, pd, sourceAbility); } else if (part instanceof CostGainControl) { - int amount = Integer.parseInt(((CostGainControl)part).getAmount()); + int amount = Integer.parseInt(part.getAmount()); CardCollectionView list = CardLists.getValidCards(p.getGame().getCardsIn(ZoneType.Battlefield), part.getType(), p, source); boolean hasPaid = payCostPart(controller, sourceAbility, (CostPartWithList)part, amount, list, "gain control." + orString); if (!hasPaid) { return false; } diff --git a/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java b/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java index d02362f46cc..84c5bd0555d 100644 --- a/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java +++ b/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java @@ -335,7 +335,7 @@ public class HumanPlaySpellAbility { for (final String aVar : announce.split(",")) { final String varName = aVar.trim(); if ("CreatureType".equals(varName)) { - final String choice = pc.chooseSomeType("Creature", ability, CardType.Constant.CREATURE_TYPES, Collections.emptyList()); + final String choice = pc.chooseSomeType("Creature", ability, CardType.Constant.CREATURE_TYPES, Collections.emptyList()); ability.getHostCard().setChosenType(choice); } if ("ChooseNumber".equals(varName)) { diff --git a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java index c7fefdc1b5d..16bf87f71b2 100644 --- a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java +++ b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java @@ -776,7 +776,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont } else { toBottom = game.getCardList(getGui().many("Select cards to be put on the bottom of your library", "Cards to put on the bottom", -1, CardView.getCollection(topN), null)); - topN.removeAll((Collection) toBottom); + topN.removeAll(toBottom); if (topN.isEmpty()) { toTop = null; } else if (topN.size() == 1) { @@ -814,7 +814,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont } else { toGrave = game.getCardList(getGui().many("Select cards to be put into the graveyard", "Cards to put in the graveyard", -1, CardView.getCollection(topN), null)); - topN.removeAll((Collection) toGrave); + topN.removeAll(toGrave); if (topN.isEmpty()) { toTop = null; } else if (topN.size() == 1) { @@ -1404,7 +1404,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont final boolean call) { final String[] labelsSrc = call ? new String[] { "heads", "tails" } : new String[] { "win the flip", "lose the flip" }; - final ImmutableList.Builder strResults = ImmutableList.builder(); + final ImmutableList.Builder strResults = ImmutableList.builder(); for (int i = 0; i < results.length; i++) { strResults.add(labelsSrc[results[i] ? 0 : 1]); } @@ -1665,8 +1665,8 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont boolean preselect = FModel.getPreferences() .getPrefBoolean(FPref.UI_PRESELECT_PREVIOUS_ABILITY_ORDER); orderedSAVs = getGui().order("Reorder simultaneous abilities", "Resolve first", 0, 0, - preselect ? Lists.newArrayList() : orderedSAVs, - preselect ? orderedSAVs : Lists.newArrayList(), null, false); + preselect ? Lists.newArrayList() : orderedSAVs, + preselect ? orderedSAVs : Lists.newArrayList(), null, false); } else { orderedSAVs = getGui().order("Select order for simultaneous abilities", "Resolve first", orderedSAVs, null); @@ -1829,10 +1829,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont return false; } final Player priorityPlayer = game.getPhaseHandler().getPriorityPlayer(); - if (priorityPlayer == null || priorityPlayer != player) { - return false; - } - return true; + return priorityPlayer != null && priorityPlayer == player; } @Override @@ -2741,7 +2738,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont for (final Player player : game.getPlayers()) { if (player.getId() == entity.getKey()) { found = true; - rememberedActions.add(Pair.of((GameEntityView) player.getView(), true)); + rememberedActions.add(Pair.of(player.getView(), true)); break; } } @@ -2749,7 +2746,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont for (final Card card : cards) { if (card.getId() == entity.getKey()) { found = true; - rememberedActions.add(Pair.of((GameEntityView) card.getView(), false)); + rememberedActions.add(Pair.of(card.getView(), false)); break; } } diff --git a/forge-gui/src/main/java/forge/player/PlayerZoneUpdates.java b/forge-gui/src/main/java/forge/player/PlayerZoneUpdates.java index 7d48de0651f..17f71d1e6e2 100644 --- a/forge-gui/src/main/java/forge/player/PlayerZoneUpdates.java +++ b/forge-gui/src/main/java/forge/player/PlayerZoneUpdates.java @@ -12,7 +12,7 @@ import forge.game.player.PlayerView; public class PlayerZoneUpdates implements Iterable, Serializable { private static final long serialVersionUID = 7023549243041119023L; - private final Map updates = Collections.synchronizedMap(Maps.newHashMap()); + private final Map updates = Collections.synchronizedMap(Maps.newHashMap()); public PlayerZoneUpdates() { } diff --git a/forge-gui/src/main/java/forge/properties/ForgeConstants.java b/forge-gui/src/main/java/forge/properties/ForgeConstants.java index 342d2184991..7ff4316eb99 100644 --- a/forge-gui/src/main/java/forge/properties/ForgeConstants.java +++ b/forge-gui/src/main/java/forge/properties/ForgeConstants.java @@ -306,7 +306,7 @@ public final class ForgeConstants { public static final String GRAVEYARD_ORDERING_ALWAYS = "Always"; // Set boolean constant for landscape mode for gdx port - public static final boolean isGdxPortLandscape = FileUtil.doesFileExist(ASSETS_DIR + "switch_orientation.ini") ? true : false; + public static final boolean isGdxPortLandscape = FileUtil.doesFileExist(ASSETS_DIR + "switch_orientation.ini"); public enum CounterDisplayLocation { diff --git a/forge-gui/src/main/java/forge/properties/ForgePreferences.java b/forge-gui/src/main/java/forge/properties/ForgePreferences.java index d4a35b4db97..9aa8e691bd0 100644 --- a/forge-gui/src/main/java/forge/properties/ForgePreferences.java +++ b/forge-gui/src/main/java/forge/properties/ForgePreferences.java @@ -240,7 +240,7 @@ public class ForgePreferences extends PreferencesStore { private final String strDefaultVal; - private FPref(final String s0) { + FPref(final String s0) { this.strDefaultVal = s0; } diff --git a/forge-gui/src/main/java/forge/properties/ForgeProfileProperties.java b/forge-gui/src/main/java/forge/properties/ForgeProfileProperties.java index 25a8dbce4dd..17711e08509 100644 --- a/forge-gui/src/main/java/forge/properties/ForgeProfileProperties.java +++ b/forge-gui/src/main/java/forge/properties/ForgeProfileProperties.java @@ -74,7 +74,7 @@ public class ForgeProfileProperties { cardPicsDir = getDir(props, CARD_PICS_DIR_KEY, cacheDir + "pics" + File.separator + "cards" + File.separator); cardPicsSubDirs = getMap(props, CARD_PICS_SUB_DIRS_KEY); decksDir = getDir(props, DECKS_DIR_KEY, userDir + "decks" + File.separator); - decksConstructedDir = getDir(props, DECKS_CONSTRUCTED_DIR_KEY, decksDir + "constructed" + File.separator);; + decksConstructedDir = getDir(props, DECKS_CONSTRUCTED_DIR_KEY, decksDir + "constructed" + File.separator); serverPort = getInt(props, SERVER_PORT_KEY, 36743); // "Forge" using phone keypad //ensure directories exist diff --git a/forge-gui/src/main/java/forge/puzzle/Puzzle.java b/forge-gui/src/main/java/forge/puzzle/Puzzle.java index b513fc0732a..39904881b7e 100644 --- a/forge-gui/src/main/java/forge/puzzle/Puzzle.java +++ b/forge-gui/src/main/java/forge/puzzle/Puzzle.java @@ -222,6 +222,6 @@ public class Puzzle extends GameState implements InventoryItem, Comparable sortedDuels = new EnumMapOfLists<>(QuestEventDifficulty.class, CollectionSuppliers.arrayLists()); + private final MapOfLists sortedDuels = new EnumMapOfLists<>(QuestEventDifficulty.class, CollectionSuppliers.arrayLists()); private final IStorage allDuels; /** diff --git a/forge-gui/src/main/java/forge/quest/QuestEventLDADuelManager.java b/forge-gui/src/main/java/forge/quest/QuestEventLDADuelManager.java index 0fdc9660461..eadd2ed28d4 100644 --- a/forge-gui/src/main/java/forge/quest/QuestEventLDADuelManager.java +++ b/forge-gui/src/main/java/forge/quest/QuestEventLDADuelManager.java @@ -42,7 +42,7 @@ import java.util.List; public class QuestEventLDADuelManager implements QuestEventDuelManagerInterface { private List archetypes; - private final MapOfLists sortedDuels = new EnumMapOfLists<>(QuestEventDifficulty.class, CollectionSuppliers.arrayLists()); + private final MapOfLists sortedDuels = new EnumMapOfLists<>(QuestEventDifficulty.class, CollectionSuppliers.arrayLists()); private GameFormat baseFormat; public QuestEventLDADuelManager(GameFormat baseFormat){ diff --git a/forge-gui/src/main/java/forge/quest/QuestRewardCard.java b/forge-gui/src/main/java/forge/quest/QuestRewardCard.java index 024fd3c56bc..91b008abbd4 100644 --- a/forge-gui/src/main/java/forge/quest/QuestRewardCard.java +++ b/forge-gui/src/main/java/forge/quest/QuestRewardCard.java @@ -25,9 +25,9 @@ public abstract class QuestRewardCard implements IQuestRewardCard { if (s.startsWith("desc:") || s.startsWith("Desc:")) { final String[] tmp = s.split(":"); if (tmp.length > 1) { - buildDesc = new String(tmp[1]); + buildDesc = tmp[1]; } else { - buildDesc = new String(); + buildDesc = ""; } } else if (buildDesc != null) { if (s.contains(":")) { diff --git a/forge-gui/src/main/java/forge/quest/QuestUtil.java b/forge-gui/src/main/java/forge/quest/QuestUtil.java index 46ab8eda6fa..63be897d389 100644 --- a/forge-gui/src/main/java/forge/quest/QuestUtil.java +++ b/forge-gui/src/main/java/forge/quest/QuestUtil.java @@ -677,7 +677,7 @@ public class QuestUtil { } public static String getDeckConformanceProblems(Deck deck){ - String errorMessage = GameType.Quest.getDeckFormat().getDeckConformanceProblem(deck);; + String errorMessage = GameType.Quest.getDeckFormat().getDeckConformanceProblem(deck); if(errorMessage != null) return errorMessage; //return immediately if the deck does not conform to quest requirements diff --git a/forge-gui/src/main/java/forge/quest/QuestUtilUnlockSets.java b/forge-gui/src/main/java/forge/quest/QuestUtilUnlockSets.java index d7881334f57..3e6a5d0fe29 100644 --- a/forge-gui/src/main/java/forge/quest/QuestUtilUnlockSets.java +++ b/forge-gui/src/main/java/forge/quest/QuestUtilUnlockSets.java @@ -130,7 +130,7 @@ public class QuestUtilUnlockSets { * * @return unmodifiable list, assorted sets that are not currently in the format. */ - private static final List emptyEditions = ImmutableList.of(); + private static final List emptyEditions = ImmutableList.of(); private static final EnumSet unlockableSetTypes = EnumSet.of(CardEdition.Type.CORE, CardEdition.Type.EXPANSION, CardEdition.Type.REPRINT, CardEdition.Type.STARTER); diff --git a/forge-gui/src/main/java/forge/quest/SellRules.java b/forge-gui/src/main/java/forge/quest/SellRules.java index 8d8ca9e8d45..36de28da65f 100644 --- a/forge-gui/src/main/java/forge/quest/SellRules.java +++ b/forge-gui/src/main/java/forge/quest/SellRules.java @@ -60,11 +60,7 @@ public class SellRules { if (quest.getWin() < minWins) { return false; } - if (quest.getDifficulty() < minDifficulty || quest.getDifficulty() > maxDifficulty) { - return false; - } - - return true; + return quest.getDifficulty() >= minDifficulty && quest.getDifficulty() <= maxDifficulty; } /** diff --git a/forge-gui/src/main/java/forge/quest/StartingPoolType.java b/forge-gui/src/main/java/forge/quest/StartingPoolType.java index 513a49f1da0..dc1bd6dbe3c 100644 --- a/forge-gui/src/main/java/forge/quest/StartingPoolType.java +++ b/forge-gui/src/main/java/forge/quest/StartingPoolType.java @@ -12,7 +12,7 @@ public enum StartingPoolType { private final String caption; - private StartingPoolType(String caption0) { + StartingPoolType(String caption0) { caption = caption0; } diff --git a/forge-gui/src/main/java/forge/quest/bazaar/QuestItemType.java b/forge-gui/src/main/java/forge/quest/bazaar/QuestItemType.java index 86ac871228b..07cb6165f9e 100644 --- a/forge-gui/src/main/java/forge/quest/bazaar/QuestItemType.java +++ b/forge-gui/src/main/java/forge/quest/bazaar/QuestItemType.java @@ -53,8 +53,8 @@ public enum QuestItemType { private final Class bazaarControllerClass; private final Class modelClass; - private QuestItemType(final String key, final Class controllerClass0, - final Class modelClass0) { + QuestItemType(final String key, final Class controllerClass0, + final Class modelClass0) { this.saveFileKey = key; this.bazaarControllerClass = controllerClass0; this.modelClass = modelClass0; diff --git a/forge-gui/src/main/java/forge/sound/EventVisualizer.java b/forge-gui/src/main/java/forge/sound/EventVisualizer.java index 057293b7e60..0f2cc2c71fd 100644 --- a/forge-gui/src/main/java/forge/sound/EventVisualizer.java +++ b/forge-gui/src/main/java/forge/sound/EventVisualizer.java @@ -301,7 +301,7 @@ public class EventVisualizer extends IGameEventVisitor.Base imp if (null != c) { effect = c.getSVar("SoundEffect"); } - return effect.isEmpty() ? false : true; + return !effect.isEmpty(); } diff --git a/forge-gui/src/main/java/forge/sound/IAudioClip.java b/forge-gui/src/main/java/forge/sound/IAudioClip.java index 1fc08bb123c..479eccc4da3 100644 --- a/forge-gui/src/main/java/forge/sound/IAudioClip.java +++ b/forge-gui/src/main/java/forge/sound/IAudioClip.java @@ -1,8 +1,8 @@ package forge.sound; public interface IAudioClip { - public void play(); - public boolean isDone(); - public void stop(); - public void loop(); + void play(); + boolean isDone(); + void stop(); + void loop(); } diff --git a/forge-gui/src/main/java/forge/sound/MusicPlaylist.java b/forge-gui/src/main/java/forge/sound/MusicPlaylist.java index c5cbbb3d1ea..d5acc57718d 100644 --- a/forge-gui/src/main/java/forge/sound/MusicPlaylist.java +++ b/forge-gui/src/main/java/forge/sound/MusicPlaylist.java @@ -14,7 +14,7 @@ public enum MusicPlaylist { private int mostRecentTrackIdx = -1; private String[] filenames; - private MusicPlaylist(String subDir0) { + MusicPlaylist(String subDir0) { subDir = subDir0; } diff --git a/forge-gui/src/main/java/forge/tournament/TournamentData.java b/forge-gui/src/main/java/forge/tournament/TournamentData.java index 66c76ffd74e..c045179161f 100644 --- a/forge-gui/src/main/java/forge/tournament/TournamentData.java +++ b/forge-gui/src/main/java/forge/tournament/TournamentData.java @@ -57,7 +57,7 @@ public class TournamentData { public void stamp() { final DateFormat dateFormat = new SimpleDateFormat("MM-dd-yy, H:m"); - timestamp = dateFormat.format(new Date()).toString(); + timestamp = dateFormat.format(new Date()); } /** Resets a Tournament data to an unplayed state, then stamps and saves. */ diff --git a/forge-gui/src/main/java/forge/tournament/system/TournamentSwiss.java b/forge-gui/src/main/java/forge/tournament/system/TournamentSwiss.java index a49c54fae00..31c9ae300ff 100644 --- a/forge-gui/src/main/java/forge/tournament/system/TournamentSwiss.java +++ b/forge-gui/src/main/java/forge/tournament/system/TournamentSwiss.java @@ -57,7 +57,7 @@ public class TournamentSwiss extends AbstractTournament { if (byePlayer != null) { groupPlayers.remove(byePlayer); - TournamentPairing byePair = new TournamentPairing(activeRound, Lists.newArrayList(byePlayer)); + TournamentPairing byePair = new TournamentPairing(activeRound, Lists.newArrayList(byePlayer)); byePair.setBye(true); activePairings.add(byePair); } diff --git a/forge-gui/src/main/java/forge/util/ImageFetcher.java b/forge-gui/src/main/java/forge/util/ImageFetcher.java index fa08293340f..cf219331dc8 100644 --- a/forge-gui/src/main/java/forge/util/ImageFetcher.java +++ b/forge-gui/src/main/java/forge/util/ImageFetcher.java @@ -118,7 +118,7 @@ public abstract class ImageFetcher { protected abstract Runnable getDownloadTask(String[] toArray, String destPath, Runnable notifyObservers); - public static interface Callback { - public void onImageFetched(); + public interface Callback { + void onImageFetched(); } } \ No newline at end of file diff --git a/pom.xml b/pom.xml index d3d17cf28d0..6a943a4ba4f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ forge pom Forge Parent - 1.6.28-SNAPSHOT + 1.6.29-SNAPSHOT Forge lets you play the card game Magic: The Gathering against a computer opponent using all of the rules.