Initial commit

This commit is contained in:
WatermelonModders
2022-05-31 12:35:46 -04:00
commit fc5cb0c32c
4097 changed files with 447075 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
tags
*.pyc
*.swp
*.o
+1
View File
@@ -0,0 +1 @@
Filip Pancik <far.b3yond.driv3n@gmail.com>
+622
View File
@@ -0,0 +1,622 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://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
+39
View File
@@ -0,0 +1,39 @@
CFLAGS=-Wall -DMOD_$(mod) -g -Isrc/include -Isrc/include/proto -I../hm_base/src/include -I/usr/include/json-c/ -Iscript/mechanics/include #-DTURNOFF_TIMER -DMANA_ZERO -DTEST_DECK -DSPELL_ZERO_MANA
LIBS=-lev -lhmbase -lm -ljson-c -lcouchbase
LIBPATH=-L../hm_base/lib
TARGET=hm_gameserver
SOURCES=$(shell find src -type f -iname '*.c')
OBJECTS=$(foreach x, $(basename $(SOURCES)), $(x).o)
all: base script hm_gameserver
base:
$(MAKE) -C ../hm_base target=game
hm_gameserver:
$(CC) $(SOURCES) $(CFLAGS) $(LIBPATH) -o $(TARGET) $(LIBS)
script:
mkdir -p script/mechanics/include
cd script/ && python entities.py
cd script/mechanics/ && python main.py
cd script/ && python flags.py
cd script/ && python entities.py
cd script/mechanics/ && python main.py
clean:
rm -f $(OBJECTS) $(TARGET) tags \
script/flags_sections \
script/mechanics/*.pyc \
src/flag_def.c \
src/proto/ent.c \
src/proto/ent_sections.c \
src/levelup.c \
src/include/levelup.h \
src/include/flag_def.h \
src/include/proto/ent_gen.h \
script/mechanics/include/*.h
.PHONY: all hm_gameserver script
+22
View File
@@ -0,0 +1,22 @@
# hm_gameserver #
hm_gameserver is a HearthStone hearthmod gameserver. This server daemon is part of hearthmod stack which allows user to create custom modes and cards.
## Dependencies ##
- libev >= 4.22
- libjson-c >= 0.11
- libcouchbase >= 2.5.8
- libhmbase >= 0.1
## Compatiblity ##
hm_gameserver is compatible with HearthStone client 5.2.x.
## Compilation ##
cd hm_gameserver && make
# This is not a standalone project!
[hm_gameserver](https://github.com/farb3yonddriv3n/hm_gameserver) is part of [hearthmod software stack](https://github.com/hearthmod/hearthmod)
+731
View File
@@ -0,0 +1,731 @@
#!/bin/sh
# Game entity
name="Game Entity" card=GAME_ENTITY tags={10:85,20:1,49:1,198:4,202:1,204:2}
# Mana Card
name="Coin" card=GAME_005 tags={49:3,202:5,313:1}
# Player1
name="Player1" card=PLAYER1 tags={7:75,17:1,27:64,28:10,29:4,30:1,31:1,49:1,176:10,202:2,272:1,399:4}
# Player2
name="Player2" card=PLAYER2 tags={7:75,17:1,23:1,24:1,27:66,28:10,29:4,30:2,31:2,49:1,176:10,202:2,272:1,399:3}
# Power of the Horde
name="Kill Roshan" card=PRO_001c tags={183:11,202:5,48:30,330:0,331:0,} custom=1
# The Sentinel
name="The Sentinel" card=TB_SPT_Boss tags={183:18,202:3,47:0,45:30,380:39537,} custom=1
# The Scourge
name="The Scourge " card=LOEA04_01 tags={183:20,45:30,330:0,331:0,380:16231,202:3,} custom=1
# Enrage
name="Tether" card=NAX12_04e tags={183:12,202:6,330:0,331:0,338:1,} custom=1 flags=(CARD_ATTACHMENT)
# Lantern of Power
name="Grow" card=LOEA16_3e tags={183:20,202:6,330:0,331:0,} custom=1 flags=(CARD_ATTACHMENT)
# Lothar's Left Greave
name="Arcane Boots" card=LOEA16_9 tags={183:20,202:5,48:0,330:0,331:0,} custom=1
# Mountain Giant
name="Tiny" card=EX1_105 tags={183:3,202:4,201:3,203:5,48:1,47:0,45:1,251:6,321:1,} custom=1 attachment=LOEA16_3e
# Youthful Brewmaster
name="Youthful Brewmaster" card=EX1_049 tags={183:3,202:4,201:2,203:1,48:2,47:3,45:2,251:6,321:1,330:0,331:0,218:1,} custom=1
# Brann Bronzebeard
name="Karroch, the Beastmaster" card=LOE_077 tags={183:20,202:4,203:5,114:1,321:1,48:5,47:2,45:3,330:0,331:0,362:0,} custom=1
# Abomination
name="Pudge, the Butcher" card=EX1_097 tags={183:3,202:4,201:3,203:3,48:5,47:0,45:4,251:6,321:1,330:0,331:0,190:0,217:0,} custom=1
# Piloted Sky Golem
name="Boush, the Tinker" card=GVG_105 tags={183:13,321:1,48:3,202:4,203:4,47:1,45:2,200:17,330:0,331:0,217:1,} custom=1
# Icehowl
[AT_125]
# Skeleton
name="Skeleton" card=NAX4_03H tags={183:12,202:4,48:7,47:6,45:5,} custom=1
# Skeleton Knight
name="The Skeleton King" card=AT_128 tags={183:15,321:1,203:5,202:4,48:7,47:6,45:5,114:1,330:0,331:0,217:1,} custom=1
# Deathwing
name="Deathwing" card=NEW1_030 tags={183:3,203:5,202:4,48:10,47:12,45:12,200:24,114:1,321:1,330:0,331:0,218:1,} custom=1
# Treant
name="Treant" card=EX1_158t tags={183:3,202:4,201:3,199:2,251:1,47:1,45:2,48:1,330:0,331:0,} custom=1
# Velen's Chosen
name="Guardian Greaves" card=GVG_010 tags={183:13,203:1,202:5,48:0,199:6,321:1,330:0,331:0,} custom=1
# Cabalist's Tome
name="Arcane Books" card=OG_090 tags={183:21,321:1,203:4,202:5,48:0,199:4,330:0,331:0,} custom=1
# Seal of Champions
name="Black King Bar" card=AT_074 tags={183:15,321:1,203:1,202:5,48:2,199:5,330:0,331:0,} custom=1 attachment=AT_074e2
# Seal of Champions E
name="Magic Immunity" card=AT_074e2 tags={183:15,202:6,199:5,330:0,331:0,} custom=1 flags=(CARD_ATTACHMENT)
# Dagon
name="Dagon" card=BRMA11_3 tags={183:14,202:5,48:1,47:1,330:0,331:0,} custom=1
# Sparring Partner
[AT_069]
# Divine Rapier E
name="Divine Rapier" card=FP1_020e tags={183:12,202:6,199:5,330:1,331:1,} custom=1 flags=(CARD_ATTACHMENT)
# Desolator
name="Desolator" card=LOEA06_03 tags={183:20,202:5,48:2,330:0,331:0,} custom=1 attachment=LOEA06_03e
# Desolator E
name="Desolate" card=LOEA06_03e tags={183:20,202:6,330:0,331:0,} custom=1 flags=(CARD_ATTACHMENT)
# Rooted
name="Level 2" card=EX1_178ae tags={183:3,202:6,199:2,330:1,331:1,} custom=1 flags=(CARD_ATTACHMENT)
# Inner Rage
name="Satanic" card=EX1_607 tags={183:3,203:5,202:5,48:3,201:3,199:10,321:1,} custom=1 attachment=EX1_607e
# Angry Chicken
name="Courier" card=EX1_009 tags={321:1,183:3,203:3,202:4,48:1,47:2,45:1,330:0,331:0,200:20,212:1,} custom=1
# Repel
[LOEA16_20]
# Cursed Blade
name="Echo Sabre " card=LOE_118 tags={183:20,321:1,203:3,202:7,48:2,47:0,187:3,199:10,330:0,331:0,} custom=1
# Shadowflame
name="Requiem of Souls" card=EX1_303 tags={183:3,202:5,201:3,199:9,203:3,48:4,251:1,268:2,321:1,330:0,331:0,370:1,} custom=1
# Demonfire E
name="Necromastery" card=EX1_596e tags={183:3,203:1,202:6,48:0,201:3,199:9,330:1,331:1,} custom=1 flags=(CARD_ATTACHMENT)
# Void Crusher
name="Eidolon" card=AT_023 tags={183:15,321:1,203:3,202:4,48:2,47:2,45:2,199:9,200:15,330:0,331:0,403:0,} custom=1
# Forbidden Shaping
name="Demonic Conversion" card=OG_101 tags={183:21,321:1,203:4,202:5,48:3,199:6,330:0,331:0,} custom=1
# Charge E
name="Level 1" card=CS2_103e2 tags={183:2,202:6,199:10,330:0,331:0,} custom=1 flags=(CARD_ATTACHMENT)
# Inner Rage E
name="Satanic" card=EX1_607e tags={183:3,202:6,199:10,330:1,331:1,} custom=1 flags=(CARD_ATTACHMENT)
# Inner Fire E
name="Level 3" card=CS1_129e tags={183:3,202:6,199:6,330:1,331:1,} custom=1 flags=(CARD_ATTACHMENT)
# Twisting Nether
name="The Black Hole" card=EX1_312 tags={183:3,202:5,201:3,199:9,203:4,48:8,251:1,268:2,321:1,330:0,331:0,} custom=1
# Mal Ganis
[GVG_021]
# Lay on Hands
name="Purification" card=EX1_354 tags={183:3,202:5,201:3,199:5,203:4,48:8,251:1,321:1,330:0,331:0,} custom=1
# Flame Lance
name="Laguna Blade" card=AT_001 tags={183:15,321:1,203:1,202:5,48:8,199:4,47:10,330:0,331:0,} custom=1
# Dragon's Breath
name="Dragon's Breath" card=BRM_003 tags={183:14,321:1,203:1,202:5,48:3,199:4,47:2,330:0,331:0,} custom=1
# Confessor Paletress
name="Lina" card=AT_018 tags={183:15,321:1,203:5,202:4,48:2,47:1,45:14,199:6,114:1,330:0,331:0,200:16,} custom=1 level2=BRM_003 level3=AT_001
# Lightning Storm
name="God's Wrath" card=EX1_259 tags={183:3,202:5,201:3,199:8,203:3,48:6,251:1,47:3,321:1,330:0,331:0,215:1,} custom=1
# Forked Lightning
name="Forked Lightning" card=EX1_251 tags={183:3,202:5,201:3,199:8,203:1,48:2,251:1,47:1,321:1,330:0,331:0,215:1,} custom=1
# Archmage Antonidas
name="Zeus" card=EX1_559 tags={183:3,203:5,202:4,48:3,47:1,45:15,201:3,251:3,199:4,114:1,321:1,330:0,331:0,32:1,} custom=1 level2=EX1_251 level3=EX1_259
# Commanding Shout
name="Warcry" card=NEW1_036 tags={183:3,203:3,202:5,48:1,199:10,321:1,330:0,331:0,} custom=1 attachment=NEW1_036e
# Commanding Shout
name="Sven: Warcry" card=NEW1_036e tags={183:3,202:6,199:10,330:0,331:0,338:1,} custom=1 flags=(CARD_ATTACHMENT)
# Druid of the Claw
name="Ursa" card=EX1_165t2 tags={183:3,203:5,202:4,48:4,47:3,45:21,199:2,330:0,331:0,200:20,190:0,} custom=1 level2=CS2_012 level3=CS2_011
# Open Wounds
name="Wounded" card=AT_039e tags={183:15,202:6,199:2,330:0,331:0,338:1,} custom=1 flags=(CARD_ATTACHMENT)
# Divine Strength
name="God's Strength" card=OG_223 tags={183:21,321:1,203:1,202:5,48:3,199:5,} custom=1 attachment=OG_223e
# Optimism
name="Sven: God's Strength" card=OG_223e tags={183:21,202:6,} custom=1 flags=(CARD_ATTACHMENT)
# Tirion Fordring
name="Sven" card=EX1_383 tags={183:3,203:5,202:4,48:3,47:3,45:16,201:3,199:5,251:1,114:1,321:1,330:0,331:0,194:0,190:0,217:0,} custom=1 level2=NEW1_036 level3=OG_223
# Windfury
[CS2_039]
# Corruption
name="Corruption" card=CS2_063 tags={183:2,202:5,201:3,199:9,203:1,48:1,251:1,321:1,330:0,331:0,} custom=1 attachment=CS2_063e
# Corruption E
name="Corruption" card=CS2_063e tags={183:2,202:6,199:9,330:2,331:2,} custom=1 flags=(CARD_ATTACHMENT)
# Hunter's Mark
[CS2_084] attachment=CS2_084e
# Hunter's Mark E
name="Hunter's Mark E" card=CS2_084e tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Assasinate
name="Assassinate" card=CS2_076 tags={183:2,202:5,201:3,199:7,203:2,48:5,251:6,268:2,321:1,330:0,331:0,} custom=1
# Shadow Word: Death
[EX1_622]
# Shadow Word: Pain
name="Shadow Word: Pain" card=CS2_234 tags={321:1,183:2,203:2,202:5,48:2,199:6,330:0,331:0,} custom=1
# Execute
name="Culling Blade" card=CS2_108 tags={183:2,202:5,201:3,199:10,203:2,48:3,251:1,268:2,321:1,330:0,331:0,} custom=1
# Illidan
name="Terrorblade" card=EX1_614 tags={183:3,203:5,202:4,48:6,45:1,47:5,201:3,251:6,114:1,321:1,330:0,331:0,200:15,32:1,} custom=1
# Hand of Protection
name="Guardian Angel" card=EX1_371 tags={183:2,203:2,202:5,48:2,199:5,201:3,251:1,321:1,330:0,331:0,} custom=1
# Polymorph
[CS2_022] attachment=CS2_022e
name="Polymorph E" card=CS2_022e tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Hex
[EX1_246] attachment=EX1_246e
# Hex E
name="Hex E" card="EX1_246e" tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Blessing of Kings
[CS2_092] attachment=CS2_092e
# Blessing of Kings E
name="Blessing of Kings E" card="CS2_092e" tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Blessing of Might
[CS2_087] attachment=CS2_087e
# Blessing of Might E
name="Blessing of Might E" card="CS2_087e" tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Power Word: Shield
[CS2_004] attachment=CS2_004e
# Power Word: Shield E
name="Power Word: Shield E" card="CS2_004e" tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Charge
[CS2_103] attachment=CS2_103e2
# Charge E
#name="Charge E" card="CS2_103e2" tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Mark of the Wild
[CS2_009] attachment=CS2_009e
# Mark of the Wild E
name="Mark of the Wild E" card="CS2_009e" tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Ancestral Healing
[CS2_041] attachment=CS2_041e
# Ancestral Infusion
name="Ancestral Infusion" card="CS2_041e" tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Rockbiter Weapon
[CS2_045] attachment=CS2_045e
# Rockbiter Weapon E
name="Rockbiter Weapon E" card=CS2_045e tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Divine spirit
[CS2_236]
# Bloodlust
[CS2_046] attachment=CS2_046e
# Bloodlust E
name="Bloodlust E" card=CS2_046e tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Claw
[CS2_005] attachment=CS2_005o
# Claw E
name="Claw E" card=CS2_005o tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Heroic Strike
[CS2_105] attachment=CS2_105e
# Heroic Strike E
name="Heroic Strike E" card=CS2_105e tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Savage Roar
name="Enrage" card=CS2_011 tags={183:2,202:5,201:3,199:2,203:1,48:3,251:1,321:1,330:0,331:0,} custom=1 attachment=CS2_011o
# Savage Roar E
name="Enraged" card=CS2_011o tags={183:2,202:6,199:2,330:1,331:1,338:1,} custom=1 flags=(CARD_ATTACHMENT)
# Warrior
name="Warrior" card=HERO_01 tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Shamman
name="Shamman" card=HERO_02 tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Rogue
#name="Rogue" card=TB_SPT_Boss tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Paladin
name="Paladin" card=HERO_04 tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Hunter
name="Hunter" card=HERO_05 tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Druid
name="Druid" card=HERO_06 tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Warlock
name="Warlock" card=HERO_07 tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Mage
name="Mage" card=HERO_08 tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Priest
#name="Priest" card=LOEA04_01 tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# King of Khaz Modan
name="King of Khaz Modan" card=HERO_01a tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Blood Knight Matriarch
name="Blood Knight Matriarch" card=HERO_04a tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Alleria Windranger
name="Alleria Windranger" card=HERO_05a tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Guardian Medivh
name="Guardian Medivh" card=HERO_08a tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Khadgar
name="Khadgar" card=HERO_08b tags={12:1,45:30,49:1,201:3,202:3,203:2} flags=(CARD_HERO)
# Ice lance
#CS2_031 tags={12:1,47:0,48:1,49:3,201:3,202:5,203:2,264:1} flags=(CARD_SPELL|CARD_SPELL_DAMAGE|CARD_TARGETING|CARD_FREEZE|CARD_TARGET_FROZEN_4_DMG)
# Holy Smite
[CS1_130]
# Fireball
[CS2_029]
# Swipe
name="Swipes" card=CS2_012 tags={183:2,202:5,201:3,199:2,203:1,48:2,251:1,47:2,321:1,330:0,331:0,} custom=1 attachment=AT_039e
# Hammer of Wrath
[CS2_094]
# Backstab
name="Backstab" card=CS2_072 tags={183:2,202:5,201:3,199:7,203:2,251:6,48:0,47:2,268:2,321:1,330:0,331:0,} custom=1
# Drain Life
[CS2_061]
# Sacrificial Pact
[NEW1_003]
# Arcane Shot
name="Arcane Shot" card=DS1_185 tags={183:2,202:5,201:3,199:3,203:2,48:1,251:8,47:2,321:1,} custom=1
# Soulfire
[EX1_308]
# Mortal Coil
[EX1_302]
# Shield Block
[EX1_606]
# Shiv
[EX1_278]
# Starfire
[EX1_173]
# Moonfire
[CS2_008]
# Kill Command
[EX1_539]
# Frostbolt
name="Frostbolt" card=CS2_024 tags={183:2,202:5,201:3,199:4,203:1,48:2,251:1,47:3,268:2,321:1,208:1,} custom=1
# Frost Shock
[CS2_037]
# Shadow Bolt
[CS2_057]
# Feral Rage - choose one
#OG_047 tags={12:1,48:2,49:3,201:3,202:5,203:2,264:1} flags=(CARD_SPELL|CARD_SPELL_DAMAGE|CARD_NONTARGET)
# Arcane intellect
name="Arcane Intellect" card=CS2_023 tags={183:2,202:5,201:3,199:4,203:2,48:3,251:1,268:2,321:1,330:0,331:0,} custom=1
# Sprint
name="Sprint" card=CS2_077 tags={183:2,202:5,201:3,199:7,203:1,48:7,251:1,268:2,321:1,330:0,331:0,} custom=1
# Arcane Explosion
[CS2_025]
# Arcane Missiles
[EX1_277]
# Tracking
[DS1_184]
# Sinister Strike
[CS2_075]
# Mind Blast
[DS1_233]
# Frost Nova
name="Shiva's Guard" card=CS2_026 tags={183:2,202:5,201:3,199:4,203:1,48:3,251:1,47:1,268:2,321:1,330:0,331:0,208:1,} custom=1
# Fan of Knives
[EX1_129]
# Cleave
[CS2_114]
# Multishot
[DS1_183]
# Mind Vision
[CS2_003]
# Flamestrike
[CS2_032]
# Whirlwind
name="Counter Helix" card=EX1_400 tags={183:2,202:5,201:3,199:10,203:1,48:0,251:1,47:1,321:1,330:0,331:0,} custom=1
# Consecration
[CS2_093]
# Holy Nova
name="Mekansm" card=CS1_112 tags={183:2,202:5,201:3,199:6,203:1,48:4,251:5,321:1,330:0,331:0,} custom=1
# Hellfire
[CS2_062]
# Water Elemental
[CS2_033]
################
# Aura
###############
# Raid leader
[CS2_122] attachment=CS2_122e
# Enhanced
name="Enhanced" card=CS2_122e tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Stormwind champion
name="Stormwind Champion" card=CS2_222 tags={183:2,202:4,201:2,203:1,48:7,47:6,45:6,251:1,321:1,330:0,331:0,362:1,} custom=1 attachment=CS2_222o
# Might of Stormwind
name="Might of Stormwind" card=CS2_222o tags={183:2,202:6,330:1,331:0,} custom=1 flags=(CARD_ATTACHMENT)
# Warsong Commander
[EX1_084] attachment=EX1_084e
# Charge
name="Charge" card=EX1_084e tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Timber Wolf
[DS1_175] attachment=DS1_175o
# Furious Howl
name="Furious Howl" card=DS1_175o tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Gurubashi Berserker
[EX1_399] attachment=EX1_399e
# Berserking
name="Berserking" card=EX1_399e tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
################
# Battlecry
###############
# Dread Infernal
[CS2_064]
# Novice engineer
[EX1_015]
# Gnomish Inventor
[CS2_147]
# Darkscale Healer
[DS1_055]
# Guardian of Kings
name="Omniknight" card=CS2_088 tags={183:2,202:4,201:3,199:5,203:1,48:2,251:5,45:17,47:1,321:1,218:1,} custom=1
# Nightblade
name="Phantom Assassin" card=EX1_593 tags={183:2,203:2,202:4,48:4,45:2,47:4,201:3,321:1,218:1,} custom=1
# Acidic Swamp Ooze
[EX1_066]
# Voodoo doctor
name="Witch Doctor" card=EX1_011 tags={183:2,202:4,201:1,203:2,48:1,47:2,45:1,251:6,321:1,218:1,} custom=1
# Elven Archer
[CS2_189]
# Fire Elemental
name="Fire Elemental" card=CS2_042 tags={183:2,202:4,201:3,199:8,203:1,48:6,47:6,45:5,251:3,321:1,218:1,} custom=1
# Ironforge Rifleman
[CS2_141]
# Stormpike Commando
[CS2_150]
# Frostwolf Warlord
name="Legion Commander" card=CS2_226 tags={183:2,202:4,201:1,203:4,48:5,47:4,45:4,251:1,321:1,330:0,331:0,218:1,} custom=1 attachment=CS2_226e
# Frostwolf Banner
name="Frostwolf Banner" card=CS2_226e tags={183:2,202:6,330:1,331:1,} custom=1 flags=(CARD_ATTACHMENT)
# Succubus
name="Queen of Pain" card=EX1_306 tags={183:2,202:4,201:3,199:9,200:15,203:2,48:3,47:4,45:3,251:1,268:2,321:1,218:1,} custom=1
# Sap
name="Sap" card=EX1_581 tags={183:2,203:2,202:5,48:2,201:3,199:7,268:2,321:1,330:0,331:0,} custom=1
# Mind Control
[CS1_113] attachment=CS1_113e
# Mind Control E
name="Mind Control E" card=CS1_113e tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
# Vanish
[NEW1_004]
################
# Spell damage
###############
# Archmage
[CS2_155]
# Dalaran mage
[EX1_582]
# Kobold geomancer
[CS2_142]
# Ogre magi
[CS2_197]
################
# Charge
###############
# Wolfirder
[CS2_124]
# Bluegill warrior
[CS2_173]
# Kor'kron elite
name="Mogul Khan, Axe" card=NEW1_011 tags={183:2,203:5,202:4,321:1,330:0,331:0,48:3,47:2,45:20,199:10,197:0,} custom=1 level3=CS2_108
# Stormwind knight
[CS2_131]
# Reckless rocketeer
[CS2_213]
# Stonetusk boar
name="Stonetusk Boar" card=CS2_171 tags={183:2,202:4,201:3,200:20,203:2,48:1,47:1,45:1,251:6,268:2,321:1,197:0,} custom=1
# Huffer
[NEW1_034] flags=(CARD_UNCOLLECTIBLE)
################
# Divine shield
###############
# Scarlet Crusader
[EX1_020]
################
# Taunt
###############
# Lord of the Arena
[CS2_162]
# Booty bay bodyguard
[CS2_187]
# Frostwolf Grunt
[CS2_121]
# Goldshire footman
[CS1_042]
# Ironbark protector
[CS2_232]
# Sen'jin Shieldmasta
[CS2_179]
# Voidwalker
name="Enigma" card=CS2_065 tags={183:2,202:4,201:3,199:9,200:15,203:5,48:2,45:15,251:9,47:1,268:2,321:1,190:0,} custom=1 level2=OG_101 level3=EX1_312
# Misha
[NEW1_032] flags=(CARD_UNCOLLECTIBLE)
# Frog
[hexfrog] flags=(CARD_UNCOLLECTIBLE)
################
# Totem
###############
# Wrath of Air Totem
[CS2_052] flags=(CARD_UNCOLLECTIBLE|CARD_TOTEMIC_CALL_CHILD)
# Stoneclaw Totem
[CS2_051] flags=(CARD_UNCOLLECTIBLE|CARD_TOTEMIC_CALL_CHILD)
# Searing Totem
[CS2_050] flags=(CARD_UNCOLLECTIBLE|CARD_TOTEMIC_CALL_CHILD)
# Healing Totem
[NEW1_009] flags=(CARD_UNCOLLECTIBLE|CARD_TOTEMIC_CALL_CHILD)
# Flametongue Totem
[EX1_565] attachment=EX1_565o
# Flametongue
name="Flametongue" card=EX1_565o tags={12:1,49:6,202:6} flags=(CARD_ATTACHMENT)
################
# Summon
###############
# Mirror Image
[CS2_027]
# Mirror Image
[CS2_mirror]
# Animal Companion
[NEW1_031]
# Dragonling Mechanic
[EX1_025]
# Mechanical Dragonling
[EX1_025t] flags=(CARD_UNCOLLECTIBLE)
# Murloc Tidehunter
[EX1_506]
# Murloc Scout
name="Murloc Scout" card=EX1_506a tags={183:2,202:4,201:3,200:14,203:1,47:1,45:1,251:1,48:0,} custom=1 flags=(CARD_UNCOLLECTIBLE)
# Razorfen Hunter
[CS2_196]
# Leokk
[NEW1_033] flags=(CARD_UNCOLLECTIBLE)
# Starving Buzzard
name="Vulture" card=CS2_237 tags={321:1,183:2,203:1,202:4,48:1,47:1,45:1,199:3,200:20,330:0,331:0,32:1,} custom=1
# Sheep
[CS2_tk1] flags=(CARD_UNCOLLECTIBLE)
# Avator of the Coin
[GAME_002] flags=(CARD_UNCOLLECTIBLE)
# Boar
name="Boar" card=CS2_boar tags={183:2,202:4,201:3,203:1,47:1,45:1,251:1,48:1,200:20,330:0,331:0,} custom=1 flags=(CARD_UNCOLLECTIBLE)
# Oasis Snapjaw
name="Oasis Snapjaw" card=CS2_119 tags={321:1,183:2,203:2,202:4,48:4,47:2,45:7,200:20,} custom=1
# Bloodfen Raptor
name="Bloodfen Raptor" card=CS2_172 tags={183:2,203:2,202:4,48:2,45:2,47:3,201:1,251:1,268:2,321:1,200:20,} custom=1
# Magma Rager
name="Shadow Fiend" card=CS2_118 tags={321:1,183:2,203:5,202:4,48:2,47:1,45:14,330:0,331:0,} custom=1 level3=EX1_303
# Puddlestomper
#GVG_064 tags={12:1,45:2,47:3,48:2,49:3,202:4,203:2} flags=(CARD_MINION)
# Wisp
name="Wisp" card=CS2_231 tags={183:3,203:1,202:4,48:2,45:2,47:0,201:3,251:7,} custom=1 attachment=NAX12_04e
# Core Hound
name="Core Hound" card=CS2_201 tags={321:1,183:2,203:1,202:4,48:7,47:9,45:5,200:20,} custom=1
# Murloc Raider
name="Murloc Raider" card=CS2_168 tags={183:2,202:4,201:2,203:2,48:1,47:2,45:1,251:1,321:1,200:14,} custom=1
# River Crocolisk
name="River Crocolisk" card=CS2_120 tags={321:1,183:2,203:2,202:4,48:2,47:2,45:3,200:20,} custom=1
# Boulderfist Ogre
name="Boulderfist Ogre" card=CS2_200 tags={321:1,183:2,203:2,202:4,48:6,47:6,45:7,} custom=1
# Chillwind Yeti
name="Chillwind Yeti" card=CS2_182 tags={183:2,202:4,201:3,203:1,48:4,47:4,45:5,251:6,268:2,321:1,330:0,331:0,} custom=1
# Fireblast
name="Fireblast" card=CS2_034 tags={12:1,47:1,48:2,49:1,201:3,202:10,203:2} flags=(CARD_HEROPOWER|CARD_TARGETING|CARD_SPELL|CARD_HP_SPELL_DAMAGE)
# Lesser Heal
# name="Lesser Heal" card=CS1h_001 tags={12:1,47:2,48:2,49:1,201:3,202:10,203:2} flags=(CARD_HEROPOWER|CARD_TARGETING|CARD_SPELL|CARD_SPELL_HEAL)
# Lesser Heal
name="Lesser Heal" card=CS1h_001 tags={183:2,202:10,201:3,199:6,203:2,48:2,251:1,} custom=1
# Healing Touch
[CS2_007]
# Holy Light
[CS2_089]
# Reinforce
name="Reinforce" card=CS2_101 tags={12:1,48:2,49:1,201:3,202:10,203:2} flags=(CARD_HEROPOWER|CARD_SPELL|CARD_NONTARGET|CARD_HP_REINFORCE|CARD_SUMMON)
# Silverhand Recruit
[CS2_101t] flags=(CARD_MINION|CARD_UNCOLLECTIBLE)
# Dagger Mastery
name="Dagger Mastery" card=CS2_083b tags={12:1,48:2,49:1,201:3,202:10,203:2} flags=(CARD_HEROPOWER|CARD_SPELL|CARD_NONTARGET|CARD_HP_DAGGERMASTERY|CARD_SUMMON)
################
# Weapon
###############
# Wicked Knife
[CS2_082] flags=(CARD_UNCOLLECTIBLE)
# Assassin's Blade
[CS2_080]
# Truesilver Champion
name="Divine Rapier" card=CS2_097 tags={183:2,202:7,201:3,199:5,203:1,48:5,47:8,187:1,251:6,321:1,330:0,331:0,32:1,} custom=1
# Fiery War Axe
[CS2_106]
# Light's Justice
[CS2_091]
# Arcanite reaper
[CS2_112]
##############
# Totemic Call
[CS2_049] tags={12:1,48:2,49:1,201:3,202:10,203:2} flags=(CARD_HEROPOWER|CARD_SPELL|CARD_NONTARGET|CARD_SUMMON|CARD_HP_TOTEMIC_CALL)
# Shapeshift
[CS2_017] tags={12:1,47:1,48:2,49:1,201:3,202:10,203:2} flags=(CARD_HEROPOWER|CARD_SPELL|CARD_NONTARGET|CARD_HP_SHAPESHIFT|CARD_SUMMON)
# Armor Up
[CS2_102] tags={12:1,47:2,48:2,49:1,201:3,202:10,203:2} flags=(CARD_HEROPOWER|CARD_SPELL|CARD_NONTARGET|CARD_HP_ARMORUP|CARD_SUMMON)
# Life Tap
[CS2_056] tags={12:1,47:2,48:2,49:1,201:3,202:10,203:2} flags=(CARD_HEROPOWER|CARD_SPELL|CARD_NONTARGET|CARD_HP_LIFETAP|CARD_SUMMON)
# Steady Shot
[DS1h_292] tags={12:1,47:2,48:2,49:1,201:3,202:10,203:2} flags=(CARD_HEROPOWER|CARD_TARGETING|CARD_SPELL|CARD_HP_SPELL_DAMAGE|CARD_TARGET_HERO)
# Empty mana card
name="Empty card" card=MANA_CARD tags={12:1,49:3,263:5} flags=(CARD_UNCOLLECTIBLE)
# No card
name="No Card" card=NO_CARD tags={49:2} flags=(CARD_UNCOLLECTIBLE)
+274
View File
@@ -0,0 +1,274 @@
'''
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
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 <http://www.gnu.org/licenses/>.
'''
import os
import sys
import shlex
allflags = []
index = 0
def parse(src):
global allflags
global index
entities = []
f = open(src, "r")
ri = 0
lines = f.readlines();
for l in lines:
ri = ri + 1
if(len(l) < 10): # new lines
continue
if(l[0] == "#"): # comment
continue
arr = shlex.split(l)
f = ''
att = ''
custom = ''
c = ''
t = ''
level2 = ''
level3 = ''
for a in arr:
sub = a.split("=")
if(len(sub) != 2):
continue
if(sub[0] == "name"):
n = sub[1]
elif(sub[0] == "card"):
c = sub[1]
elif(sub[0] == "tags"):
t = sub[1]
elif(sub[0] == "flags"):
f = sub[1]
elif(sub[0] == "attachment"):
att = sub[1]
elif(sub[0] == "custom"):
custom = sub[1]
elif(sub[0] == "level2"):
level2 = sub[1]
elif(sub[0] == "level3"):
level3 = sub[1]
else:
print 'parsing %s failed' % sub[0]
exit(1)
if(len(c) == 0 or len(t) == 0):
continue
d = {}
if(len(level2) > 0):
d['level2'] = level2
if(len(level3) > 0):
d['level3'] = level3
d['desc'] = n
d['name'] = c
if(len(f) > 0):
flags = f.replace("\n", "")
allflags.append([index, flags, d['name']])
d['rawflags'] = flags
d['flags'] = '{{0, 0, 0, 0, 0, 0, 0, 0}}'
if(len(att) > 0):
d['attachment'] = att
d['tags'] = {}
if(len(t) > 0):
properties = t.replace(",}", "}").split(",")
for p in properties:
a = p.split(":")
idx = a[0].replace("{", "")
tz = a[1].replace("\n", "").replace("}", "")
d['tags'][idx] = tz
if(len(custom) > 0):
d['custom'] = custom
print 'Active card: ' + d['desc'] + ' [' + d['name'] + ']'
entities.append(d)
index = index + 1
return entities
def gen_js_cards(e):
out = 'var cards = [\n'
for d in e :
for key in d:
if(key == 'rawflags'):
if((d[key].find("CARD_MINION") > -1 or d[key].find("CARD_SPELL") > -1) and\
d[key].find("CARD_UNCOLLECTIBLE") == -1 and d[key].find("CARD_HERO") == -1 and\
d[key].find("CARD_HEROPOWER") == -1
):
out += '["%s", "%s"], \n' % (d['name'], d['desc'])
out += '];'
f = open("cards.js", "w")
f.write(out)
f.close()
def gen_js_hp(e):
out = 'var cards_hp = [\n'
for d in e :
for key in d:
if(key == 'rawflags'):
if(d[key].find("CARD_HEROPOWER") > -1):
out += '["%s", "%s"], \n' % (d['name'], d['desc'])
out += '];'
f = open("cards_hp.js", "w")
f.write(out)
f.close()
def gen_js_hero(e):
out = 'var cards_hero = [\n'
for d in e :
for key in d:
if(key == 'rawflags'):
if(d[key] == "(CARD_HERO)"):
out += '["%s", "%s"], \n' % (d['name'], d['desc'])
out += '];'
f = open("cards_hero.js", "w")
f.write(out)
f.close()
def gen(e):
out = '#include <ent_gen.h>\n'
out += '#include <ent.h>\n'
header = '#ifndef ENTGEN_H_\n#define ENTGEN_H_\n\n#define MAX_ENTITIES %d\n' % len(e)
out += 'struct ent_s entities[MAX_ENTITIES] = {'
index = 0
beasts = []
totems = []
totemic_call = []
hp = []
for d in e:
flags = ''
attch = '(void *)0, '
val = '{'
level2 = "(void *)0, "
level3 = "(void *)0, "
for key in d:
if(key == 'name'):
start = '{ "%s", %d, %d, ' % (d[key], len(d[key]), len(d['tags']))
elif(key == 'desc'):
desc = '"%s", ' % d[key]
elif(key == 'level2'):
level2 = '"%s", ' % d[key]
elif(key == 'level3'):
level3 = '"%s", ' % d[key]
elif(key == 'flags'):
flags = '%s, ' % d[key]
elif(key == 'attachment'):
attch = "\"%s\", " % d[key]
elif(key == 'rawflags'):
tt = 1
elif(key == 'custom'):
tt = 1
elif(key == 'tags'):
for k, v in d[key].items():
val += '{ %s, %s }, ' % (k, v)
val += ' }} // %d \n, ' % index
out += start + level2 + level3 + desc + flags + attch + val
index = index + 1
out += '};'
out += '\n\nvoid entities_init() {\n'
for i in allflags:
arr = i[1].split("|")
for a in arr:
cm = a.replace("(", "").replace(")", "")
if(cm == "CARD_RACE_BEAST"):
beasts.append(i[2])
if(cm == "CARD_RACE_TOTEM"):
totems.append(i[2])
if(cm == "CARD_TOTEMIC_CALL_CHILD"):
totemic_call.append(i[2])
if(cm == "CARD_HEROPOWER"):
hp.append(i[2])
out += '\tflag(&entities[%s].flags, %s, FLAG_SET);\n' % (i[0], cm)
out += '}\n'
header += "#define MAX_BEASTS %d\n" % len(beasts)
header += "#define MAX_TOTEMS %d\n" % len(totems)
header += "#define MAX_TOTEMIC_CALL %d\n" % len(totemic_call)
header += "#define MAX_HEROPOWER %d\n" % len(hp)
out += "const char *race_beast[MAX_BEASTS] = {\n"
for b in beasts:
out += "\t\"%s\",\n" % b
out += "};\n"
out += "const char *race_totems[MAX_TOTEMS] = {\n"
for b in totems:
out += "\t\"%s\",\n" % b
out += "};\n"
out += "const char *totemic_call[MAX_TOTEMIC_CALL] = {\n"
for b in totemic_call:
out += "\t\"%s\",\n" % b
out += "};\n"
out += "const char *hp_list[MAX_HEROPOWER] = {\n"
for b in hp:
out += "\t\"%s\",\n" % b
out += "};\n"
f = open("../src/proto/ent.c", "w")
f.write(out)
f.close()
header += "const char *totemic_call[MAX_TOTEMIC_CALL];\n"
header += "const char *race_beast[MAX_BEASTS];\n"
header += "const char *race_totems[MAX_TOTEMS];\n"
header += "\n#endif"
f = open("../src/include/proto/ent_gen.h", "w")
f.write(header)
f.close()
if __name__ == '__main__':
basic = parse("custom_mod")
#classic = parse("cards/classic")
#e = basic + classic
e = basic
gen(e)
#gen_js_cards(e)
#gen_js_hp(e)
#gen_js_hero(e)
print 'total entities: %d' % len(e)
+188
View File
@@ -0,0 +1,188 @@
MECHANICS_DAMAGE , 1000
MECHANICS_HEALTH , 1000
MECHANICS_ATTACK , 1000
MECHANICS_ATTACK_DAMAGE, 1000
MECHANICS_ATTACK_HEAL, 1000
MECHANICS_HEROPOWER, 1000
MECHANICS_BATTLECRY_TRIGGER , 1000
MECHANICS_CHANGESIDES, 1000
MECHANICS_ARMOR, 1000
MECHANICS_DURABILITY, 1000
MECHANICS_DETACH, 1000
MECHANICS_SELECTED, 1000
MECHANICS_DESTROY_WEAPON, 1000
MECHANICS_TURN_TRIGGER, 1000
MECHANICS_COST, 1000
CARD_HAND , 1000
CARD_DESTROYED , 1001
CARD_BOARD , 1000
CARD_EXHAUSTED , 1000
CARD_HERO , 1000
CARD_HEROPOWER , 1000
CARD_HEROWEAPON, 1000
CARD_BOSS, 1000
CARD_TARGETING , 1000
CARD_NONTARGET , 1000
CARD_NONTARGET_BC , 1000
CARD_SPELL , 1000
CARD_SPELL_HEAL , 1000
CARD_SPELL_DAMAGE , 1000
CARD_HP_REINFORCE , 1000
CARD_HP_DAGGERMASTERY , 1000
CARD_HP_ARMORUP , 1000
CARD_HP_LIFETAP , 1000
CARD_HP_SHAPESHIFT , 1000
CARD_WINDFURY , 1000
CARD_DECK , 1000
CARD_TARGET_HERO , 1000
CARD_TARGET_MINIONS , 1000
CARD_TARGET_ENEMY_HERO , 1000
CARD_TARGET_ENEMY_MINIONS , 1000
CARD_TARGET_ALLY_HERO , 1000
CARD_TARGET_ALLY_MINIONS , 1000
CARD_TARGET_ALLY, 1000
CARD_TARGET_ENEMY, 1000
CARD_TARGET_ALL, 1000
CARD_HP_SPELL_DAMAGE , 1000
CARD_INNERFIRE , 1000
CARD_AOE_ENEMY_MINIONS , 1000
CARD_AOE_ALLENEMY , 1000
CARD_CHARGE , 1000
CARD_DIVINE_SHIELD , 1000
CARD_FREEZE , 1000
CARD_FROZEN , 1000
CARD_TARGET_FROZEN_4_DMG , 1000
CARD_BATTLECRY , 1000
CARD_BATTLECRY_DAMAGE3_ENEMY_HERO , 1000
CARD_BATTLECRY_TARGET , 1000
CARD_BATTLECRY_HEAL2_TARGET , 1000
CARD_BATTLECRY_DRAW1_CARD, 1000
CARD_DRAW2_CARD, 1000
CARD_DRAW4_CARD, 1000
CARD_DRAW_CARD, 1000
CARD_MINION, 1000
CARD_BUFF , 1000
CARD_DIVINESPIRIT, 1000
CARD_AOE, 1000
CARD_AOE_TARGET_ALL, 1000
CARD_HEAL_ALLIES, 1000
CARD_BATTLECRY_DAMAGE1_ALL, 1000
CARD_AOE_MINIONS, 1000
CARD_SUMMON, 1000
CARD_WEAPON_ROCKBITER, 1000
CARD_WEAPON, 1000
CARD_BOARD_WEAPON, 1000
CARD_SUMMON_CS2_MIRROR, 1000
CARD_BLESSING_OF_KINGS, 1000
CARD_BLOODLUST, 1000
CARD_BUFF_AOE, 1000
CARD_CORRUPTION, 1000
CARD_CORRUPTED, 1000
CARD_ATTACHMENT, 1000
CARD_RAID_LEADER, 1000
CARD_AURA, 1000
CARD_STORMWIND_CHAMPION, 1000
CARD_RACE_BEAST, 1000
CARD_RACE_MURLOC, 1000
CARD_TAUNT, 1000
CARD_SPELLPOWER, 1000
CARD_SAP, 1000
CARD_VANISH, 1000
CARD_SUMMON_ANIMAL_COMPANION, 1000
CARD_UNCOLLECTIBLE, 1000
CARD_BATTLECRY_SUMMON_DRAGONLING_MECHANIC, 1000
CARD_RACE_MECH, 1000
CARD_LEOKK, 1000
CARD_BATTLECRY_SUMMON_MURLOC_SCOUT, 1000
CARD_BATTLECRY_SUMMON_BOAR, 1000
CARD_BATTLECRY_SUMMON, 1000
CARD_RACE_TOTEM, 1000
CARD_RACE_DEMON, 1000
CARD_TURN_HEAL1_MINIONS, 1000
CARD_TOTEMIC_CALL_CHILD, 1000
CARD_HP_TOTEMIC_CALL, 1000
CARD_BATTLECRY_HEAL2_ALIES, 1000
CARD_BATTLECRY_HEAL6_ALLY_HERO, 1000
CARD_BATTLECRY_DAMAGE1_TARGET, 1000
CARD_BATTLECRY_DAMAGE2_TARGET, 1000
CARD_BATTLECRY_DAMAGE3_TARGET, 1000
CARD_BATTLECRY_FROSTWOLF_WARLORD, 1000
CARD_BATTLECRY_DISCARD1_CARD, 1000
CARD_DISCARD, 1000
CARD_MIND_CONTROL, 1000
CARD_AOE_CLEAVE, 1000
CARD_FAN_OF_KNIVES, 1000
CARD_KILL_COMMAND, 1000
CARD_MIND_VISION, 1000
CARD_DAMAGE_DRAW_CARD, 1000
CARD_SOULFIRE, 1000
CARD_MORTAL_COIL, 1000
CARD_DRAW1_CARD, 1000
CARD_ARMOR5, 1000
CARD_TRUESILVER_CHAMPION, 1000
CARD_STARVING_BUZZARD, 1000
CARD_SAVAGE_ROAR, 1000
CARD_WARSONG_COMMANDER, 1000
CARD_TIMBER_WOLF, 1000
CARD_FLAMETONGUE_TOTEM, 1000
CARD_GURU_BERSERKER, 1000
CARD_CLAW, 1000
CARD_MARK_OF_THE_WILD, 1000
CARD_HUNTERS_MARK, 1000
CARD_AOE_MULTISHOT, 1000
CARD_ANCESTRAL_HEALING, 1000
CARD_ROCKBITER_WEAPON, 1000
CARD_DRAIN_LIFE, 1000
CARD_SINISTER_STRIKE, 1000
CARD_ASSASINATE, 1000
CARD_MIND_BLAST, 1000
CARD_HAND_OF_PROTECTION, 1000
CARD_CHARGE_BUFF, 1000
CARD_HEROIC_STRIKE, 1000
CARD_EXECUTE, 1000
CARD_SHADOW_WORD_DEATH, 1000
CARD_SHADOW_WORD_PAIN, 1000
CARD_SACRIFITIAL_PACT, 1000
CARD_BATTLECRY_DESTROY_ENEMY_WEAPON, 1000
CARD_POWER_WORD_SHIELD, 1000
CARD_SWIPE, 1000
CARD_ARCANE_MISSILES, 1000
CARD_TRACKING, 1000
CARD_TRANSFORM, 1000
CARD_POLYMORPH, 1000
CARD_HIDE, 1000
CARD_LINKED, 1000
CARD_HEX, 1000
CARD_TARGET_UNDAMAGED_MINION, 1000
CARD_TARGET_DAMAGED_MINION, 1000
CARD_TARGET_3ATTACK_LESS, 1000
CARD_TARGET_5ATTACK_MORE, 1000
CARD_TARGET_30PERCENT_LESS, 1000
CARD_TARGET_DEMON, 1000
CARD_BLESSING_OF_MIGHT, 1000
CARD_TARGET_UNDAMAGED, 1000
CARD_ARCHMAGE_ANTONIDAS, 1000
CARD_TARGET_BC_AUTO, 1000
CARD_TARGET_BC_MANUAL, 1000
CARD_TARGET_BC_ALL, 1000
CARD_TARGETING_BC, 1000
CARD_TARGET_BC_ALLY, 1000
CARD_TARGET_BC_ENEMY, 1000
CARD_TARGET_BC_ENEMY_MINIONS, 1000
CARD_TARGET_BC_HERO, 1000
CARD_TARGET_BC_ENEMY_HERO, 1000
CARD_TARGET_BC_MINIONS, 1000
CARD_TARGET_BC_ALLY_MINIONS, 1000
CARD_TARGET_BC_ALLY_HERO, 1000
CARD_STEALTH, 1000
CARD_ATTACK, 1000
CARD_TARGET_URSA, 1000
CARD_TARGET_SVEN, 1000
CARD_LEVELUP, 1000
CARD_PIERCE_MAGIC_IMMUNITY, 1000
CARD_TARGET_ALLY_BOARD, 1000
CARD_TARGET_BOARD, 1000
CARD_TARGET_ENEMY_BOARD, 1000
CARD_TARGET_ALLY_BOSSES, 1000
CARD_TARGET_ENEMY_BOSSES, 1000
CARD_TARGET_BOSSES, 1000
+67
View File
@@ -0,0 +1,67 @@
'''
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
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 <http://www.gnu.org/licenses/>.
'''
import os
def fwrite(f, content):
f = open(f, "w")
f.write(content)
f.close()
def parse():
f = open("./flags", "r")
lines = f.readlines();
f.close()
f = open("./flags_sections", "r")
lines = lines + f.readlines()
f.close()
ae = []
for l in lines:
elements = []
for ele in l.split(","):
elements.append(ele.replace(" ", "").replace("\n", ""))
ae.append(elements)
header = '#ifndef FLAG_DEF_H_\n#define FLAG_DEF_H_\n\n'
header += '#define MAX_FLAGS_DEF %d\n\n' % len(ae)
header += 'int flag_defs[MAX_FLAGS_DEF];\n'
header += 'enum flags_e {\n'
i = 0
for a in ae:
header += '\t%s = %s,\n' % (a[0], i)
i = i + 1
header += '};\n'
header += '#endif'
body = '#include <flag_def.h>\n\n'
body += 'int flag_defs[MAX_FLAGS_DEF] = {\n'
i = 0
for a in ae:
body += '%d, // index %d\n' % (int(a[1]), i)
i = i + 1
body += '};\n'
fwrite("../src/include/flag_def.h", header)
fwrite("../src/flag_def.c", body)
if __name__ == '__main__':
e = parse()
+18
View File
@@ -0,0 +1,18 @@
@section
buff:code,target
battlecry:code,target
defender:code
properties:all,levelup
spell_aoe:code,target
spell:code,target
attack:code,target
attack_effect:code
weapon:code
endturn:code
onboard:code
destroyed:code
weapon_destroyed:code
idle:code
weapon_attack:code
attachment_attack:code
attack_effect_attachment:code
@@ -0,0 +1,14 @@
# Goldshire Footman
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$minions"
},
".section properties" : {
"all": [ "taunt" ]
}
}
@@ -0,0 +1,23 @@
# Holy Nova
{
".section spell_aoe" : {
"code" : "
def(card_list_s, allcards)
allcards = hsl_board_all_cards($attacker, $heroes_included);
def(card_list_s, cl)
foreach(cl, allcards) {
if(cl->card->controller == $attacker->controller) {
cl->card->receive.heal = 2;
} else {
cl->card->receive.damage = 2;
}
}
hsl_attack_aoe($attacker, allcards)
hsl_link_target($attacker, allcards)
",
"target": "$auto"
}
}
@@ -0,0 +1,11 @@
# Holy Smite
{
".section spell" : {
"code" : "
$defender->receive.damage = 2;
hsl_attack($attacker, $defenders);
",
"target": "$all"
}
}
@@ -0,0 +1,13 @@
# Mind Vision
{
".section buff" : {
"code": "
def(card_s, card)
card = hsl_cards_get_hand_random($deck_opponent);
if(card) {
hsl_add_new_card_hand($deck_player, card->entity->name, holder)
}
",
"target" : "$auto"
}
}
@@ -0,0 +1,15 @@
# Power Word: Shield
{
".section buff" : {
"code": "
hsl_change_health($defender, 2)
hsl_add_signle_attachment($player, $deck_player, $attacker, $defender);
hsl_draw_cards($player, $deck_player, draw_card, 1)
/* hsl_link_target($attacker, $defenders) */
",
"target": "$minions"
}
}
@@ -0,0 +1,14 @@
# Claw
{
".section buff" : {
"code": "
int change = 2;
hsl_buff_attack_expire(1, $ally_hero, change);
hsl_change_armor($ally_hero, change)
hsl_add_attachment($player, $attacker, $ally_hero, 1);
hsl_add_target($ally_hero, holder)
",
"target": "$auto"
}
}
@@ -0,0 +1,12 @@
# Healing Touch
{
".section buff" : {
"code" : "
$defender->receive.heal = 8;
hsl_attack($attacker, $defenders);
hsl_link_target($attacker, $defenders);
",
"target": "$all"
}
}
@@ -0,0 +1,12 @@
# Moonfire
{
".section spell" : {
"code" : "
/* defender is linked by default */
$defender->receive.damage = 1;
hsl_attack($attacker, $defenders);
",
"target": "$all"
}
}
@@ -0,0 +1,12 @@
# Mark of the Wild
{
".section buff" : {
"code": "
hsl_change_attack($defender, 2)
hsl_set_taunt($defender)
hsl_add_signle_attachment($player, $deck_player, $attacker, $defender);
",
"target": "$minions"
}
}
@@ -0,0 +1,18 @@
# Savage Roar
{
".section buff" : {
"code": "
def(card_list_s, all)
all = hsl_board_friendly_cards($attacker, $heroes_included);
def(card_list_s, itm)
foreach(itm, all) {
hsl_buff_attack_expire(1, itm->card, 2);
hsl_add_attachment($player, $attacker, itm->card, 1);
hsl_add_defender(itm->card, holder)
}
",
"target": "$auto"
}
}
@@ -0,0 +1,21 @@
# Swipe
{
".section spell_aoe" : {
"code": "
def(card_list_s, all)
all = hsl_board_enemy_cards($defender, $heroes_included);
$defender->receive.damage = 4;
def(card_list_s, itm)
foreach(itm, all) {
itm->card->receive.damage = 1;
hsl_add_target(itm->card, holder);
}
hsl_attack($attacker, $defenders)
",
"target": "$enemy"
}
}
@@ -0,0 +1,10 @@
# Polymorph
{
".section buff" : {
"code": "
hsl_transform($attacker, $defender, \"CS2_tk1\");
",
"target": "$enemy_minions"
}
}
@@ -0,0 +1,9 @@
# Arcane Intellect
{
".section buff" : {
"code": "
hsl_draw_cards($player, $deck_player, draw_card, 2)
",
"target" : "$auto"
}
}
@@ -0,0 +1,22 @@
# Frostbolt
{
".section spell" : {
"code" : "
$defender->receive.damage = 3;
hsl_attack($attacker, $defenders);
",
"target": "$all"
},
".section attack_effect" : {
"code" : "
hsl_freeze($attacker, $defender)
"
},
".section properties" : {
"all": [ "freeze" ]
}
}
@@ -0,0 +1,19 @@
# Arcane Explosion
{
".section spell_aoe" : {
"code" : "
def(card_list_s, e)
e = hsl_board_enemy_cards($attacker, $heroes_excluded);
def(card_list_s, cl)
foreach(cl, e) {
cl->card->receive.damage = 1;
}
hsl_attack_aoe($attacker, e)
hsl_link_target($attacker, e)
",
"target": "$auto"
}
}
@@ -0,0 +1,15 @@
# Frost Nova
{
".section spell_aoe" : {
"code" : "
def(card_list_s, e)
e = hsl_board_enemy_cards($attacker, $heroes_excluded);
hsl_attack_aoe($attacker, e)
hsl_link_target($attacker, e)
",
"target": "$auto"
}
}
@@ -0,0 +1,17 @@
# Mirror Image
{
".section spell_aoe" : {
"code": "
int i;
for(i = 0; i < 2; i++) {
hsl_summon_card($deck_player, \"CS2_mirror\", cardholder)
}
/* this just does the routine (destroying it etc..) with a played card */
hsl_attack_aoe($attacker, $defenders)
",
"target": "$auto"
}
}
@@ -0,0 +1,12 @@
# Fireball
{
".section spell" : {
"code" : "
$defender->receive.damage = 6;
hsl_attack($attacker, $defenders);
",
"target": "$all"
}
}
@@ -0,0 +1,19 @@
# Flamestrike
{
".section spell_aoe" : {
"code" : "
def(card_list_s, e)
e = hsl_board_enemy_cards($attacker, $heroes_excluded);
def(card_list_s, cl)
foreach(cl, e) {
cl->card->receive.damage = 4;
}
hsl_attack_aoe($attacker, e)
hsl_link_target($attacker, e)
",
"target": "$auto"
}
}
@@ -0,0 +1,21 @@
# Water Elemental
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$minions"
},
".section attack_effect" : {
"code" : "
hsl_freeze($attacker, $defender)
"
},
".section properties" : {
"all": [ "freeze" ]
}
}
@@ -0,0 +1,22 @@
# Frost Shock
{
".section spell" : {
"code" : "
$defender->receive.damage = 1;
hsl_attack($attacker, $defenders);
",
"target": "$all"
},
".section attack_effect" : {
"code" : "
hsl_freeze($attacker, $defender)
"
},
".section properties" : {
"all": [ "freeze" ]
}
}
@@ -0,0 +1,10 @@
# Windfury
{
".section buff" : {
"code": "
setflag($defender, CARD_WINDFURY)
",
"target": "$minions"
}
}
@@ -0,0 +1,12 @@
# Ancestral Healing
{
".section buff" : {
"code": "
hsl_set_fullhealth($defender)
hsl_set_taunt($defender)
",
"target": "$minions"
}
}
@@ -0,0 +1,14 @@
# Fire Elemental
{
".section battlecry" : {
"code" : "
def(card_s, def)
def = hsl_card($target);
if(def) {
hsl_attack_bc($attacker, def, 3)
}
",
"target": "$all"
}
}
@@ -0,0 +1,12 @@
# Rockbiter Weapon
{
".section buff" : {
"code": "
hsl_buff_attack_expire(1, $defender, 3);
hsl_add_attachment($player, $attacker, $defender, 1);
",
"target": "$auto"
}
}
@@ -0,0 +1,17 @@
# Bloodlust
{
".section buff" : {
"code": "
def(card_list_s, all)
all = hsl_board_friendly_cards($attacker, $heroes_excluded)
def(card_list_s, itm)
foreach(itm, all) {
hsl_buff_attack_expire(1, itm->card, 3);
hsl_add_attachment($player, $attacker, itm->card, 1);
}
",
"target": "$auto"
}
}
@@ -0,0 +1,11 @@
# Shadow Bolt
{
".section spell" : {
"code" : "
$defender->receive.damage = 4;
hsl_attack($attacker, $defenders);
",
"target": "$minions"
}
}
@@ -0,0 +1,16 @@
# Drain Life
{
".section spell_aoe" : {
"code": "
hsl_receive_damage($defender, 2);
hsl_receive_heal($ally_hero, 2);
hsl_add_target($ally_hero, holder);
hsl_attack($attacker, $defenders)
",
"target": "$enemy"
}
}
@@ -0,0 +1,20 @@
# Hellfire
{
".section spell_aoe" : {
"code" : "
def(card_list_s, allcards)
allcards = hsl_board_all_cards($attacker, $heroes_included);
def(card_list_s, cl)
foreach(cl, allcards) {
cl->card->receive.damage = 3;
}
hsl_attack_aoe($attacker, allcards)
hsl_link_target($attacker, allcards)
",
"target": "$auto"
}
}
@@ -0,0 +1,11 @@
# Corruption
{
".section buff" : {
"code": "
hsl_buff_corrupt_expire(2, $defender);
hsl_add_attachment($player, $attacker, $defender, 2);
",
"target": "$minions"
}
}
@@ -0,0 +1,20 @@
# Dread Infernal
{
".section battlecry" : {
"code" : "
def(card_list_s, allcards)
allcards = hsl_board_all_cards($attacker, $heroes_included);
def(card_list_s, cl)
foreach(cl, allcards) {
cl->card->receive.damage = 1;
}
hsl_attack_aoe(attacker, allcards)
hsl_link_target(attacker, allcards)
",
"target": "$auto"
}
}
@@ -0,0 +1,15 @@
# Voidwalker
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$minions"
},
".section properties" : {
"all": [ "taunt" ]
}
}
@@ -0,0 +1,11 @@
# Backstab
{
".section spell" : {
"code" : "
hsl_receive_damage($defender, 2);
hsl_attack($attacker, $defenders);
",
"target": "$undamaged_minions"
}
}
@@ -0,0 +1,11 @@
# Sinister Strike
{
".section battlecry" : {
"code" : "
hsl_attack_bc($attacker, $enemy_hero, 3)
",
"target": "$auto"
}
}
@@ -0,0 +1,10 @@
# Assassinate
{
".section buff" : {
"code" : "
hsl_destroy($defender);
",
"target": "$enemy_minions"
}
}
@@ -0,0 +1,9 @@
# Sprint
{
".section buff" : {
"code": "
hsl_draw_cards($player, $deck_player, draw_card, 4)
",
"target" : "$auto"
}
}
@@ -0,0 +1,9 @@
# Assassin's Blade
{
".section weapon" : {
"code" : "
hsl_give_weapon($deck_player);
"
}
}
@@ -0,0 +1,8 @@
# Wicked Knife
{
".section weapon" : {
"code" : "
hsl_give_weapon($deck_player);
"
}
}
@@ -0,0 +1,12 @@
# Blessing of Might
{
".section buff" : {
"code": "
hsl_change_attack($defender, 3)
hsl_add_signle_attachment($player, $deck_player, $attacker, $defender);
",
"target": "$minions"
}
}
@@ -0,0 +1,10 @@
# Guardian of Kings
{
".section battlecry" : {
"code" : "
hsl_heal($attacker, $ally_hero, 6)
",
"target": "$auto"
}
}
@@ -0,0 +1,13 @@
# Holy Light
{
".section buff" : {
"code" : "
$defender->receive.heal = 6;
hsl_attack($attacker, $defenders);
hsl_link_target($attacker, $defenders);
",
"target": "$all"
}
}
@@ -0,0 +1,9 @@
# Light's Justice
{
".section weapon" : {
"code" : "
hsl_give_weapon($deck_player);
"
}
}
@@ -0,0 +1,12 @@
# Blessing of Kings
{
".section buff" : {
"code": "
hsl_change_attack($defender, 4)
hsl_change_health($defender, 4)
hsl_add_signle_attachment($player, $deck_player, $attacker, $defender);
",
"target": "$minions"
}
}
@@ -0,0 +1,18 @@
# Consecration
{
".section spell_aoe" : {
"code" : "
def(card_list_s, e)
e = hsl_board_enemy_cards($attacker, $heroes_included);
def(card_list_s, cl)
foreach(cl, e) {
cl->card->receive.damage = 2;
}
hsl_attack_aoe($attacker, e)
hsl_link_target($attacker, e)
",
"target": "$auto"
}
}
@@ -0,0 +1,13 @@
# Hammer of Wrath
{
".section spell" : {
"code" : "
$defender->receive.damage = 3;
hsl_attack($attacker, $defenders);
hsl_draw_cards($player, $deck_player, draw_card, 1)
",
"target": "$all"
}
}
@@ -0,0 +1,11 @@
# Heroic Strike
{
".section buff" : {
"code": "
hsl_buff_attack_expire(1, $ally_hero, 4);
hsl_add_attachment($player, $attacker, $ally_hero, 1);
",
"target": "$auto"
}
}
@@ -0,0 +1,8 @@
# Fiery War Axe
{
".section weapon" : {
"code" : "
hsl_give_weapon($deck_player);
"
}
}
@@ -0,0 +1,10 @@
# Execute
{
".section buff" : {
"code" : "
hsl_destroy($defender);
",
"target": "$damaged_minions"
}
}
@@ -0,0 +1,9 @@
# Arcanite Reaper
{
".section weapon" : {
"code" : "
hsl_give_weapon($deck_player);
"
}
}
@@ -0,0 +1,10 @@
# Magma Rager
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$enemy_minions"
}
}
@@ -0,0 +1,14 @@
# Ironforge Rifleman
{
".section battlecry" : {
"code" : "
def(card_s, def)
def = hsl_card($target);
if(def) {
hsl_attack_bc($attacker, def, 1)
}
",
"target": "$all"
}
}
@@ -0,0 +1,11 @@
# Kobold Geomancer
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$enemy_minions"
}
}
@@ -0,0 +1,10 @@
# Bloodfen Raptor
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$enemy_minions"
}
}
@@ -0,0 +1,10 @@
# Razorfen Hunter
{
".section battlecry" : {
"code" : "
hsl_summon_card($deck_player, \"CS2_boar\", cardholder)
",
"target" : "$auto"
}
}
@@ -0,0 +1,11 @@
# Stormwind Champion
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$enemy_minions"
}
}
@@ -0,0 +1,16 @@
# Frostwolf Warlord
{
".section battlecry" : {
"code" : "
int num_minions = hsl_board_minions_count($deck_player, $attacker);
if(num_minions > 0) {
hsl_change_health($attacker, num_minions)
hsl_change_attack($attacker, num_minions)
hsl_add_signle_attachment($player, $deck_player, $attacker, $attacker);
}
",
"target": "$auto"
}
}
@@ -0,0 +1,10 @@
# Shadow Word: Pain
{
".section buff" : {
"code" : "
hsl_destroy($defender);
",
"target": "$attack3less_minions"
}
}
@@ -0,0 +1,10 @@
# Divine Spirit
{
".section buff" : {
"code": "
buff_health($defender, $defender->health * 2);
",
"target": "$minions"
}
}
@@ -0,0 +1,14 @@
# Mirror Image
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$minions"
},
".section properties" : {
"all": [ "taunt" ]
}
}
@@ -0,0 +1,10 @@
# Sheep
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$minions"
}
}
@@ -0,0 +1,20 @@
# Darkscale Healer
{
".section battlecry" : {
"code" : "
def(card_list_s, allcards)
allcards = hsl_board_friendly_cards($attacker, $heroes_included);
def(card_list_s, cl)
foreach(cl, allcards) {
cl->card->receive.heal = 2;
}
hsl_attack_aoe(attacker, allcards)
hsl_link_target(attacker, allcards)
",
"target": "$auto"
}
}
@@ -0,0 +1,10 @@
# Novice Engineer
{
".section battlecry" : {
"code" : "
hsl_draw_cards($player, $deck_player, draw_card, 1)
",
"target": "$auto"
}
}
@@ -0,0 +1,14 @@
# Scarlet Crusader
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$enemy_minions"
},
".section properties" : {
"all": [ "divine_shield" ]
}
}
@@ -0,0 +1,10 @@
# Dragonling Mechanic
{
".section battlecry" : {
"code" : "
hsl_summon_card($deck_player, \"EX1_025t\", cardholder)
",
"target": "$auto"
}
}
@@ -0,0 +1,10 @@
# Acidic Swamp Ooze
{
".section battlecry" : {
"code" : "
hsl_destroy_weapon($attacker, $player, holder)
",
"target": "$auto"
}
}
@@ -0,0 +1,11 @@
# Hex
{
".section buff" : {
"code": "
hsl_transform($attacker, $defender, \"hexfrog\");
",
"target": "$enemy_minions"
}
}
@@ -0,0 +1,10 @@
# Succubus
{
".section battlecry" : {
"code" : "
hsl_discard_random_hand($deck_player, 1, holder)
",
"target": "$auto"
}
}
@@ -0,0 +1,18 @@
# Whirlwind
{
".section spell_aoe" : {
"code" : "
def(card_list_s, e)
e = hsl_board_enemy_cards($attacker, $heroes_excluded);
def(card_list_s, cl)
foreach(cl, e) {
cl->card->receive.damage = 1;
}
hsl_attack_aoe($attacker, e)
hsl_link_target($attacker, e)
",
"target": "$auto"
}
}
@@ -0,0 +1,10 @@
# Murloc Tidehunter
{
".section battlecry" : {
"code" : "
hsl_summon_card($deck_player, \"EX1_506a\", cardholder)
",
"target": "$auto"
}
}
@@ -0,0 +1,13 @@
# Sap
{
".section buff" : {
"code": "
unsetflag($defender, CARD_BOARD)
setflag($defender, CARD_HAND)
$defender->zone_position = ++($deck_opponent->handposition);
",
"target": "$enemy_minions"
}
}
@@ -0,0 +1,10 @@
# Sinister Strike
{
".section battlecry" : {
"code" : "
hsl_attack_bc($attacker, $enemy_hero, 3)
",
"target": "$auto"
}
}
@@ -0,0 +1,12 @@
# Shield Block
{
".section buff" : {
"code": "
hsl_change_armor($ally_hero, 5);
hsl_add_target($ally_hero, holder);
hsl_draw_cards($player, $deck_player, draw_card, 1)
",
"target": "$auto"
}
}
@@ -0,0 +1,12 @@
# Illidan
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$enemy_minions"
}
}
@@ -0,0 +1,11 @@
# Shadow Word: Death
{
".section buff" : {
"code" : "
hsl_destroy($defender);
",
"target": "$attack5more_minions"
}
}
@@ -0,0 +1,10 @@
# HERO_01
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$all"
}
}
@@ -0,0 +1,10 @@
# HERO_03
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$all"
}
}
@@ -0,0 +1,16 @@
# Sacrificial Pact
{
".section spell_aoe" : {
"code": "
hsl_destroy($defender);
hsl_receive_heal($ally_hero, 5);
hsl_add_target($ally_hero, holder);
hsl_attack($attacker, $defenders)
",
"target": "$demon"
}
}
@@ -0,0 +1,22 @@
# Vanish
{
".section buff" : {
"code": "
/*
def(card_list_s, itm)
foreach(itm, $defenders) {
unsetflag(itm->card, CARD_BOARD)
setflag(itm->card, CARD_HAND)
if(controller_player(itm->card)) {
itm->card->zone_position = ++($deck_player->handposition);
} else {
itm->card->zone_position = ++($deck_opponent->handposition);
}
}
*/
",
"target": "$auto"
}
}
@@ -0,0 +1,37 @@
# Healing Totem
{
".section endturn" : {
"code" : "
def(card_list_s, all);
all = hsl_board_friendly_cards_wattacker($heroes_excluded);
def(card_s, found);
def(card_list_s, c);
foreach(c, all) {
if(hsl_cmp_cardname(c, \"NEW1_009\")) {
found = c->card;
break;
}
}
if(found != NULL) {
def(card_list_s, filter);
filter = hsl_board_friendly_cards(found, $heroes_excluded);
foreach(c, filter) {
/* exclude self */
if(c->card == found) continue;
hsl_receive_heal(c->card, 1);
entity_attack(p, found, c->card);
}
found->target.card = all;
flag(&found->state, MECHANICS_TURN_TRIGGER, FLAG_SET);
}
"
}
}
@@ -0,0 +1,20 @@
# Kor'kron Elite
{
".section battlecry" : {
"code" : "
def(card_s, def)
def = hsl_card($target);
if(def) {
hsl_attack_bc($attacker, def, 1)
}
",
"target": "$auto"
},
".section defender" : {
"code" : "
hsl_add_new_card_hand($deck_opponent, \"CS2_boar\", holder)
"
}
}
@@ -0,0 +1,14 @@
# Misha
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$enemy_minions"
},
".section properties" : {
"all": [ "taunt" ]
}
}
@@ -0,0 +1,14 @@
# Huffer
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$enemy_minions"
},
".section properties" : {
"all": [ "charge" ]
}
}
@@ -0,0 +1,14 @@
# Hex
{
".section attack" : {
"code" : "
hsl_attack($attacker, $defenders);
",
"target" : "$minions"
},
".section properties" : {
"all": [ "taunt" ]
}
}
+45
View File
@@ -0,0 +1,45 @@
'''
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
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 <http://www.gnu.org/licenses/>.
'''
RF_SECTION = 1
no_levelup = 0
file_entities = "../../src/proto/ent.c"
file_flags_sections = "../flags_sections"
file_ent_sections = "../../src/proto/ent_sections.c"
file_levelup_c = "../../src/levelup.c"
file_levelup_h = "../../src/include/levelup.h"
sections = {
"buff": ["./include/section_buff.h", "BUFF", []],
"battlecry": ["./include/section_battlecry.h", "BATTLECRY", []],
"defender": ["./include/section_defender.h", "DEFENDER", []],
"spell_aoe": ["./include/section_spell_aoe.h", "SPELL_AOE", []],
"spell": ["./include/section_spell.h", "SPELL", []],
"attack": ["./include/section_attack.h", "ATTACK", []],
"attack_effect": ["./include/section_attack_effect.h", "ATTACK_EFFECT", []],
"weapon": ["./include/section_weapon.h", "WEAPON", []],
"endturn": ["./include/section_endturn.h", "ENDTURN", []],
"onboard": ["./include/section_onboard.h", "ONBOARD", []],
"destroyed": ["./include/section_destroyed.h", "DESTROYED", []],
"weapon_destroyed": ["./include/section_weapon_destroyed.h", "WEAPON_DESTROYED", []],
"idle": ["./include/section_idle.h", "IDLE", []],
"weapon_attack": ["./include/section_weapon_attack.h", "WEAPON_ATTACK", []],
"attachment_attack": ["./include/section_attachment_attack.h", "ATTACHMENT_ATTACK", []],
"attack_effect_attachment": ["./include/section_attack_effect_attachment.h", "ATTACK_EFFECT_ATTACHMENT", []],
}
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
@globals
$player, $opponent
$player_deck, $opponent_deck
$none, $all, $minions, $enemy_minions, $enemy_hero, $enemies, $ally_minions, $ally_hero, $allies, $aoe
#.random: $r_all, $r_enemy_minions, $r_enemies, $r_ally_minions, $r_allies
$zone_play, $zone_deck, $zone_hand, $zone_graveyard, $zone_discard, $zone_setaside, $zone_secret
$attacker, $defenders, $turn
@functions
struct card_s *draw_card(dst, name, amount)
void buff_attack_expire(round, defender, attack)
void add_attachment(player)
+101
View File
@@ -0,0 +1,101 @@
'''
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
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 <http://www.gnu.org/licenses/>.
'''
import os
from couchbase.bucket import Bucket
import config, util, target, parser
def start_sections():
os.system("rm %s" % config.file_flags_sections)
util.write(config.file_ent_sections, "#include <ent_gen.h>\n#include <ent.h>\n\n", "w")
util.write(config.file_ent_sections, "void entities_init2() {\n", "a")
print 'Starting sections:'
for s in config.sections:
b = "#ifndef SECTION_%s_H_\n" % config.sections[s][1].upper()
b += "#define SECTION_%s_H_\n\n" % config.sections[s][1].upper()
util.write(config.sections[s][0], b, "w")
print '\t%s' % config.sections[s][0]
util.write(config.file_levelup_c, "#include <hsl_cardname.h>\n#include <levelup.h>\n\nstruct levelup_s levelup[MAX_LEVELUP] = {\n", "w")
def end_sections():
print 'Ending sections:'
for s in config.sections:
b = '#define __SECTION_%s\\\n' % s.upper()
for t in config.sections[s][2]:
b += '\t%s\\\n' % t
util.write(config.sections[s][0], b, "a")
b = "\n#endif"
util.write(config.sections[s][0], b, "a")
print '\t%s' % config.sections[s][0]
util.write(config.file_ent_sections, "}\n", "a")
util.write(config.file_levelup_c, "};", "a")
lh = "#ifndef LEVELUP_H_\n#define LEVELUP_H_\n\
#define MAX_LEVELUP %d\n\
struct levelup_s {\n\
const char *dst;\n\
const char *src;\n\
};\n\
extern struct levelup_s levelup[MAX_LEVELUP];\n\
#endif" % config.no_levelup
util.write(config.file_levelup_h, lh, "w")
if __name__ == "__main__":
start_sections()
rootDir = './cards/'
p = parser.parser()
cb = Bucket('couchbase://localhost/hbs', password='aci')
loaded = cb.get('u:mod_dota').value
for c in loaded['cards']:
name = ''
for k in c:
if k[0] == '__name':
name = k[1]
if k[0] == '__code': # code comes later than name
p.parse_card(k[1], name)
'''
for c in loaded:
for r in loaded[c]:
for i in loaded[c][r]:
print i
# files
for dir_, dirnames, files in os.walk(rootDir):
dirnames.sort()
files.sort()
for fileName in files:
if(fileName.endswith(".card")):
relDir = os.path.relpath(dir_, rootDir)
relFile = os.path.join(relDir, fileName)
p.parse_card(rootDir + relFile)
'''
end_sections()
+303
View File
@@ -0,0 +1,303 @@
'''
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
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 <http://www.gnu.org/licenses/>.
'''
import json, re
import util, target, config
class parser:
def __init__(self):
self.allowed = self.allowed_sections()
def allowed_sections(self):
loaded = util.read("allowed", 0)
read = 0
al = {}
for a in loaded:
if a.startswith('#'):
continue
elif a.startswith('@'):
if(a.find('section') > -1):
read |= config.RF_SECTION
continue
elif a.startswith('\n'):
read = 0
continue
else:
if((read & config.RF_SECTION) == config.RF_SECTION):
n = a.split(":")
al[n[0]] = n[1].replace("\n", "")
return al
def match_allowed_section(self, dst, src, parent):
for d in dst:
cx = src.split(" ")
if(len(cx) > 1):
if(cx[1] == d):
return [dst[d], src, d]
return []
def match_allowed_sub(self, dst, src):
sub = []
a = src.replace("\n", "").split(",")
for d in dst:
for e in a:
if(e == d):
sub.append([e, dst[d]])
return sub
def card_battlecry_target(self, obj, card):
type = obj[0]
target = obj[1]
print type
def parse_card(self, b, name):
'''
# files
f = util.read(c, 0)
b = ''
for l in f:
b += l.replace("\n","").replace("\t","")
'''
# ignore first line
b = b[b.find('\n') + 1:b.rfind('\n')]
b = b.replace("\n","").replace("\t","")
try:
j = json.loads(b)
except:
print 'parsing json failed %s [%s]' % (name, b)
exit(1)
p = []
for i in j:
f = self.match_allowed_section(self.allowed, i, j)
if(len(f) > 0):
s = self.match_allowed_sub(j[f[1]], f[0])
p.append([f[2], s])
#crd = re.findall("[\w]+.card", c)
#crd = name.split(".")
for i in p:
#print i
for s in i:
if s != 'battlecry' and i[0] == 'battlecry':
util.store_flag(config.file_ent_sections, 'CARD_BATTLECRY', name)
for ms in s:
if 'target' in ms:
for t in target.battlecry[ms[1]]:
util.store_flag(config.file_ent_sections, t, name)
elif 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "attacker")
elif s != 'weapon' and i[0] == 'weapon':
util.store_flag(config.file_ent_sections, 'CARD_SPELL', name)
util.store_flag(config.file_ent_sections, 'CARD_AOE', name)
util.store_flag(config.file_ent_sections, 'CARD_WEAPON', name)
util.store_flag(config.file_ent_sections, 'CARD_NONTARGET', name)
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "attacker")
elif s != 'endturn' and i[0] == 'endturn':
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "attacker")
elif s != 'spell_aoe' and i[0] == 'spell_aoe':
util.store_flag(config.file_ent_sections, 'CARD_SPELL', name)
util.store_flag(config.file_ent_sections, 'CARD_AOE', name)
for ms in s:
if 'target' in ms:
for t in target.regular[ms[1]]:
util.store_flag(config.file_ent_sections, t, name)
elif 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "attacker")
elif s != 'spell' and i[0] == 'spell':
util.store_flag(config.file_ent_sections, 'CARD_SPELL', name)
for ms in s:
if 'target' in ms:
for t in target.regular[ms[1]]:
util.store_flag(config.file_ent_sections, t, name)
elif 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "attacker")
elif s != 'attack' and i[0] == 'attack':
util.store_flag(config.file_ent_sections, 'CARD_MINION', name)
util.store_flag(config.file_ent_sections, 'CARD_TARGETING', name)
for ms in s:
if 'target' in ms:
for t in target.regular[ms[1]]:
util.store_flag(config.file_ent_sections, t, name)
elif 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "attacker")
elif s != 'attack_effect' and i[0] == 'attack_effect':
util.store_flag(config.file_ent_sections, 'CARD_MINION', name)
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "attacker")
elif s != 'onboard' and i[0] == 'onboard':
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "attacker")
elif s != 'destroyed' and i[0] == 'destroyed':
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "fake_defender")
elif s != 'defender' and i[0] == 'defender':
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "fake_defender")
elif s != 'weapon_destroyed' and i[0] == 'weapon_destroyed':
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "fake_weapon")
elif s != 'idle' and i[0] == 'idle':
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "fake_attacker")
elif s != 'weapon_attack' and i[0] == 'weapon_attack':
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "fake_weapon")
elif s != 'attachment_attack' and i[0] == 'attachment_attack':
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "fake_attacker")
elif s != 'attack_effect_attachment' and i[0] == 'attack_effect_attachment':
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "fake_attacker")
elif s != 'properties' and i[0] == 'properties':
for ms in s:
if 'all' in ms:
for mss in ms[1]:
util.store_flag(config.file_ent_sections, "CARD_%s" % mss.upper(), name)
if 'levelup' in ms:
self.levelup(config.file_levelup_c, name, ms[1])
#for mss in ms[1]:
# util.store_flag(config.file_ent_sections, "CARD_%s" % mss.upper(), name)
elif s != 'buff' and i[0] == 'buff':
util.store_flag(config.file_ent_sections, 'CARD_BUFF', name)
util.store_flag(config.file_ent_sections, 'CARD_SPELL', name)
for ms in s:
if 'code' in ms:
ms[1] = ms[1].replace("$", "HSL_")
self.store(name, i[0], ms[1], config.sections[i[0]][0], "attacker")
elif 'target' in ms:
for t in target.regular[ms[1]]:
util.store_flag(config.file_ent_sections, t, name)
def levelup(self, f, dst, src):
util.write(f, "\t{%s, \"%s\"},\n" % (src, dst), "a")
config.no_levelup = config.no_levelup + 1
def store(self, card, section, code, path, entity):
#c = re.findall("[\w]+.card", card)
#c = c[0].split(".")
if(section == 'endturn'):
buf = '#define %s_%s\\\n\
{\\\n\
%s\\\n\
}\n\n' % (section, card, code)
elif(section == 'idle'):
buf = '#define %s_%s\\\n\
{ %s }\\\n\
\n\n' % (section, card, code)
elif(section == 'attack_effect_attachment'):
buf = '#define %s_%s\\\n\
{\\\n\
%s\\\n\
}\n\n' % (section, card,code)
elif(section == 'attachment_attack'):
buf = '#define %s_%s\\\n\
{\\\n\
int count = hsl_count_attachments(HSL_fake_deck, NULL, HSL_fake_attacker, "%s");\\\n\
if(count == 1) {\\\n\
%s\\\n\
}}\n\n' % (section, card, card, code)
else:
buf = '#define %s_%s\\\n\
if(HSL_%s && flag(&(HSL_%s->state), %s_%s_FLAG, FLAG_ISSET)) {\\\n\
%s\\\n\
}\n\n' % (section, card, entity, entity, section, card, code)
util.write(path, buf, "a")
config.sections[section][2].append("%s_%s" % (section, card))
flag = "%s_%s_FLAG, 1000\n" % (section, card)
util.write(config.file_flags_sections, flag, "a")
flag1 = "%s_%s_FLAG" % (section, card)
util.store_flag(config.file_ent_sections, flag1, card)
+63
View File
@@ -0,0 +1,63 @@
'''
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
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 <http://www.gnu.org/licenses/>.
'''
regular = {
"$all" : ["CARD_TARGET_ALL", "CARD_TARGETING"],
"$minions" : ["CARD_TARGET_MINIONS", "CARD_TARGETING"],
"$hero" : ["CARD_TARGET_HERO", "CARD_TARGETING"],
"$enemy_hero" : ["CARD_TARGET_ENEMY_HERO", "CARD_TARGETING"],
"$enemy_minions" : ["CARD_TARGET_ENEMY_MINIONS", "CARD_TARGETING"],
"$ally_hero" : ["CARD_TARGET_ALLY_HERO", "CARD_TARGETING"],
"$ally_minions" : ["CARD_TARGET_ALLY_MINIONS", "CARD_TARGETING"],
"$ally_bosses" : ["CARD_TARGET_ALLY_BOSSES", "CARD_TARGETING"],
"$enemy_bosses" : ["CARD_TARGET_ENEMY_BOSSES", "CARD_TARGETING"],
"$bosses" : ["CARD_TARGET_BOSSES", "CARD_TARGETING"],
"$ally_board" : ["CARD_TARGET_ALLY_BOARD", "CARD_TARGETING"],
"$enemy_board" : ["CARD_TARGET_ENEMY_BOARD", "CARD_TARGETING"],
"$board" : ["CARD_TARGET_BOARD", "CARD_TARGETING"],
"$ally" : ["CARD_TARGET_ALLY", "CARD_TARGETING"],
"$enemy" : ["CARD_TARGET_ENEMY", "CARD_TARGETING"],
"$auto" : ["CARD_NONTARGET"],
"$undamaged_minions":["CARD_TARGET_UNDAMAGED_MINION", "CARD_TARGETING"],
"$damaged_minions":["CARD_TARGET_DAMAGED_MINION", "CARD_TARGETING"],
"$attack5more_minions":["CARD_TARGET_5ATTACK_MORE", "CARD_TARGETING"],
"$attack3less_minions":["CARD_TARGET_3ATTACK_LESS", "CARD_TARGETING"],
"$health_below_30p_minions":["CARD_TARGET_30PERCENT_LESS", "CARD_TARGETING"],
"$URSA":["CARD_TARGET_URSA", "CARD_TARGETING"],
"$SVEN":["CARD_TARGET_SVEN", "CARD_TARGETING"],
}
battlecry = {
"$all" : ["CARD_TARGET_ALL", "CARD_TARGETING_BC"],
"$minions" : ["CARD_TARGET_MINIONS", "CARD_TARGETING_BC"],
"$hero" : ["CARD_TARGET_HERO", "CARD_TARGETING_BC"],
"$enemy_hero" : ["CARD_TARGET_ENEMY_HERO", "CARD_TARGETING_BC"],
"$enemy_minions" : ["CARD_TARGET_ENEMY_MINIONS", "CARD_TARGETING_BC"],
"$ally_hero" : ["CARD_TARGET_ALLY_HERO", "CARD_TARGETING_BC"],
"$ally_minions" : ["CARD_TARGET_ALLY_MINIONS", "CARD_TARGETING_BC"],
"$ally" : ["CARD_TARGET_ALLY", "CARD_TARGETING_BC"],
"$enemy" : ["CARD_TARGET_ENEMY", "CARD_TARGETING_BC"],
"$ally_bosses" : ["CARD_TARGET_ALLY_BOSSES", "CARD_TARGETING_BC"],
"$enemy_bosses" : ["CARD_TARGET_ENEMY_BOSSES", "CARD_TARGETING_BC"],
"$bosses" : ["CARD_TARGET_BOSSES", "CARD_TARGETING_BC"],
"$ally_board" : ["CARD_TARGET_ALLY_BOARD", "CARD_TARGETING_BC"],
"$enemy_board" : ["CARD_TARGET_ENEMY_BOARD", "CARD_TARGETING_BC"],
"$board" : ["CARD_TARGET_BOARD", "CARD_TARGETING_BC"],
"$auto" : ["CARD_NONTARGET_BC"],
"$undamaged_minions":["CARD_TARGET_UNDAMAGED_MINION", "CARD_TARGETING_BC"],
"$damaged_minions":["CARD_TARGET_DAMAGED_MINION", "CARD_TARGETING_BC"],
}
+52
View File
@@ -0,0 +1,52 @@
'''
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
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 <http://www.gnu.org/licenses/>.
'''
import re
import config
def write(f, buf, m):
l = open(f, m)
l.write(buf)
l.close()
def read(f, t):
f = open(f, "r")
if(t == 0):
b = []
c = f.readlines()
for l in c:
if l.startswith('#'):
continue
b.append(l)
return b
else:
b = f.read()
f.close()
return b
def store_flag(dst, f, i):
if(f.find("ENABLED") > -1):
return
lines = read(config.file_entities, 0)
for l in lines:
if(l.find("{ \"%s\"" % i) > -1):
index = re.findall("// [\w]+", l)[0].split(" ")[1]
write(dst, "\tflag(&entities[%s].flags, %s, FLAG_SET);\n" % (index, f), "a")
break

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