Cleared commits

This commit is contained in:
baisebaoma 2024-04-09 14:33:15 +08:00
commit 4346141c83
276 changed files with 26845 additions and 0 deletions

53
.gitignore vendored Normal file
View File

@ -0,0 +1,53 @@
# Compiled Lua sources
luac.out
# luarocks build files
*.src.rock
*.zip
*.tar.gz
# Object files
*.o
*.os
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
*.def
*.exp
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# original images and losslesscut project files
*.webp
*.lls
# macOS files
.DS_Store
# vscode files
.vscode/
# idea files
.idea/

674
LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 <https://www.gnu.org/licenses/>.
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:
<program> Copyright (C) <year> <name of author>
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
<https://www.gnu.org/licenses/>.
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
<https://www.gnu.org/licenses/why-not-lgpl.html>.

63
README.md Normal file
View File

@ -0,0 +1,63 @@
# 《新月杀》简浴包
[《新月杀FreeKill](https://gitee.com/notify-ctrl/FreeKill)是一款开源、支持自定义的三国杀联机软件。本仓库是新月杀的一个扩展包,其中包含我和我的好朋友们的原创武将!现在也接受了来自其他人的投稿,截至 2024 年 4 月 6 日已有 35 名武将。
之所以叫作简浴包,是因为我们曾经踢足球时自称“监狱队”,但用“监狱”来形容一个绝大多数是真人二创的扩展包有些不合适。本扩展包的第一个武将是简自豪,故名。我们的关注点有:足球、英雄联盟等。所有设计均由我 [@baisebaoma](https://gitee.com/baisebaoma) 实现。
本扩展包在新月杀软件中的名字为“简浴”0.4.5版本后会显示为“谏喻”,这是因为包名和技能名重合了)。
## 编写经验
如果您也想学习编写《新月杀》武将等,我写了一些我自己的心得体会在 [TUTORIAL.md](./TUTORIAL.md)(虽然很久没维护了) 里,您可以结合代码去看看。希望对您有所帮助。
## 强度对标
其实本来本包对标的是风林火山强度。由于进了普遍强度较高的活动服,为了能让这些武将也能获得选取率、让玩家在选用它们后不至于获得太强的挫败感,所以增强了一些。您应该能从设计中看出一些为了平衡而做的限制。我们包和其他包相比是不算阴间的,甚至强度非常低。所以适合和官将一起玩。有的投稿投过来太超标了我也全部削弱过了。
## 游玩
1. 请前往 https://gitee.com/notify-ctrl/FreeKill/releases 下载最新版本的《新月杀》。
2. 如果您没有自己的新月杀服务器,本扩展包已上线《新月杀》活动服:<a href="huosan.top">huosan.top</a>,欢迎使用!
3. 如果您有自己的新月杀服务器,请输入 `install https://gitee.com/baisebaoma/jianyu` 添加本扩展包即可。您的服务器上必须至少开启[神话再临](https://gitee.com/notify-ctrl/shzl)、[OL](https://gitee.com/qsgs-fans/ol)扩展包才可正常游玩本包。
4. 特别注意:“高手”系列武将是我为别的扩展包的武将开发的专门针对他们的武将(整活用的)。但即使您不开这些包,它们也一样可以玩。
## 已实现武将
此处更新日期为2024/4/6。由于篇幅所限仅展示武将名称请在游戏中查看技能。
| 简自豪 | 简自豪 | 李元浩 | 高天亮 | 阿威罗 | 杨藩 | 高天亮 | 雷电将军 | 神里绫人 |
| -------- | -------- | ------ | -------- | -------- | -------- | -------- | ---------- | ---------- |
| 刘仙 | 藿藿 | 银枝 | 原神高手 | 雀魂高手 | 萌包高手 | 联盟高手 | 赌徒 | 考公大学生 |
| 考公专家 | 絮雨 | 简裴秀 | 观者 | 简郭嘉 | 狐坂若藻 | 简骆统 | 切尔西伯爵 | 御稜名草 |
| 铁甲战士 | 久田泉奈 | 战士鸽 | 圆角大师 | 谋司马懿 | 浦和花子 | | | |
## 发现了 bug 或有建议?
请提交 PR 或 Issue或发送电子邮件至 freekill.jianyu@gmail.com。感谢
## 投稿?
您可以投稿给我如果过审并制作完成您的宝贵设计就可以变成真正可玩的武将在《新月杀》中大展拳脚了。你出设计我写代码请看下面的投稿须知3.24更新):
1. **免费劳动,请尊重彼此的时间!**您确认对《三国杀》有足够的游戏理解、花费了足够多的时间精力设计、已是终版且您不再修改。禁止投稿一拍脑袋设计出来的、数值怪、机制怪、纯加强官将但不改变玩法请对标官将、《新月杀》主服双阴双将阴间房或活动服PVP房强度PVP房主禁了逆天将
2. 请提供**立绘**、**名称**、**体力值**、**性别**、**势力**、**武将称号**、**设计者名**、**配音演员名**(如提供了配音)、**画师名**等信息,如有配音请给出**配音文件**以及对应的**台词**
3. 请勿超过 3 个技能,每个技能不得超过 100 字(含标点),描述规范、无歧义;
4. **投稿≠会制作**。若过审或开发完成,我们会**通过邮件**联系您;
5. 我们保留因任何原因修改任何内容的权利,包括但不限于:对技能的增/删、削弱/增强、对其他任何信息的修改、因版权等原因移除您的武将。
请发送邮件至 [freekill.jianyu@gmail.com](mailto:freekill.jianyu@gmail.com),标题:**投稿_武将名称**,恕不接受 QQ 私信联系。
## 免责声明
本包遵循 GPL-3.0 协议开源。
本包不作任何盈利使用。
本包与《三国杀》官方没有任何关系。本人和武将设计者们对本包中所提及的真实人物没有任何贬损、矮化、侮辱、歧视的想法,出于对他们的喜爱才制作他们的同人作品。
本包《行测》试题题目及答案均来源于 [公开真题网](https://www.gkzenti.cn/),仅供学习之用,不保证题目和答案准确。题干及答案的所有文字不代表本人和武将设计者们的任何立场。
如有疑问或侵权,请发送邮件至 [freekill.jianyu@gmail.com](mailto:freekill.jianyu@gmail.com),我会立刻处理。

432
TUTORIAL.md Normal file
View File

@ -0,0 +1,432 @@
# 简浴包编写心得
[toc]
## 前言
首先感谢所有为本包做过贡献的人:谢谢活动服愿意把我的包放在贵服游玩,没有你们我这个包就没有人玩,没有人玩就没有意义;感谢设计师们;当然,还有感谢你愿意点开这个包、这篇文章。我也很高兴把这些我学到的知识分享给你。
本人在 GitHub 上找到了新月杀项目,认为代码非常清晰并且易于扩展,从 2023 年 11 月 31 日开始接触扩展包开发,实现了武将若干,已经有一些经验了。这个文档是为了方便您想参考本扩展包来制作自己的扩展包的。我会尽可能使用通俗易懂的话,每个武将会讲一些内容。你可以先去扫一眼 `README.md` 知道我这个包里有什么武将和技能。
我纯粹是抛砖引玉,写的代码如果不够优美、不够简洁,请多多包涵。期待您能够产出更加优秀的代码!
如果您是通过这个项目来接触计算机和编程,那么恭喜你,我认为这是一条非常不错的路径。这是将您的兴趣和学习新知识结合在一起的一条路径,您不仅能在制作武将的过程中获得成就感,还能学习到非常多和编程强相关的概念,其乐无穷~~虽然 debug 非常折磨就是了~~。
祝您编程愉快!
## 学习路线推荐
如果您有想制作的技能,新月杀中几乎一定有一个类似的技能(或一部分)已经被别人写过了,但是直接去阅读那个技能的代码并尝试抄过来的话会非常困难!因为您可能不知道很多部分是什么意思,如:`on_trigger` 代表什么含义?`Room:sendLog` 函数里的 `from` 参数到底是传 `number` 类型还是 `ServerPlayer` 类型?为什么一个技能又有 `can_trigger` 又有 `on_refresh`
不要着急!心急吃不了热豆腐,编程就是个需要慢慢学习的东西,并且是呈线性收益的,付出的时间越多,获得的经验就越多。没有编程基础就想快速写出武将,就像从没碰过钢琴但想明天就能弹《野蜂飞舞》一样困难。我们一点一点来!
推荐您的学习路线为:
1. 如果您对 Lua 和编程没有任何基础,建议先学习一些编程知识,如:变量、判断、循环、面向对象等。不要小看这一步,有扎实的编程基础后,会节省后面非常多不必要的 debug 时间;
2. 完整阅读完新月杀的 Docs 文件夹,那里有不错的介绍。接手任何一个项目前我都建议您大致读一下它的文档,然后再慢慢开发,不懂的地方再看文档。不过新月杀的文档短小精炼,我认为完整阅读不花时间,并且收获颇丰,所以建议先完整阅读之;
3. 打开 `/packages/standard`,阅读并理解标准包武将的代码;
4. 连接到活动服服务器 `huosan.top`,下载所有其他的扩展包,包含 DIY 武将!这些技能里,说不定有你用得上的。
现在你已经有基础知识了,理解其他人的代码并运用到自己的设计中~~并且没有 bug~~ 就会非常简单了。
## 测试
测试是非常重要的一步,甚至可能比写代码本身还重要。根据文献(我忘了哪里写的了),写代码大概是三成时间,反而是 debug 和测试占的时间到了七成。但我现在没想好这里写什么,下次再来看看吧,说不定我就写了些东西放这里了。
## 查阅资料
我目前知道的最好的方法是:使用 VS Code 直接打开 `/FreeKill/` 文件夹,然后想搜什么都能搜到。
## 命名规范
这是我的个人习惯。将你自己的技能都加一个前缀(如简浴包所有的技能名都有`jy_`前缀)。这是为了防止重名。在我制作武将李元浩的技能【虎啸】时,其他扩展包已经有一个叫作`huxiao`的技能了,所以报错;简浴包的名字一开始用的是`jianyu`,但是`jianyu`已经在其他包中被对应了`谏喻`这个技能名(所以我后来改成了`jianyu_standard`,意思是简浴标准包,用来和`jianyu_ex`简浴界限突破包区分)。我决定在我自己的扩展包中全部加前缀,尽量避免和其他扩展包重名。
## 武将概要
我们以这段代码为例吧!以下是一个武将的所有部分。
```Lua
-- 第二代简自豪
local tym__jianzihao = General(extension, "tym__jianzihao", "qun", 3)
local jy_sanjian = fk.CreateTriggerSkill{
-- 技能略
}
local jy_xizao_2 = fk.CreateTriggerSkill{
-- 技能略
}
tym__jianzihao:addSkill(jy_kaiju_2)
tym__jianzihao:addSkill(jy_sanjian)
tym__jianzihao:addSkill("hongyan") -- 这个技能要加风火林山包才能使用!
tym__jianzihao:addSkill("jy_zouwei")
tym__jianzihao:addSkill("jy_shengnu")
tym__jianzihao:addSkill(jy_xizao_2)
Fk:loadTranslationTable{
["tym__jianzihao"] = "界简自豪",
["jy_kaiju_2"] = "开局",
[":jy_kaiju_2"] = "出牌阶段限一次,你选择若干名角色,依次视为你对其使用一张【顺手牵羊】,然后被其使用一张【杀】。",
["$jy_kaiju_21"] = "不是啊我炸一对鬼的时候我在打什么打一对10。一对10他四个9炸我我不输了吗",
-- 略
["jy_sanjian"] = "三件",
[":jy_sanjian"] = [[锁定技出牌阶段开始时若装备区有且仅有3张牌你视为使用一张【酒】和一张【无中生有】。]],
["$jy_sanjian1"] = "也不是稳赢吧,我觉得赢了!",
["jy_xizao_2"] = "洗澡",
[":jy_xizao_2"] = "限定技处于濒死状态且装备区有牌时你可以弃置所有装备区的牌、将体力恢复至1然后每以此法弃置一张牌你摸一张牌。",
["$jy_xizao_21"] = "呃啊啊啊啊啊啊啊!!",
-- 略
["~tym__jianzihao"] = "好像又要倒下了……",
}
```
在这段代码中,首先你需要定义一个 General武将然后你需要编写这个武将对应的技能以及添加这些技能到这个武将最后你需要为这个武将添加翻译表。
定义武将类,就是告诉新月杀:我这个包里有一个武将,名字叫啥,体力是多少,体力上限是多少,性别是什么,势力是什么。新月杀知道了,就会给你的包加一个这个武将。不过现在还没技能。
你得先定义武将才能给它加技能,当然你得先定义技能才能把技能加给武将。所以其实不一定要先定义武将再定义技能再添加技能给武将(很多其他的扩展包是这么做的,简浴包也是如此,因为我觉得更符合程序员逻辑),而是你也可以先定义技能再定义武将再添加技能给武将(标准包里就是这么做的)。
翻译表是把一些用于代码里面简洁的短字符串翻译成中文的东西。其实在任何一个项目里,我们都不建议直接把字符串写似在代码里,而是像新月杀一样做翻译表将它们独立出来会是更好的选择。既降低耦合度,又提升代码易读性,还方便以后修改和添加多语言之类的。你应该看上面的例子就能看得懂这个翻译表里哪些对应什么内容,在这里就不赘述了。
### 编写技能
这部分挺复杂的,在 FreeKill 官方文档里有说明,请你先去阅读那里。我在这里再小小复习一下好了,对于一个触发技`fk.CreateTriggerSkill`来说,首先它会在`can_refresh`描述的时机里被触发,然后如果`can_refresh`(这个参数一般是用来清理一些标记用的)为真,就执行`on_refresh`函数;如果`can_trigger`(这个技能可以发动的条件)为真,就按照次序执行`on_trigger`(它可以发动时一定要做的一些事情)、`on_cost`(在询问这个技能是否要发动时要做的事情)、`on_use`(这个技能要做的事情)函数。
我需要强调的一点是:所有部分都是可以省略的。在官方文档以及代码中,新手可能会看不懂,【遗计】监听 `fk.Damaged` (伤害造成后)事件,但为什么代码看起来这个事件就可以直接触发摸牌?难道所有人受到伤害都可以触发【遗计】吗?这是因为郭嘉的【遗计】在官方代码中省略了 `can_trigger`、`on_trigger` 两个参数。省略的意思是默认的参数就已经能满足要求了。默认参数就已经包含了判断下列条件:确实是我受到的伤害、我拥有这个技能。`on_cost` 中写了每受到一点伤害就要发动一次(它的默认参数是:只发动一次),而 `on_use` 中写了他需要摸两张牌并且分配之。
其实理解了这里,基本就能看懂很多技能了。
#### `Fk``fk`
作为扩展包编写者不需要太在意这两个是啥,你只需要把它们看作全局变量,知道这里面有可以用的东西就可以了。这两个是不一样的东西,所以不要混用。
有的地方是一定要用 `Fk` 的。比如:
```Lua
card_filter = function(self, to_select, selected)
return #selected == 0 and
Fk:currentRoom():getCardArea(to_select) ~= Card.PlayerEquip
end,
```
其实你会发现,其他的地方,我们需要使用 `Room` 时,都是先 `local room = player.room` 就可以了,但是在这里必须要用 `Fk:currentRoom()`,这是因为传入 `card_filter` 这个属性的函数是不接收 `Player` 类的,自然也就无法使用 `player.room`。这里只能用这种方法来找到 `Room` 并使用它对应的函数。
### 添加技能
#### 直接技能
添加技能如你所见,使用 `General:addSkill()` 就可以了。特别注意:对于一个技能,第一个添加它的武将需要用它的变量名来添加,而其他武将添加它需要使用它的名字的字符串来添加,如你上文所见。
举例:我想设计一个“原神技”,名字叫 `jy_yuanshen`,也就是说所有基于原神角色制作的武将都会有完全相同的这个技能。这种情况下,我需要先让我包里的第一个武将使用变量名来获得这个技能(如:`jy_raiden:addSkill(jy_yuanshen)`),然后其他武将使用它的名字来获得这个技能(如:`jy_ayato:addSkill("jy_yuanshen")`)。
这两种添加技能的多态方法混用时,似乎不能指定技能的显示顺序。不过我觉得没什么所谓。如果你实在介意这个,你可以复制粘贴一遍那个技能,改个名字就行了(如果你要改配音的话,也可以一并修改之)。
#### 相关技能
有的时候也会使用 `General:addRelatedSkill()`,这个方法的目的是在武将一览页面中在末尾以紫色提示这个武将可能会拥有这个技能,而且这个技能在游戏开始时不属于自己(如邓艾【急袭】),不会对武将强度和技能产生什么效果。
请注意,你得保证你拥有这个包的服务器上拥有这些对应技能,不然会报错,因为找不到这个技能在哪。
```Lua
tym__kgdxs:addSkill(jy_zuoti)
tym__kgdxs:addSkill(jy_jieju)
tym__kgdxs:addRelatedSkill("jizhi")
tym__kgdxs:addRelatedSkill("kanpo")
tym__kgdxs:addRelatedSkill("xiangle")
tym__kgdxs:addRelatedSkill("jy_yuyu")
tym__kgdxs:addRelatedSkill("jy_hongwen")
```
以这段考公大学生的代码为例,考公大学生自己开局就有的技能是【做题】(`jy_zuoti`)、【熬夜】(`jy_jieju`),他的使命技有可能会使他获得【集智】、【看破】、【享乐】、【玉玉】、【红温】,那么建议你把这些技能使用 `General:addRelatedSkill()` 添加给这个武将,来方便玩家如果不知道这些技能的效果,那么可以在这个武将的说明里知道这个技能的效果是什么样的。
#### 给技能添加相关技能
有的技能用中文描述起来看起来很简单,但是在编程的时候复杂到必须拆成好几个技能来写。我们来看这个例子吧:
> 奖杯:锁定技,你使用的花色为♣的基本牌和锦囊牌无视距离和防具、没有次数限制;
>
> 你使用的花色为<font color="red"></font>的基本牌和锦囊牌不可被响应;
>
> 弃牌阶段结束时,若你出牌阶段只使用或打出过♣和<font color="red"></font>牌,摸等量的牌。
是吧,字很少,也就三个效果,但是它都写到一个技能里了。其实从代码的角度来说,也不是不可能用一个技能就实现之,但是应该会臃肿得很。我的建议是拆,每个需求都做个技能,方便自己看懂。
我们来看这个技能的代码吧:
```Lua
-- 测试通过
-- 主函数啥也不做,只是为了承载下面的
local jy_jiangbei = fk.CreateTriggerSkill {
name = "jy_jiangbei",
}
-- ♥无法被响应
local jy_jiangbei_heart = fk.CreateTriggerSkill {
name = "#jy_jiangbei_heart",
frequency = Skill.Compulsory,
events = { fk.CardUsing },
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return false end
if target == player and data.card.suit == Card.Heart then
return data.card.type == Card.TypeBasic or data.card.type == Card.TypeTrick
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke(jy_jiangbei.name)
data.disresponsiveList = table.map(room.alive_players, Util.IdMapper)
end,
}
-- ♣没有距离次数限制
local jy_jiangbei_club = fk.CreateTargetModSkill {
name = "#jy_jiangbei_club",
bypass_times = function(self, player, skill, scope, card, to)
return player:hasSkill(self) and card.suit == Card.Club and to
end,
bypass_distances = function(self, player, skill, card, to)
return player:hasSkill(self) and card.suit == Card.Club and to
end,
}
-- ♣无视防具
local jy_jiangbei_club_2 = fk.CreateTriggerSkill {
name = "#jy_jiangbei_club_2",
frequency = Skill.Compulsory,
events = { fk.TargetSpecified },
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return false end
if target == player and data.card and data.card.suit == Card.Club then
return data.card.type == Card.TypeBasic or data.card.type == Card.TypeTrick
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local to = room:getPlayerById(data.to)
local use_event = room.logic:getCurrentEvent():findParent(GameEvent.UseCard, true)
if use_event == nil then return end
room:addPlayerMark(to, fk.MarkArmorNullified)
use_event:addCleaner(function()
room:removePlayerMark(to, fk.MarkArmorNullified)
end)
end,
}
-- 出牌阶段开始时把已使用打出的红桃梅花数设置成0
local jy_jiangbei_set_0 = fk.CreateTriggerSkill {
name = "#jy_jiangbei_set_0",
mute = true,
frequency = Skill.Compulsory,
refresh_events = { fk.EventPhaseStart },
can_refresh = function(self, event, target, player, data)
return player:hasSkill(self) and target == player and
player.phase == Player.Play -- 在我的出牌阶段
end,
on_refresh = function(self, event, target, player, data)
player.room:setPlayerMark(player, "@jy_jiangbei_draw", 0)
end,
}
-- 计算出牌阶段使用打出了多少张红桃梅花。一旦使用打出了别的牌,就变为字符串。
-- TargetSpecified对每个目标都会执行一次所以改成CardUsing。前面的虎啸也一并改了已经。
local jy_jiangbei_draw_count = fk.CreateTriggerSkill {
name = "#jy_jiangbei_draw_count",
mute = true,
frequency = Skill.Compulsory,
refresh_events = { fk.CardResponding, fk.CardUsing }, -- 包括了使用和打出
can_refresh = function(self, event, target, player, data)
if player:hasSkill(self) and data.card and player.phase == Player.Play then
return target == player
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
-- 如果是红桃和梅花
if (data.card.suit == Card.Club or data.card.suit == Card.Heart) and
type(player:getMark("@jy_jiangbei_draw")) == "number" then -- 并且没有使用打出过别的花色
room:addPlayerMark(player, "@jy_jiangbei_draw")
else
room:setPlayerMark(player, "@jy_jiangbei_draw", "#jy_jiangbei_no") -- 如果设置成字符串了,代表不允许摸牌了
end
end,
}
-- 弃牌阶段结束时摸等量的牌
local jy_jiangbei_draw = fk.CreateTriggerSkill {
name = "#jy_jiangbei_draw",
anim_type = "special",
events = { fk.EventPhaseEnd }, -- 包括了使用和打出
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self)
and player.phase == Player.Discard
end,
on_cost = function(self, event, target, player, data)
local room = player.room
if type(player:getMark("@jy_jiangbei_draw")) == "number" then -- 只有是数字的时候,代表可以摸牌
player:drawCards(player:getMark("@jy_jiangbei_draw"), self.name)
end
room:setPlayerMark(player, "@jy_jiangbei_draw", 0) -- 无论能不能摸牌,都要清理掉这个标记
end,
}
jy_jiangbei:addRelatedSkill(jy_jiangbei_heart)
jy_jiangbei:addRelatedSkill(jy_jiangbei_club)
jy_jiangbei:addRelatedSkill(jy_jiangbei_club_2)
jy_jiangbei:addRelatedSkill(jy_jiangbei_set_0)
jy_jiangbei:addRelatedSkill(jy_jiangbei_draw_count)
jy_jiangbei:addRelatedSkill(jy_jiangbei_draw)
```
我估计你也没想到这么长。这技能凭什么这么长?
我觉得没必要一句句分析,你自己看这个代码吧,挺好懂的,就是有点长。
其实我这一段就是想跟你说:如果你的一个技能要被拆成很多很多个技能,那你把每一个技能都当作 RelatedSkill 加给主技能,然后把主技能加给武将就可以了。这些 RelatedSkill 不会显示在武将介绍和技能里面,所以你也不用为它们写技能名字和技能介绍的翻译表。
其实不推荐我这种“主技能啥也不做”的做法,有点浪费内存。建议把一个 RelatedSkill 放到这里来。我只是觉得这个技能太复杂了,让它的主技能留空反而有种荒诞的美。就让它这样流传下去吧。
当然,我这堆代码还是可以继续优化的,比如可以把某些 `refresh` 事件和 `trigger` 事件合到同一个技能里,效果是一样的。不过我自己喜欢这么写,方便我以后看得懂哪段代码是干嘛的。如果你自己写的时候容易把自己搞晕,拆开两个技能写一般都没什么问题。
## 阿威罗:将别人设计的武将转化为需求
我觉得正确的制作武将的流程是:对标强度、设计武将、细化需求、翻译成详尽的中文、根据每一段中文来实现这个功能、测试强度和问题。怎么感觉有点像软件工程了,不过制作武将的流程还真是软件工程。我们以这个武将为例吧。
先得确定你这个武将到底要对标哪个包、哪个将的强度。如果你要对标的是谋关羽或者活动服的牛鬼蛇神,那怎么强都不过分;如果你要对标的是风林火山,那就要控制好强度,不能让这些将完全没法打你。
这个武将是我的朋友“导演片子怎么样了”设计的,我看着好像有点意思就实现了。但是问题是:他的描述非常不规范。我们看一下他原来的描述:
> 阿伟罗
>
> 游龙:回合开始阶段,你可以让每位玩家顺时针递交一张手牌给其下家
>
> 核爆:回合开始阶段,你可以将一张手牌扣于你的武将牌上,视为“点”,当“点”花色不同时,你视为使用一张\*\*入侵,回合内仅限一次
>
> 跳水:当你失去体力时,你可以移出一张“点”
>
> 罗绞:当你的“点”有四张时,视为使用一张万箭齐发
>
> 玉玊:你同一回合内的第一张基本牌视为玉,第二张基本牌视为玊,当你使用玊时,将同时视为打出一张同花色“点”
你可能也会遇到这种情况,即你的朋友设计的武将,你要实现,但是他写的你不一定看得懂,或者他写的不够详细。你得推测他的意图(当然,最好直接问他,省得你做好了他跟你说不对又要你改)。
1. 你不说体力,那我们看一眼强度。这么多 AOE掉体力还放 AOE那我默认 3 体力了,不然别人没法玩。
2. 然后,‘当你失去体力时’,“失去体力”和“受到伤害”是两个完全不同的事件,他自己又没有主动失去体力的技能,那就基本触发不了了。这个肯定不对。我的建议是改成受到伤害,这样触发频率高得多,对标强度也说得过去。
3. 其次,“当‘点’花色不同时”,那一张“点”的时候算花色相同还是花色不同?我是当作相同的做的,因为只有一张牌的话,和自己的花色肯定相同啊。他后来说一张“点”算不同的,那按他说的为准吧。所以一定要描述详细一点!
4. 再次,“打出一张同花色‘点’”是什么意思?‘点’不是被移出游戏置于武将牌上的吗?通过理解,我们觉得他的意思应该是把这张你使用的牌作为“点”放在武将牌上。
我们翻译完,其实发现他想做的事情就是让“点”的数量变动时,检测花色和数量,如果花色不同就放**入侵(每回合限一次,他自己说的),如果数量为 4 就放万箭齐发。然后你受到伤害时可以弃一张“点”,你准备阶段可以用一张手牌当“点”,你使用的第二张基本牌可以当“点”。这就是需求了。
把它翻译成三国杀的中文吧!有两个相似的需求,那就是检测花色和数量,并执行不同的效果,我建议把这两个需求合成一个技能。其他的变成规范的技能描述即可。
我们生产了下面这个版本:
> 阿威罗 群 体力3
>
> 游龙:锁定技,准备阶段,有手牌的角色依次将一张手牌交给下家。
>
> 核爆:准备阶段,可以将一张手牌置于武将牌上,称为【点】。
>
> 跳水:受到伤害时,可以弃置一张【点】。
>
> 玉玊:出牌阶段,你每使用第二张基本牌时,可以将其作为【点】置于你的武将牌上。
>
> 罗绞:当【点】的数量变化后:
>
> 1. 若你没有两张及以上相同花色的【点】,可以视为立即使用一张【\*\*入侵】,每回合限一次;<br>
> 1. 若你有4张【点】可以视为立即使用一张【万箭齐发】。
看起来规范多了!请注意,【游龙】我改为了锁定技,因为这个武将有两个准备阶段的技能,每次都让选择谁先发动会有点不太用户友好;稍微加强了一点【玉玊】,因为对于这个武将来说,“点”太多不是好事,而且反正【罗绞】的\*\*入侵每回合只能使用一次,让他自己多选择一次吧。
尽管我改成这样,但他还是说不对。他希望【玉玊】之后也能触发\*\*入侵,我说“你写的就是“回合内仅限一次”啊。
类似的还有高天亮。他之前说的是:受到来自队友的伤害时,摸三张牌然后翻面。那如何定义队友?他跟我说,所有人都是你的队友,对你使用了杀造成了伤害的就不是你的队友。所以我最后写成了下面这个版本,效果是一样的。
> 玉玉:
>
> 1. 锁定技,当有角色对你使用【杀】造成了伤害时,其获得【致郁】标记;<br>
> 2. 受到没有【致郁】标记的角色或因本次伤害而获得【致郁】标记的角色造成的伤害时,你可以选择一项:摸三张牌;摸四张牌并翻面。
这样写的好处是不用给全场打太多标记。你这个技能的重要性也没有那么强,也就摸个三张,为啥开局给所有人打个标记呢?还不如反过来,谁不是你的队友就给谁上标记,这样不是合理多了。
这个工作看起来也太像阅读理解了吧。我觉得这种工作需要又精通三国杀,又精通代码,知道哪些需求能写出来、哪些需求写不出来。但总之,我们已经顺利把它转换成程序员喜欢的文字了!
## 考公大学生:参考别人的代码与爬虫
这是我认为简浴包最天才的武将之一。这个武将很好地使用测试包的谋徐盛(有很多用于测试的技能)中的技能,结合做选择题(并且也实现了让全场玩家都可以看到正在做的题的题干和答案),使用爬虫技术结合人工处理数据,设计出了一个有强度、平衡、有实用价值(应该说最有实用价值的吧,毕竟哪个其他武将能帮你考公?)、娱乐(随机性大但题目难度稳定、题库大)、玩家反馈合理(正反馈强、答错无惩罚)的武将。经过群友的强度测试,总体感觉是符合简浴包合理强度的,不至于让别的武将没法玩,使命成功(但是很难)之后也能获得极强的正反馈。
> 做题:出牌阶段限一次,你可以做一道\*\*真题。若正确,你可以获得一张想要的牌。<br>
>
> <font size="1">本武将推荐操作时长60秒<br>
>
> 当前收录试卷:..total_papers..套,题目总量:..total_questions..含相同题目全部经人工筛选不含图形推理、资料分析全部取自2018-2023\*\*\*\*\*录用考试《\*\*》真题。<br>
>
> 你选择的这张牌可能来自于任何位置,包括其他角色的区域、你自己的手牌。所以建议先把同牌名的牌使用掉。</font>
>
> 熬夜:使命技,出牌阶段限一次,你可以失去一点体力使【做题】可以再使用一次。<br>
>
> 成功回合结束时若你【做题】答对比答错至少多3你摸3张牌然后获得技能【集智】、【看破】、【享乐】<br>
>
> 失败回合结束时若你【做题】答错比答对至少多3你翻面、减一点体力上限然后获得技能【玉玉】、【红温】。
我们挑些重点说。设计武将没那么难~~如果不要求平衡的话~~,但是将设计的武将的一两百字中文翻译成代码,是需要拆分需求的。一个技能可能有多个部分,每个部分都要各司其职。
#### 参考别人的代码
这是我已经较为熟练之后设计并制作的武将,所以你可能会看到一些我的注释。如,定义完武将后,看到了下面的注释:
```Lua
-- 获得一张牌谋徐盛cheat
-- 还可以继续发动:甄姬洛神
-- 出牌阶段主动:界简自豪开局
-- 选择:界李元浩二段
-- 使命技:不知道,到时候再说
```
这段注释代表着“为了实现我的设计,我需要参考哪些技能”。如果你不知道你的技能可以参考谁,建议问群友或者百度。群友一般都会给你令你满意的答复(除了有些黑话我不知道,如群友说李谢,我半天不知道谁是李谢,原来是两个人。)
去看对应的代码就可以了,删掉不需要的部分,然后应用到自己的代码里。
#### 爬虫
我刚实现这个武将的时候,我是手动复制粘贴的题的,太慢了,花了好久才 100 多道题,很快就被群友把题库玩干净了。遂想到使用爬虫。
说实话我对爬虫一窍不通,上次爬东西可能是三四年前了(爬 `op.gg` 的英雄数据并且获得合适的出装,当时还天天沉迷英雄联盟,服了)。我直接让 ChatGPT 帮我搞的。给它看一部分你的 html 文件,告诉它你要什么样的输出(在我这里,我需要 Lua 的 table 形式)让它生成代码来帮你爬,哪里不对告诉它,它会改。最终跟它一起琢磨了两个多小时,就搞好了,我基本上自己没怎么写代码。你可以去 `packages/jianyu/questions/pachong.py` 看到这段代码,并在相同文件夹下看到所有爬到的试卷。我已经抽样调查过了,就算题目可能有一点格式问题,但答案确实是正确的。
当然还是有些问题的,比如题目里面的下划线用的是\<u\>标签,我爬不到;百分号和英文冒号会被认成通配符导致不显示后面的字了;图片题做不了,需要删除;过时题和材料题建议删掉。这些手动解决一下吧,反正一张卷子也就几分钟就搞好了,不碍事。让 ChatGPT 搞半天他也搞不好。
我觉得都 2023 年了,是时候学会让 AI 来帮助你完成任务了。一些小技巧就是你得描述得足够仔细,它才能输出你想要的东西,不然它可能理解不到。
## 雷电将军:平衡武将
这个原神角色改编成三国杀武将看起来没什么难度,核心机制就是给队友挂雷眼,队友造成伤害的时候我也造成一次伤害,然后可以在合适的时候开大打伤害。
一开始我的设计是每回合给一名角色挂雷眼有雷眼的角色造成伤害时判定若为♣就造成1点雷伤并获得一个愿力。然后每回合可以消耗所有愿力打伤害有多少愿力就造成多少伤害+1。后来经过PVE测试发现节奏太慢了看起来很厉害但实际上没什么用尤其是在活动服环境里。调整了很多天中间也研究过弃牌开大什么的但感觉对一个无法额外摸牌的武将来说有点弱。最后改成了红色给愿力黑色1点雷伤开大只造成1点伤害但给所有有雷眼的人有多少愿力发多少张牌。
这样就几乎成了一个纯粹的辅助给队友增伤发牌无条件制伤牌好的情况下自己也有一定输出能力指一回合打三四点。我承认确实可能有点强了但强度这个东西不得已而为之。大家都强作为简浴包的第一个神将当然强度要给高一点。总的来说我觉得设计还是比较成功的但我觉得可能要把四体力改成三体力不然不开其他DIY将的场上出现一个这个东西太超模了伤害过高。之后再观察一段时间吧。
上面的这个版本已经在最新的版本里面被废除了。根据群友的 PVP 反馈觉得奖励后置过于垃圾毕竟在活动服里基本一两轮就能打完一场8人军争/8人忠胆轮不到你下一轮你就死了所以我思考之后只保留了【雷眼】但是加强了它。
## 神里绫人:改编武将
您可以想一下如果您来改编这个角色到《三国杀》里,您会如何设计他的技能:普攻没什么用,小技能是位移一小段,然后加强普通攻击变成大范围水伤,大招是让自己周围区域随机落水花造成伤害,被动一是给小技能按生命值增伤,被动二是自己处于后台且蓝低于一半时回大招的蓝。命座一是对生命值低于一半的目标伤害提升,命座二是增加小技能生命值倍率、开小技能获得生命值,后面的就不用介绍了。
我觉得不太好设计。毕竟《三国杀》武将绝大多数只有个位数的体力,每次增伤都很致命;大招如果做成随机伤害,又不可控,打谁?怎么选目标?怎么造成伤害?持续多久?我想了好久也没想明白(后面我发现雷刹张角这个武将对这个随机伤害实现得挺好的),也许可以设计成【定时炸弹】那样,但我觉得随机打击角色的设计感一般,给玩家的正反馈也不强。
我的设计一般都是技能描述越简洁越好,能让玩家一下就看得懂,不然阅读个几百字挺痛苦的(我很不喜欢!)。最后我决定放弃大招,从小技能、被动二和命座二着手,设计了现在这个版本。基本回合外使用基本牌就能摸。如果能一直保持闪杀的节奏,能多摸很多牌,但是要是残体力了就寄。回合内也能额外出杀、加手牌上限,回合外能多造成伤害,要是快似了还能一定程度上保命。
强度是故意设计的不高的因为我和朋友玩的时候基本上都没开强度特别高的武将我也不希望简浴包的武将强度膨胀得太快。我觉得杨藩杨藩没什么好说的除了难写没有别的特点了不单开一节了这个武将的强度就已经有点高了4体力掉体力大概率摸2张觉醒之后加体力上限还巨强这让本包第一个武将简自豪有点难绷感觉就算是界简自豪也没杨藩强。不过这些都是群友设计的强度不归我管我只负责做。他要是设计个被闪电劈中直接胜利的武将那我也得给他做。
对了,如果你需要官方的原神角色配音,我在代码的这部分里写了一段注释,你可以去看看。
## 高天亮:平衡武将
早期设计我已经在上面提过了,就不说了。没什么用,纯摸牌白板,后期单挑也是白板,所以决定加强技能。既然技能特色是摸牌,那就贯彻到底咯?狠狠地摸!
其实我觉得摸牌很多不是很厉害,反正摸牌白板也用不出去,而且高天亮的设计是被【杀】了就不能继续从这个人的伤害里摸了。
鼓励玩家翻面代表玉玉了所以我最后加到了选择摸3张牌或者选择摸6张牌并翻面。后面加强到了摸12/24张。就算是这么多牌我依然觉得远远追不上雀魂和萌包的强度。机制摆在这里。
上面的这个版本已经在最新的版本里面被废除了。根据群友的 PVP 反馈,防御能力太高了,被打了一次之后基本上就再也不会掉血了。设计了个更有意思的机制,你可以去看最新的版本。

BIN
audio/death/jy__argenti.mp3 Normal file

Binary file not shown.

BIN
audio/death/jy__aweiluo.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
audio/death/jy__ayato.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
audio/death/jy__guojia.mp3 Normal file

Binary file not shown.

BIN
audio/death/jy__hbrz.mp3 Normal file

Binary file not shown.

BIN
audio/death/jy__huohuo.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
audio/death/jy__jtqn.mp3 Normal file

Binary file not shown.

BIN
audio/death/jy__kgds.mp3 Normal file

Binary file not shown.

BIN
audio/death/jy__kgdxs.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
audio/death/jy__qexbj.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
audio/death/jy__raiden.mp3 Normal file

Binary file not shown.

BIN
audio/death/jy__sunquan.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
audio/death/jy__xuyu.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_baoyang1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_baoyang2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_bazhen1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_bazhen2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_bazhen3.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_bazhen4.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_fenshen1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_fenshen2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_fenshen3.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_fenshen4.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_guina1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_guina2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_guina3.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_guina4.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_guina5.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_guina6.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_guina7.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_guina8.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_hebao1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_hongwen1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_hongwen2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_hongwen3.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_hongwen4.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_hongwen5.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
audio/skill/jy_jinghua1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_jinghua2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju3.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju4.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju5.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju6.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju7.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju8.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju_21.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju_22.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju_23.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju_24.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju_25.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju_26.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju_27.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_kaiju_28.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_leiyan1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_leiyan2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_leiyan3.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_lingfu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_lingfu2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_luojiao1.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
audio/skill/jy_qiongtu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_quanyu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_renren1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_sanjian1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_shengnu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_shengnu2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_shengnu3.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_taoqiu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_taoqiu2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_tiandu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/jy_tiandu2.mp3 Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More