Compare commits

..

No commits in common. "master" and "XATRIX_2_11" have entirely different histories.

52 changed files with 1669 additions and 3013 deletions

View file

@ -1,46 +0,0 @@
name: Testbuild for Linux (aarch64)
run-name: testbuild_linux_aarch64
on:
push:
branches:
- 'master'
pull_request:
types:
- edited
- opened
- synchronize
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_ubuntu_aarch64:
runs-on: ubuntu-22.04-arm
strategy:
fail-fast: false
matrix:
include:
- env: ubuntu
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Build
run: |
# Public runners come with 4 CPUs.
make -j4
- name: Create testbuild package
run: |
# Create release directory tree
mkdir -p publish/quake2-xatrix-linux_aarch64-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-xatrix-linux_aarch64-${{github.sha}}/
# Copy misc assets
cp -r stuff/mapfixes publish/quake2-xatrix-linux_aarch64-${{github.sha}}/misc
cp LICENSE publish/quake2-xatrix-linux_aarch64-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-xatrix-linux_aarch64-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
name: quake2-xatrix-linux_aarch64-${{github.sha}}
path: publish/
if-no-files-found: error

View file

@ -1,46 +0,0 @@
name: Testbuild for Linux (x86_64)
run-name: testbuild_linux_x86_64
on:
push:
branches:
- 'master'
pull_request:
types:
- edited
- opened
- synchronize
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_ubuntu_x86_64:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- env: ubuntu
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Build
run: |
# Public runners come with 4 CPUs.
make -j4
- name: Create testbuild package
run: |
# Create release directory tree
mkdir -p publish/quake2-xatrix-linux_x86_64-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-xatrix-linux_x86_64-${{github.sha}}/
# Copy misc assets
cp -r stuff/mapfixes publish/quake2-xatrix-linux_x86_64-${{github.sha}}/misc
cp LICENSE publish/quake2-xatrix-linux_x86_64-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-xatrix-linux_x86_64-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
name: quake2-xatrix-linux_x86_64-${{github.sha}}
path: publish/
if-no-files-found: error

View file

@ -1,50 +0,0 @@
name: Testbuild for MacOS
run-name: testbuild_macos
on:
push:
branches:
- 'master'
pull_request:
types:
- edited
- opened
- synchronize
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_macos_aarch64:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- env: macos
steps:
- name: Install build dependencies
run: |
brew update
brew install make
- name: Check out repository code
uses: actions/checkout@v4
- name: Build
run: |
# Public runners come with 3 CPUs.
gmake -j3
- name: Create testbuild package
run: |
# Create release directory tree
mkdir -p publish/quake2-xatrix-macos-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-xatrix-macos-${{github.sha}}/
# Copy misc assets
cp -r stuff/mapfixes publish/quake2-xatrix-macos-${{github.sha}}/misc
cp LICENSE publish/quake2-xatrix-macos-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-xatrix-macos-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
name: quake2-xatrix-macos-${{github.sha}}
path: publish/
if-no-files-found: error

View file

@ -1,57 +0,0 @@
name: Testbuild for Win32
run-name: testbuild_win32
on:
push:
branches:
- 'master'
pull_request:
types:
- edited
- opened
- synchronize
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_mingw_x86_32:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { sys: mingw32, env: i686 }
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
git
make
mingw-w64-${{matrix.env}}-gcc
mingw-w64-${{matrix.env}}-make
- name: Check out repository code
uses: actions/checkout@v4
- name: Build
shell: msys2 {0}
run: |
# Public runners come with 4 CPUs.
make -j4
- name: Create testbuild package
shell: msys2 {0}
run: |
# Create release directory tree
mkdir -p publish/quake2-xatrix-win32-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-xatrix-win32-${{github.sha}}/
# Copy misc assets
cp -r stuff/mapfixes publish/quake2-xatrix-win32-${{github.sha}}/misc
cp LICENSE publish/quake2-xatrix-win32-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-xatrix-win32-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
name: quake2-xatrix-win32-${{github.sha}}
path: publish/
if-no-files-found: error

View file

@ -1,57 +0,0 @@
name: Testbuild for Win64
run-name: testbuild_win64
on:
push:
branches:
- 'master'
pull_request:
types:
- edited
- opened
- synchronize
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_mingw_x86_64:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { sys: mingw64, env: x86_64 }
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
git
make
mingw-w64-${{matrix.env}}-gcc
mingw-w64-${{matrix.env}}-make
- name: Check out repository code
uses: actions/checkout@v4
- name: Build
shell: msys2 {0}
run: |
# Public runners come with 4 CPUs.
make -j4
- name: Create testbuild package
shell: msys2 {0}
run: |
# Create release directory tree
mkdir -p publish/quake2-xatrix-win64-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-xatrix-win64-${{github.sha}}/
# Copy misc assets
cp -r stuff/mapfixes publish/quake2-xatrix-win64-${{github.sha}}/misc
cp LICENSE publish/quake2-xatrix-win64-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-xatrix-win64-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
name: quake2-xatrix-win64-${{github.sha}}
path: publish/
if-no-files-found: error

View file

@ -1,26 +1,3 @@
The Reckoning 2.13 to 2.14:
- Add weapon preview to the `cycleweap` command (by protocultor)
- Fix leaking temporary spawnflags into entities spawned mid-level. (by
BjossiAlfreds)
The Reckoning 2.12 to 2.13:
- Implement `g_quick_weap`. If set to 1, both weapprev and weapnext
commands will count how many times they have been called, making
possible to skip weapons by quickly tapping one of these keys. (by
protocultor)
- Work around naggy help icons. (by BjossiAlfreds)
- Implement `g_monsterfootsteps`. (by 0lvin)
The Reckoning 2.11 to 2.12:
- Relicense under GPL2.
- Implement `g_swap_speed`. This allows to skip frames of "putting down
weapon" and "raising weapon" animations, speeding them up. (by
protocultor)
- Several fixes to makron (by BjossiAlfreds)
- Fixed stand-ground gladiators not attacking at certain range. (by
BjossiAlfreds)
- Fixed monsters seeing players during intermissions. (by BjossiAlfreds)
The Reckoning 2.10 to 2.11:
- Implement faster weapon switching with the new 'cycleweap' command.
(by protocultor).
@ -28,11 +5,11 @@ The Reckoning 2.10 to 2.11:
a player standing on a blocked elevator gets turned around (by
skuller).
- Fix several coop related bugs with the powercubes. (by BjossiAlfreds)
- A way better fix for dead bodies obstructing elevators or falling
- A way better fix for dead bodys obstructing elevators or falling
through the worldmodel. (by BjossiAlfreds)
- Fix items already in water playing a splash sound at level start. (by
BjossiAlfreds)
- Phalanx explosions should be muffled under water. (by protocultor)
- Phalanx explosions should be muffeled under water. (by protocultor)
The Reckoning 2.09 to 2.10:
- Refine the 'g_footstep' cvar to match Quake II itself.

580
LICENSE
View file

@ -1,340 +1,328 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
LIMITED PROGRAM SOURCE CODE LICENSE
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This Limited Program Source Code License (the "Agreement") is between
Id Software, Inc., a Texas corporation, (hereinafter "Id Software")
and Licensee (as defined below) and is made effective beginning on
the date you, the Licensee, download the Code, as defined below,
(the "Effective Date"). BY DOWNLOADING THE CODE, AS DEFINED
BELOW, YOU, THE LICENSEE, AGREE TO ALL THE TERMS AND CONDITIONS OF
THIS AGREEMENT. YOU SHOULD READ THIS AGREEMENT CAREFULLY BEFORE
DOWNLOADING THE CODE. EVERY PERSON IN POSSESSION OF AN AUTHORIZED
COPY, AS DEFINED BELOW, OF THE CODE SHALL BE SUBJECT TO THE TERMS
AND CONDITIONS OF THIS AGREEMENT.
Preamble
R E C I T A L S
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
WHEREAS, Id Software is the owner and developer of the computer software
program source code accompanied by this Agreement (the "Code");
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
WHEREAS, Id Software desires to license certain limited non-exclusive
rights regarding the Code to Licensee; and
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
WHEREAS, Licensee desires to receive a limited license for such rights.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
T E R M S A N D C O N D I T I O N S
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
NOW, THEREFORE, for and in consideration of the mutual premises
contained herein and for other good and valuable consideration,
the receipt and sufficiency of which is hereby acknowledged, the
undersigned parties do hereby agree as follows:
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
1. Definitions. The parties hereto agree the following definitions
shall apply to this Agreement:
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
a. "Authorized Copy" shall mean a copy of the Code obtained by
Authorized Means, as defined below. A copy of the Code is not
an "Authorized Copy" unless it is accompanied by a copy of this
Agreement and obtained by Authorized Means. A Modified Copy,
as defined below, is not an Authorized Copy;
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
b. "Authorized Means" shall mean obtaining an Authorized Copy only
by downloading the Authorized Copy from Id Software's Internet web
site or from another web site authorized or approved by Id Software
for such purposes or by obtaining an Authorized Copy by electronic
means via the Internet;
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
c. "Code" shall mean the computer software program source code
which accompanies this Agreement and includes Code included within
any Modified Copy and which is the code that constitutes the
Authorized Copy;
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
d. "Game" shall mean QUAKE II;
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
e. "Licensee" shall mean you, the person who is in possession of
an Authorized Copy by Authorized Means; and
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
f. "Modified Copy" shall mean a copy of the Code first obtained
by Authorized Means which is subsequently modified by Licensee,
as provided in paragraph 2. below.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
2. Grant of Rights. Subject to the terms and provisions of this
Agreement, Id Software hereby grants to Licensee and Licensee hereby
accepts, a limited, world-wide (except as otherwise provided herein),
non-exclusive, non-transferable, and non-assignable license to: (i)
use the Authorized Copy and the Modified Copy, as defined above, for
the development by Licensee of extra levels operable with the Game (the
"Extra Levels"); (ii) incorporate all or a portion of the Authorized Copy
and the Modified Copy within the Extra Levels; (iii) distribute by way
of a sublicense limited by the terms of this Agreement, free of charge
and at no cost, the Authorized Copy and the Modified Copy to the extent
such Modified Copy and such Authorized Copy, or a portion thereof, is
included within the Extra Levels; (iv) distribute by way of a sublicense
limited by the terms of this Agreement, free of charge and at no cost, by
electronic transmission via the Internet only the Authorized Copy without
any alteration or modification along with a copy of this Agreement which
must always accompany the Authorized Copy; (v) modify the Authorized Copy
in order to create a Modified Copy, as defined above; and (vi) distribute
the Modified Copy by way of a sublicense limited by the terms of this
Agreement, free of charge and at no cost, by electronic transmission via
the Internet only. Each person or entity who/which receives a copy of
the Code shall be subject to the terms of this Agreement but, no rights
are granted to any person or entity who/which obtains, receives, or is
in possession of any copy of the Code by other than Authorized Means.
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
3. Reservation of Rights and Prohibitions. Id Software expressly
reserves all rights not granted herein. Licensee shall not make any use
of the trademarks relating to the Game or Id Software (the "Trademarks").
Any use by Licensee of the Authorized Copy or the Modified Copy not
expressly permitted in paragraph 2. above is expressly prohibited and
any such unauthorized use shall constitute a material breach of this
Agreement by Licensee. Any use of the Code, whether included within
a Modified Copy or otherwise, and/or the Authorized Copy not permitted
in this Agreement shall constitute an infringement or violation of Id
Software's copyright in the Code. Licensee shall not copy, reproduce,
manufacture or distribute (free of charge or otherwise) the Authorized
Copy or the Modified Copy in any tangible media, including, without
limitation, a CD ROM. Licensee shall not commercially exploit by sale,
lease, rental or otherwise the Authorized Copy or the Modified Copy
whether included within Extra Levels or otherwise. Licensee shall not
commercially exploit by sale, lease, rental or otherwise any Extra Levels
developed by the use of the Code, whether in whole or in part. Licensee
is not receiving any rights hereunder regarding the Game, the Trademarks
or any audio-visual elements, artwork, sound, music, images, characters,
or other element of the Game. Licensee may modify the Authorized Copy in
order to create a Modified Copy, as noted above, but all sublicensees who
receive the Modified Copy shall not receive any rights to commercially
exploit or to make any other use of the Code included therein except the
right to use such Code for such sublicensee's personal entertainment. By
way of example and not exclusion, a sublicensee for the Modified Copy
shall not further modify the Code within the Modified Copy. Only the
Licensee who obtains the Code by Authorized Means shall be permitted to
modify such Code on the terms as described in this Agreement.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
4. Additional Obligations. In addition to the obligations of Licensee
otherwise set forth in this Agreement, during the Term, and thereafter
where specified, Licensee agrees that:
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
a. Licensee will not attack or challenge the ownership by Id
Software of the Code, the Authorized Copy, the Game, the Trademarks,
or any copyright, patent or trademark or other intellectual property
right related thereto and Licensee will not attack or challenge
the validity of the license granted hereunder during the Term or
thereafter; and
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
b. Licensee will promptly inform Id Software of any unauthorized
use of the Code, the Authorized Copy, the Trademarks, or the Game,
or any portions thereof, and will reasonably assist Id Software
in the enforcement of all rights Id Software may have against such
unauthorized users.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
5. Ownership. Title to and all ownership rights in and to the Code,
whether included within the Modified Copy, the Authorized Copy or
otherwise, the Game, the Authorized Copy, and the Trademarks and the
copyrights, trade secrets, trademarks, patents and all other intellectual
property rights related thereto shall remain with Id Software which shall
have the exclusive right to protect the same by copyright or otherwise.
Licensee shall have no ownership rights in or to the Game, the Code,
the Authorized Copy or the Trademarks. Licensee acknowledges that
Licensee, by this Agreement, is only receiving a limited license to use
the Authorized Copy, as specified in paragraph 2. of this Agreement.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
6. Compliance with Applicable Laws. In exercising Licensee's
limited rights hereunder, Licensee shall comply with all applicable
laws, [including, without limitation, 22 U.S.C., section 2778 and 22
U.S.C. C.F.R. Parts 120-130 (1995)] regulations, ordinances and statutes,
including, but not limited to, the import/export laws and regulations
of the United States and its governmental and regulatory agencies
(including, without limitation, the Bureau of Export Administration
and the U.S. Department of Commerce) and all applicable international
treaties and laws.
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
7. Term and Termination.
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
a. The term of this Agreement and the license granted herein
begins on the Effective Date and shall expire, without notice,
on a date one (1) calendar year from the Effective Date (the "Term").
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
b. Either party may terminate this Agreement, for any reason or
no reason, on thirty (30) days written notice to the other party.
Termination will be effective on the thirtieth (30th) day following
delivery of the notice of termination. Notwithstanding anything
to the contrary herein, this Agreement shall immediately terminate,
without the requirement of any notice from Id Software to Licensee,
upon the occurrence of any of the following "Terminating Events":
(i) if Licensee files a petition in bankruptcy; (ii) if Licensee
makes an assignment for the benefit of creditors; (iii) if any
bankruptcy proceeding or assignment for benefit of creditors is
commenced against Licensee and not dismissed within sixty (60)
days after the date of its commencement; (iv) the insolvency of
Licensee; or (v) a breach, whether material or otherwise, of this
Agreement by Licensee. Upon the occurrence of a Terminating Event,
this Agreement and any and all rights hereunder shall terminate
without prejudice to any rights or claims Id Software may have,
and all rights granted hereunder shall revert, without notice,
to and be vested in Id Software.
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
c. Termination or expiration of this Agreement shall not create
any liability against Id Software and shall not relieve Licensee
from any liability which arises prior to termination or expiration.
Upon expiration or earlier termination of this Agreement, Licensee
shall have no further right to exercise the rights licensed hereunder
or otherwise acquired in relation to this Agreement.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
8. Licensee's Warranties. Licensee warrants and represents that:
(i) Licensee has full legal rights and authority to enter into and
become bound by the terms of this Agreement; (ii) Licensee has full
legal rights and authority to perform Licensee?s obligations hereunder;
(iii) Licensee will comply, at all times during the Term, with all
applicable laws, as set forth hereinabove; (iv) all modifications which
Licensee performs on the Code in order to create the Modified Copy and
all non-Id Software property included within Extra Levels shall not
infringe against or misappropriate any third party rights, including,
without limitation, copyrights and trade secrets; and (v) the use or
non-use of all modifications which Licensee performs on the Code in order
to create the Modified Copy and all non-Id Software property included
within Extra Levels shall not infringe against or misappropriate any third
party rights, including, without limitation, copyrights and trade secrets.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
9. Indemnification. Licensee hereby agrees to indemnify, hold
harmless and defend Id Software and Id Software's predecessors,
successors, assigns, officers, directors, shareholders, employees,
agents, representatives, licensees (but not including Licensee),
sublicensees, distributors, attorneys and accountants (collectively,
the "Id Related Parties") from and against any and all "Claims", which
shall mean all damages, claims, losses, causes of action, liabilities,
lawsuits, judgments and expenses (including, without limitation,
reasonable attorneys' fees and expenses) arising from, relating to or in
connection with (i) a breach of this Agreement by Licensee and/or (ii)
Licensee's use or non-use of the Code, whether the Authorized Copy or
whether a portion of the Code as may be included within the Modified
Copy or within Extra Levels. Id Software agrees to notify Licensee
of any such Claims within a reasonable time after Id Software learns
of same. Licensee, at its own expense, shall defend Id Software and the
Id Related Parties from and against any and all Claims. Id Software and
the Id Related Parties reserve the right to participate in any defense
of the Claims with counsel of their choice, and at their own expense.
In the event Licensee fails to provide a defense, then Licensee shall be
responsible for paying the attorneys' fees and expenses incurred by Id
Software and the Id Related Parties regarding the defense of the Claims.
Id Software and the Id Related Parties, as applicable, agree to reasonably
assist in the defense of the Claims. No settlement by Licensee of any
Claims shall be valid unless Licensee receives the prior written consent
of Id Software and the Id Related Parties, as applicable, to any such
settlement, with consent may be withheld in Id Software's and the Id
Related Parties' sole discretion.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
10. Limitation of Liability. UNDER NO CIRCUMSTANCES SHALL ID SOFTWARE
BE LIABLE TO LICENSEE FOR ACTUAL, SPECIAL, INCIDENTAL, CONSEQUENTIAL
OR PUNITIVE DAMAGES OR ANY OTHER DAMAGES, WHETHER OR NOT ID SOFTWARE
RECEIVES NOTICE OF ANY SUCH DAMAGES.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
11. Disclaimer of Warranties. ID SOFTWARE EXPRESSLY DISCLAIMS ALL
WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE, WITH REGARD TO THE CODE, THE AUTHORIZED COPY AND OTHERWISE.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
12. Goodwill. Licensee recognizes the great value of the goodwill
associated with the Game and the Trademarks, and acknowledges that such
goodwill, now existing and hereafter created, exclusively belongs to Id
Software and that the Trademarks have acquired a secondary meaning in
the mind of the public.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
13. Remedies. In the event of a breach of this Agreement by Id Software,
Licensee's sole remedy shall be to terminate this Agreement by delivering
written notice of termination to Id Software. In the event of a breach
by Licensee of this Agreement, Id Software may pursue the remedies to
which Id Software is entitled under applicable law and this Agreement.
Licensee agrees that Licensee's unauthorized use of the Authorized
Copy would immediately and irreparably damage Id Software, and in the
event of such threatened or actual unauthorized use, Id Software shall
be entitled to an injunctive order appropriately restraining and/or
prohibiting such unauthorized use without the necessity of Id Software
posting bond or other security. Pursuit of any remedy by Id Software
shall not constitute a waiver of any other right or remedy of Id Software
under this Agreement or under applicable law.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
14. Choice of Law, Venue and Service of Process. This Agreement shall
be construed in accordance with the laws of the State of Texas and
applicable United States federal law and all claims and/or lawsuits
in connection with this Agreement must be brought in Dallas County,
Texas where exclusive venue shall lie. Licensee hereby agrees that
service of process by certified mail to the address set forth below,
with return receipt requested, shall constitute valid service of process
upon Licensee. If for any reason Licensee has moved or cannot be validly
served, then Licensee appoints the Secretary of State of the state of
Texas to accept service of process on Licensee's behalf.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
15. Delivery of Notices. Unless otherwise directed in writing by
the parties, all notices given hereunder shall be sent to the last
known address of addressee. All notices, requests, consents and other
communications under this Agreement shall be in writing and shall be
deemed to have been delivered on the date personally delivered or on the
date deposited in the United States Postal Service, postage prepaid, by
certified mail, return receipt requested, or telegraphed and confirmed,
or delivered by electronic facsimile and confirmed. Any notice to Id
Software shall also be sent to its counsel: D. Wade Cloud, Jr., Hiersche,
Martens, Hayward, Drakeley & Urbach, P.C., 15303 Dallas Parkway, Suite
700, LB 17, Dallas, Texas 75248.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
16. No Partnership, Etc. This Agreement does not constitute and shall
not be construed as constituting a partnership or joint venture between
Id Software and Licensee. Neither party shall have any right to obligate
or bind the other party in any manner whatsoever, and nothing herein
contained shall give, or is intended to give, any rights of any kind to
any third persons.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
17. Entire agreement. This Agreement constitutes the entire
understanding between Licensee and Id Software regarding the subject
matter hereof. Each and every clause of this Agreement is severable from
the whole and shall survive unless the entire Agreement is declared
unenforceable. No prior or present agreements or representations
between the parties hereto regarding the subject matter hereof shall be
binding upon the parties hereto unless incorporated in this Agreement.
No modification or change in this Agreement shall be valid or binding
upon the parties hereto unless in writing and executed by the parties
to be bound thereby.
NO WARRANTY
18. Assignment. This Agreement shall bind and inure to the benefit of
Id Software, its successors and assigns, and Id Software may assign its
rights hereunder, in Id Software's sole discretion. This Agreement
is personal to Licensee, and Licensee shall not assign, transfer,
convey nor franchise its rights granted hereunder. As provided above,
Licensee may sublicense Licensee's limited rights herein by transferring
the Authorized Copy by Authorized Means. As noted, each sublicensee
in possession of a copy of the Authorized Copy shall be subject to the
terms and conditions of this Agreement.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
19. Survival. The following provisions shall survive the expiration
or earlier termination of this Agreement: paragraphs 5., 8., 9., 10.,
11., 12., 13., 14., 15., 16., 17., 19., 20.a. and 20.b.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
20. Miscellaneous.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
a. All captions in this Agreement are intended solely for the
convenience of the parties, and none shall effect the meaning or
construction of any provision.
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
b. The terms and conditions of this Agreement have been negotiated
fully and freely among the parties. Accordingly, the preparation
of this Agreement by counsel for a given party will not be material
to the construction hereof, and the terms of this Agreement shall
not be strictly construed against such party.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
BY DOWNLOADING THE CODE, AS DEFINED ABOVE, YOU, THE LICENSEE, AGREE TO
ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
Also add information on how to contact you by electronic and paper mail.
February 12, 1998
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View file

@ -6,8 +6,8 @@
# #
# Dependencies: #
# - None, but you need a Quake II to play. #
# While in theory every one should work #
# Yamagi Quake II is recommended. #
# While in theorie every one should work #
# Yamagi Quake II ist recommended. #
# #
# Platforms: #
# - FreeBSD #
@ -88,7 +88,7 @@ endif
# to get it there...
# -fwrapv for defined integer wrapping. MSVC6 did this
# and the game code requires it.
override CFLAGS += -fno-strict-aliasing -fwrapv
override CFLAGS += -std=gnu99 -fno-strict-aliasing -fwrapv
# -MMD to generate header dependencies. Unsupported by
# the Clang shipped with OS X.
@ -276,7 +276,7 @@ XATRIX_OBJS_ = \
# ----------
# Rewrite paths to our object directory
# Rewrite pathes to our object directory
XATRIX_OBJS = $(patsubst %,build/%,$(XATRIX_OBJS_))
# ----------

50
README Normal file
View file

@ -0,0 +1,50 @@
This is a bugfixed version of id Software's Quake II missionpack
"The Reckoning", developed by Xatrix Software. Hundred bugs were
fixed, this version should run much more stable than the the old
SDK version. It should be used with the "Yamagi Quake II Client",
but may work with other clients too. For more information visit
http://www.yamagi.org/quake2.
Installation for FreeBSD, Linux and OpenBSD:
--------------------------------------------
1. Type "make" or "gmake" to compile the game.so.
2. Create a subdirectory xatrix/ in your quake2 directory.
3. Copy pak0.pak and videos/ from the the Reckoning CD to
the newly created directory xatrix/.
4. Copy release/game.so to xatrix/.
5. Start the game with "./quake2 +set game xatrix"
Installation for OS X:
----------------------
1. Create a subdirectory xatrix/ in your quake2 directory.
2. Copy pak0.pak and videos/ from the the Reckoning CD to
the newly created directory xatrix/.
3. Copy game.so from the zip-archive to xatrix/.
4. Start the game with "quake2 +set game xatrix"
If you want to compile 'xatrix' for OS X from source, please take a
look at the "Installation" section of the README of the Yamagi Quake II
client. In the same file the integration into an app-bundle is
explained.
Installation for Windows:
-------------------------
1. Create a subdirectory xatrix\ in your quake2 directory.
2. Copy pak0.pak and videos\ from the the Reckoning CD to
the newly created directory xatrix\.
3. Copy game.dll from the zip-archive to xatrix/.
4. Start the game with "quake2.exe +set game xatrix"
If you want to compile 'xatrix' for Windows from source, please take a
look at the "Installation" section of the README of the Yamagi Quake II
client. There's descripted how to setup the build environment.
=======================================================================
FAQ
---
The sounds after starting "xship" aka "Stroggos Freightener" are
distorted and hurting my ears.
- Yeah, the quality of the sound samples is very low. Not much
we can do about it...

View file

@ -1,67 +0,0 @@
# The Reckoning for Yamagi Quake II
The Reckoning for Yamagi Quake II is a bugfixed version of the first
official missionpack released for Quake II. It's based upon the Quake
II SDK source code and licensed under GPL version 2:
* [LICENSE](https://github.com/yquake2/xatrix/blob/master/LICENSE)
Hundreds of bugs were fixed and some convenience features added. The
missionpack is intended to be used with Yamagi Quake II, but it's also
fully backward compatible with the last Quake II pointrelease 3.20 and
may work with other source ports.
Officially supported operating systems are:
* FreeBSD
* Linux
* Windows
Beside theses The Reckoning for Yamagi Quake II has community support
for MacOS and most other unixoid operating systems, including NetBSD,
OpenBSD and Solaris.
## Development
The Reckoning for Yamagi Quake II is a community driven project and
lives from community involvement. Please report bugs in our issue
tracker:
* [Issue Tracker](https://github.com/yquake2/xatrix/issues)
We are always open to code contributions, no matter if they are small
bugfixes or bigger features. However, Yamagi Quake II is a conservative
project with big focus on stability and backward compatibility. We don't
accept breaking changes. When in doubt please open an issue and ask if a
contribution in welcome before putting too much work into it. Open a
pull request to submit code:
* [Pull Requests](https://github.com/yquake2/xatrix/pulls)
Also have a look at our contributors guide:
* [Contributors Guide](https://github.com/yquake2/yquake2/blob/master/doc/080_contributing.md)
## Documentation
Yamagi Quake II has rather extensive documentation covering all relevant
areas from installation and configuration to package building. Have a
look at the documentation index:
* [Documentation Index](https://github.com/yquake2/yquake2/blob/master/doc/010_index.md)
## Releases
The Reckoning for Yamagi Quake II releases at an irregular schedule. The
official releases with source code tarballs and prebuild Windows
binaries can be found at the homepage:
* [Homepage](https://www.yamagi.org/quake2/)
Our CI builds **unsupported** Linux, MacOS and Windows binaries at every
commit. The artifacts can be found here:
* [Github Actions](https://github.com/yquake2/xatrix/actions)

View file

@ -390,10 +390,6 @@ HuntTarget(edict_t *self)
{
VectorSubtract(self->enemy->s.origin, self->s.origin, vec);
}
else
{
VectorClear(vec);
}
self->ideal_yaw = vectoyaw(vec);
@ -520,11 +516,15 @@ FindTarget(edict_t *self)
else
{
client = level.sight_client;
if (!client)
{
return false; /* no clients to get mad at */
}
}
/* if the entity went away, forget it */
if (!client || !client->inuse ||
(client->client && level.intermissiontime))
if (!client->inuse)
{
return false;
}
@ -902,38 +902,11 @@ ai_run_slide(edict_t *self, float distance)
* Decides if we're going to
* attack or do something else
*/
static qboolean
hesDeadJim(const edict_t *self)
{
const edict_t *enemy = self->enemy;
if (!enemy || !enemy->inuse)
{
return true;
}
if (self->monsterinfo.aiflags & AI_MEDIC)
{
return (enemy->health > 0);
}
if (enemy->client && level.intermissiontime)
{
return true;
}
if (self->monsterinfo.aiflags & AI_BRUTAL)
{
return (enemy->health <= -80);
}
return (enemy->health <= 0);
}
qboolean
ai_checkattack(edict_t *self, float dist)
{
vec3_t temp;
qboolean hesDeadJim;
if (!self)
{
@ -985,10 +958,41 @@ ai_checkattack(edict_t *self, float dist)
enemy_vis = false;
/* see if the enemy is dead */
if (hesDeadJim(self))
hesDeadJim = false;
if ((!self->enemy) || (!self->enemy->inuse))
{
hesDeadJim = true;
}
else if (self->monsterinfo.aiflags & AI_MEDIC)
{
if (self->enemy->health > 0)
{
hesDeadJim = true;
self->monsterinfo.aiflags &= ~AI_MEDIC;
}
}
else
{
if (self->monsterinfo.aiflags & AI_BRUTAL)
{
if (self->enemy->health <= -80)
{
hesDeadJim = true;
}
}
else
{
if (self->enemy->health <= 0)
{
hesDeadJim = true;
}
}
}
if (hesDeadJim)
{
self->enemy = NULL;
self->monsterinfo.aiflags &= ~AI_MEDIC;
if (self->oldenemy && (self->oldenemy->health > 0))
{

View file

@ -759,22 +759,14 @@ Cmd_WeapPrev_f(edict_t *ent)
cl = ent->client;
if (g_quick_weap->value && cl->newweapon)
{
it = cl->newweapon;
}
else if (cl->pers.weapon)
{
it = cl->pers.weapon;
}
else
if (!cl->pers.weapon)
{
return;
}
selected_weapon = ITEM_INDEX(it);
selected_weapon = ITEM_INDEX(cl->pers.weapon);
/* scan for the next valid one */
/* scan for the next valid one */
for (i = 1; i <= MAX_ITEMS; i++)
{
index = (selected_weapon + MAX_ITEMS - i) % MAX_ITEMS;
@ -786,7 +778,12 @@ Cmd_WeapPrev_f(edict_t *ent)
it = &itemlist[index];
if (!it->use || !(it->flags & IT_WEAPON))
if (!it->use)
{
continue;
}
if (!(it->flags & IT_WEAPON))
{
continue;
}
@ -795,12 +792,6 @@ Cmd_WeapPrev_f(edict_t *ent)
if (cl->newweapon == it)
{
if (g_quick_weap->value)
{
cl->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(cl->newweapon->icon);
cl->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS + ITEM_INDEX(cl->newweapon);
cl->pickup_msg_time = level.time + 0.9f;
}
return;
}
}
@ -821,22 +812,14 @@ Cmd_WeapNext_f(edict_t *ent)
cl = ent->client;
if (g_quick_weap->value && cl->newweapon)
{
it = cl->newweapon;
}
else if (cl->pers.weapon)
{
it = cl->pers.weapon;
}
else
if (!cl->pers.weapon)
{
return;
}
selected_weapon = ITEM_INDEX(it);
selected_weapon = ITEM_INDEX(cl->pers.weapon);
/* scan for the next valid one */
/* scan for the next valid one */
for (i = 1; i <= MAX_ITEMS; i++)
{
index = (selected_weapon + i) % MAX_ITEMS;
@ -848,7 +831,12 @@ Cmd_WeapNext_f(edict_t *ent)
it = &itemlist[index];
if (!it->use || !(it->flags & IT_WEAPON))
if (!it->use)
{
continue;
}
if (!(it->flags & IT_WEAPON))
{
continue;
}
@ -857,12 +845,6 @@ Cmd_WeapNext_f(edict_t *ent)
if (cl->newweapon == it)
{
if (g_quick_weap->value)
{
cl->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(cl->newweapon->icon);
cl->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS + ITEM_INDEX(cl->newweapon);
cl->pickup_msg_time = level.time + 0.9f;
}
return;
}
}
@ -1630,37 +1612,29 @@ void
Cmd_CycleWeap_f(edict_t *ent)
{
gitem_t *weap;
gclient_t *cl;
int num_weaps;
if (!ent)
{
return;
}
num_weaps = gi.argc();
if (num_weaps <= 1)
if (gi.argc() <= 1)
{
gi.cprintf(ent, PRINT_HIGH, "Usage: cycleweap classname1 classname2 .. classnameN\n");
return;
}
weap = cycle_weapon(ent);
if (!weap) return;
cl = ent->client;
if (cl->pers.inventory[ITEM_INDEX(weap)] <= 0)
if (weap)
{
gi.cprintf(ent, PRINT_HIGH, "Out of item: %s\n", weap->pickup_name);
return;
}
weap->use(ent, weap);
if (num_weaps > 3 && cl->newweapon == weap)
{
cl->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(weap->icon);
cl->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS + ITEM_INDEX(weap);
cl->pickup_msg_time = level.time + 0.7f;
if (ent->client->pers.inventory[ITEM_INDEX(weap)] <= 0)
{
gi.cprintf(ent, PRINT_HIGH, "Out of item: %s\n", weap->pickup_name);
}
else
{
weap->use(ent, weap);
}
}
}

View file

@ -108,6 +108,11 @@ Killed(edict_t *targ, edict_t *inflictor, edict_t *attacker,
return;
}
if (targ->health < -999)
{
targ->health = -999;
}
targ->enemy = attacker;
if ((targ->svflags & SVF_MONSTER) && (targ->deadflag != DEAD_DEAD))
@ -481,24 +486,6 @@ M_ReactToDamage(edict_t *targ, edict_t *attacker)
}
}
static void
apply_knockback(edict_t *targ, vec3_t dir, float knockback, float scale)
{
vec3_t kvel;
float mass;
if (!knockback)
{
return;
}
mass = (targ->mass < 50) ? 50.0f : (float)targ->mass;
VectorNormalize2(dir, kvel);
VectorScale(kvel, scale * (knockback / mass), kvel);
VectorAdd(targ->velocity, kvel, targ->velocity);
}
void
T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
vec3_t point, vec3_t normal, int damage, int knockback, int dflags,
@ -565,6 +552,8 @@ T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
te_sparks = TE_SPARKS;
}
VectorNormalize(dir);
/* bonus damage for suprising a monster */
if (!(dflags & DAMAGE_RADIUS) && (targ->svflags & SVF_MONSTER) &&
(attacker->client) && (!targ->enemy) && (targ->health > 0))
@ -578,14 +567,36 @@ T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
}
/* figure momentum add */
if (!(dflags & DAMAGE_NO_KNOCKBACK) &&
(targ->movetype != MOVETYPE_NONE) &&
(targ->movetype != MOVETYPE_BOUNCE) &&
(targ->movetype != MOVETYPE_PUSH) &&
(targ->movetype != MOVETYPE_STOP))
if (!(dflags & DAMAGE_NO_KNOCKBACK))
{
apply_knockback (targ, dir, knockback,
((client && attacker == targ) ? 1600.0f : 500.0f));
if ((knockback) && (targ->movetype != MOVETYPE_NONE) &&
(targ->movetype != MOVETYPE_BOUNCE) &&
(targ->movetype != MOVETYPE_PUSH) &&
(targ->movetype != MOVETYPE_STOP))
{
vec3_t kvel;
float mass;
if (targ->mass < 50)
{
mass = 50;
}
else
{
mass = targ->mass;
}
if (targ->client && (attacker == targ))
{
VectorScale(dir, 1600.0 * (float)knockback / mass, kvel); /* the rocket jump hack... */
}
else
{
VectorScale(dir, 500.0 * (float)knockback / mass, kvel);
}
VectorAdd(targ->velocity, kvel, targ->velocity);
}
}
take = damage;

View file

@ -1401,13 +1401,13 @@ door_go_up(edict_t *self, edict_t *activator)
void
door_use(edict_t *self, edict_t *other /* unused */, edict_t *activator)
{
edict_t *ent;
if (!self)
if (!self || !activator)
{
return;
}
edict_t *ent;
if (self->flags & FL_TEAMSLAVE)
{
return;
@ -2446,22 +2446,13 @@ void
trigger_elevator_use(edict_t *self, edict_t *other, edict_t *activator /* unused */)
{
edict_t *target;
edict_t *train;
if (!self || !other)
{
return;
}
train = self->movetarget;
if (!train || !train->inuse ||
!train->classname || strcmp(train->classname, "func_train") != 0)
{
return;
}
if (train->nextthink)
if (self->movetarget->nextthink)
{
return;
}
@ -2480,8 +2471,8 @@ trigger_elevator_use(edict_t *self, edict_t *other, edict_t *activator /* unused
return;
}
train->target_ent = target;
train_resume(train);
self->movetarget->target_ent = target;
train_resume(self->movetarget);
}
void

View file

@ -37,7 +37,6 @@ cvar_t *maxentities;
cvar_t *g_select_empty;
cvar_t *dedicated;
cvar_t *g_footsteps;
cvar_t *g_monsterfootsteps;
cvar_t *g_fix_triggered;
cvar_t *filterban;
@ -69,8 +68,6 @@ cvar_t *gib_on;
cvar_t *aimfix;
cvar_t *g_machinegun_norecoil;
cvar_t *g_quick_weap;
cvar_t *g_swap_speed;
void SpawnEntities(char *mapname, char *entities, char *spawnpoint);
void ClientThink(edict_t *ent, usercmd_t *cmd);

View file

@ -203,7 +203,6 @@ ThrowGib(edict_t *self, char *gibname, int damage, int type)
gi.setmodel(gib, gibname);
gib->solid = SOLID_BBOX;
gib->svflags = SVF_DEADMONSTER;
gib->s.effects |= EF_GIB;
gib->flags |= FL_NO_KNOCKBACK;
gib->takedamage = DAMAGE_YES;
@ -828,7 +827,7 @@ SP_info_null(edict_t *self)
/*
* QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4)
* Used as a positional target for lighting.
* Used as a positional target for lightning.
*/
void
SP_info_notnull(edict_t *self)

View file

@ -744,9 +744,6 @@ SpawnEntities(const char *mapname, char *entities, const char *spawnpoint)
ED_CallSpawn(ent);
}
/* in case the last entity in the entstring has spawntemp fields */
memset(&st, 0, sizeof(st));
gi.dprintf("%i entities inhibited.\n", inhibit);
G_FindTeams();

View file

@ -159,11 +159,11 @@ SV_FilterPacket(char *from)
{
if ((in & ipfilters[i].mask) == ipfilters[i].compare)
{
return (filterban->value != 0);
return (int)filterban->value;
}
}
return (filterban->value == 0);
return (int)!filterban->value;
}
void

View file

@ -7,9 +7,6 @@
#include "header/local.h"
#define TARGET_HELP_PRIMARY 1
#define TARGET_HELP_THINK_DELAY 0.3f
/* QUAKED target_temp_entity (1 0 0) (-8 -8 -8) (8 8 8)
* Fire an origin based temp entity event to the clients.
*
@ -154,72 +151,26 @@ SP_target_speaker(edict_t *ent)
/* ========================================================== */
static void
Target_Help_Apply(const char *msg, int is_primary)
void
Use_Target_Help(edict_t *ent, edict_t *other, edict_t *activator)
{
char *curr;
size_t sz;
if (!msg)
if (!ent)
{
return;
}
if (is_primary)
if (ent->spawnflags & 1)
{
curr = game.helpmessage1;
sz = sizeof(game.helpmessage1);
strncpy(game.helpmessage1, ent->message, sizeof(game.helpmessage2) - 1);
}
else
{
curr = game.helpmessage2;
sz = sizeof(game.helpmessage2);
strncpy(game.helpmessage2, ent->message, sizeof(game.helpmessage1) - 1);
}
if (strcmp(curr, msg) == 0)
{
return;
}
Q_strlcpy(curr, msg, sz - 1);
game.helpchanged++;
}
void
Target_Help_Think(edict_t *ent)
{
if (!ent)
{
return;
}
Target_Help_Apply(ent->message, ent->spawnflags & TARGET_HELP_PRIMARY);
ent->think = NULL;
}
void
Use_Target_Help(edict_t *ent, edict_t *other /* unused */, edict_t *activator /* unused */)
{
if (!ent)
{
return;
}
if (level.time > TARGET_HELP_THINK_DELAY)
{
Target_Help_Apply(ent->message, ent->spawnflags & TARGET_HELP_PRIMARY);
}
else
{
/* The game is still pre-loading so delay the help message a bit,
otherwise its changes to game structure will leak past save loads
*/
ent->think = Target_Help_Think;
ent->nextthink = TARGET_HELP_THINK_DELAY;
}
}
/*
* QUAKED target_help (1 0 1) (-16 -16 -24) (16 16 24) help1
* When fired, the "message" key becomes the current personal computer string,

View file

@ -1061,14 +1061,7 @@ bfg_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
gi.sound(self, CHAN_VOICE, gi.soundindex("weapons/bfg__x1b.wav"), 1, ATTN_NORM, 0);
self->solid = SOLID_NOT;
self->touch = NULL;
/* move it back a bit from walls so the effects aren't cut off */
if (!other->takedamage)
{
VectorNormalize(self->velocity);
VectorMA(self->s.origin, -40.0f, self->velocity, self->s.origin);
}
VectorMA(self->s.origin, -1 * FRAMETIME, self->velocity, self->s.origin);
VectorClear(self->velocity);
self->s.modelindex = gi.modelindex("sprites/s_bfg3.sp2");
self->s.frame = 0;
@ -1078,8 +1071,6 @@ bfg_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
self->nextthink = level.time + FRAMETIME;
self->enemy = other;
gi.linkentity(self);
gi.WriteByte(svc_temp_entity);
gi.WriteByte(TE_BFG_BIGEXPLOSION);
gi.WritePosition(self->s.origin);

View file

@ -513,7 +513,6 @@ extern cvar_t *needpass;
extern cvar_t *g_select_empty;
extern cvar_t *dedicated;
extern cvar_t *g_footsteps;
extern cvar_t *g_monsterfootsteps;
extern cvar_t *g_fix_triggered;
extern cvar_t *filterban;
@ -543,8 +542,6 @@ extern cvar_t *sv_maplist;
extern cvar_t *aimfix;
extern cvar_t *g_machinegun_norecoil;
extern cvar_t *g_quick_weap;
extern cvar_t *g_swap_speed;
#define world (&g_edicts[0])

View file

@ -18,20 +18,8 @@
#include <stdlib.h>
#include <time.h>
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L // C23 or newer
typedef bool qboolean;
#else
#ifdef true
#undef true
#endif
#ifdef false
#undef false
#endif
typedef enum {false, true} qboolean;
#endif
typedef unsigned char byte;
typedef enum {false, true} qboolean;
#ifndef NULL
#define NULL ((void *)0)

View file

@ -1,23 +1,4 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
/* =======================================================================
*
* The berserker.
*
@ -34,37 +15,10 @@ static int sound_punch;
static int sound_sight;
static int sound_search;
static int sound_step;
static int sound_step2;
void
berserk_footstep(edict_t *self)
{
if (!g_monsterfootsteps->value)
return;
// Lazy loading for savegame compatibility.
if (sound_step == 0 || sound_step2 == 0)
{
sound_step = gi.soundindex("berserk/step1.wav");
sound_step2 = gi.soundindex("berserk/step2.wav");
}
if (randk() % 2 == 0)
{
gi.sound(self, CHAN_BODY, sound_step, 1, ATTN_NORM, 0);
}
else
{
gi.sound(self, CHAN_BODY, sound_step2, 1, ATTN_NORM, 0);
}
}
void
berserk_sight(edict_t *self, edict_t *other /* unused */)
{
if (!self)
if (!self)
{
return;
}
@ -75,7 +29,7 @@ berserk_sight(edict_t *self, edict_t *other /* unused */)
void
berserk_search(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -85,7 +39,7 @@ berserk_search(edict_t *self)
void berserk_fidget(edict_t *self);
static mframe_t berserk_frames_stand[] = {
mframe_t berserk_frames_stand[] = {
{ai_stand, 0, berserk_fidget},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -93,18 +47,17 @@ static mframe_t berserk_frames_stand[] = {
{ai_stand, 0, NULL}
};
mmove_t berserk_move_stand =
{
mmove_t berserk_move_stand = {
FRAME_stand1,
FRAME_stand5,
berserk_frames_stand,
NULL
FRAME_stand5,
berserk_frames_stand,
NULL
};
void
berserk_stand(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -112,7 +65,7 @@ berserk_stand(edict_t *self)
self->monsterinfo.currentmove = &berserk_move_stand;
}
static mframe_t berserk_frames_stand_fidget[] = {
mframe_t berserk_frames_stand_fidget[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -135,8 +88,7 @@ static mframe_t berserk_frames_stand_fidget[] = {
{ai_stand, 0, NULL}
};
mmove_t berserk_move_stand_fidget =
{
mmove_t berserk_move_stand_fidget = {
FRAME_standb1,
FRAME_standb20,
berserk_frames_stand_fidget,
@ -146,7 +98,7 @@ mmove_t berserk_move_stand_fidget =
void
berserk_fidget(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -170,23 +122,22 @@ berserk_fidget(edict_t *self)
gi.sound(self, CHAN_WEAPON, sound_idle, 1, ATTN_IDLE, 0);
}
static mframe_t berserk_frames_walk[] = {
mframe_t berserk_frames_walk[] = {
{ai_walk, 9.1, NULL},
{ai_walk, 6.3, NULL},
{ai_walk, 4.9, NULL},
{ai_walk, 6.7, berserk_footstep},
{ai_walk, 6.7, NULL},
{ai_walk, 6.0, NULL},
{ai_walk, 8.2, NULL},
{ai_walk, 7.2, NULL},
{ai_walk, 6.1, NULL},
{ai_walk, 4.9, berserk_footstep},
{ai_walk, 4.9, NULL},
{ai_walk, 4.7, NULL},
{ai_walk, 4.7, NULL},
{ai_walk, 4.8, NULL}
};
mmove_t berserk_move_walk =
{
mmove_t berserk_move_walk = {
FRAME_walkc1,
FRAME_walkc11,
berserk_frames_walk,
@ -196,7 +147,7 @@ mmove_t berserk_move_walk =
void
berserk_walk(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -204,17 +155,16 @@ berserk_walk(edict_t *self)
self->monsterinfo.currentmove = &berserk_move_walk;
}
static mframe_t berserk_frames_run1[] = {
mframe_t berserk_frames_run1[] = {
{ai_run, 21, NULL},
{ai_run, 11, berserk_footstep},
{ai_run, 11, NULL},
{ai_run, 21, NULL},
{ai_run, 25, NULL},
{ai_run, 18, berserk_footstep},
{ai_run, 18, NULL},
{ai_run, 19, NULL}
};
mmove_t berserk_move_run1 =
{
mmove_t berserk_move_run1 = {
FRAME_run1,
FRAME_run6,
berserk_frames_run1,
@ -224,7 +174,7 @@ mmove_t berserk_move_run1 =
void
berserk_run(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -244,7 +194,7 @@ berserk_attack_spike(edict_t *self)
{
static vec3_t aim = {MELEE_DISTANCE, 0, -24};
if (!self)
if (!self)
{
return;
}
@ -255,7 +205,7 @@ berserk_attack_spike(edict_t *self)
void
berserk_swing(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -263,7 +213,7 @@ berserk_swing(edict_t *self)
gi.sound(self, CHAN_WEAPON, sound_punch, 1, ATTN_NORM, 0);
}
static mframe_t berserk_frames_attack_spike[] = {
mframe_t berserk_frames_attack_spike[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, berserk_swing},
@ -274,8 +224,7 @@ static mframe_t berserk_frames_attack_spike[] = {
{ai_charge, 0, NULL}
};
mmove_t berserk_move_attack_spike =
{
mmove_t berserk_move_attack_spike = {
FRAME_att_c1,
FRAME_att_c8,
berserk_frames_attack_spike,
@ -287,7 +236,7 @@ berserk_attack_club(edict_t *self)
{
vec3_t aim;
if (!self)
if (!self)
{
return;
}
@ -296,10 +245,10 @@ berserk_attack_club(edict_t *self)
fire_hit(self, aim, (5 + (rand() % 6)), 400); /* Slower attack */
}
static mframe_t berserk_frames_attack_club[] = {
mframe_t berserk_frames_attack_club[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, berserk_footstep},
{ai_charge, 0, NULL},
{ai_charge, 0, berserk_swing},
{ai_charge, 0, NULL},
@ -311,8 +260,7 @@ static mframe_t berserk_frames_attack_club[] = {
{ai_charge, 0, NULL}
};
mmove_t berserk_move_attack_club =
{
mmove_t berserk_move_attack_club = {
FRAME_att_c9,
FRAME_att_c20,
berserk_frames_attack_club,
@ -326,25 +274,24 @@ berserk_strike(edict_t *self)
very PITA. Let it be... */
}
static mframe_t berserk_frames_attack_strike[] = {
mframe_t berserk_frames_attack_strike[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, berserk_footstep},
{ai_move, 0, berserk_swing},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, berserk_strike},
{ai_move, 0, berserk_footstep},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 9.7, NULL},
{ai_move, 13.6, berserk_footstep}
{ai_move, 13.6, NULL}
};
mmove_t berserk_move_attack_strike =
{
mmove_t berserk_move_attack_strike = {
FRAME_att_c21,
FRAME_att_c34,
berserk_frames_attack_strike,
@ -354,7 +301,7 @@ mmove_t berserk_move_attack_strike =
void
berserk_melee(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -369,22 +316,21 @@ berserk_melee(edict_t *self)
}
}
static mframe_t berserk_frames_pain1[] = {
mframe_t berserk_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t berserk_move_pain1 =
{
mmove_t berserk_move_pain1 = {
FRAME_painc1,
FRAME_painc4,
berserk_frames_pain1,
berserk_run
};
static mframe_t berserk_frames_pain2[] = {
mframe_t berserk_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -407,8 +353,7 @@ static mframe_t berserk_frames_pain2[] = {
{ai_move, 0, NULL}
};
mmove_t berserk_move_pain2 =
{
mmove_t berserk_move_pain2 = {
FRAME_painb1,
FRAME_painb20,
berserk_frames_pain2,
@ -416,10 +361,10 @@ mmove_t berserk_move_pain2 =
};
void
berserk_pain(edict_t *self, edict_t *other /* unused */,
berserk_pain(edict_t *self, edict_t *other /* unsued */,
float kick /* unused */, int damage)
{
if (!self)
if (!self)
{
return;
}
@ -455,7 +400,7 @@ berserk_pain(edict_t *self, edict_t *other /* unused */,
void
berserk_dead(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -468,7 +413,7 @@ berserk_dead(edict_t *self)
gi.linkentity(self);
}
static mframe_t berserk_frames_death1[] = {
mframe_t berserk_frames_death1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -484,15 +429,14 @@ static mframe_t berserk_frames_death1[] = {
{ai_move, 0, NULL}
};
mmove_t berserk_move_death1 =
{
mmove_t berserk_move_death1 = {
FRAME_death1,
FRAME_death13,
berserk_frames_death1,
berserk_dead
};
static mframe_t berserk_frames_death2[] = {
mframe_t berserk_frames_death2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -503,21 +447,20 @@ static mframe_t berserk_frames_death2[] = {
{ai_move, 0, NULL}
};
mmove_t berserk_move_death2 =
{
mmove_t berserk_move_death2 = {
FRAME_deathc1,
FRAME_deathc8,
FRAME_deathc8,
berserk_frames_death2,
berserk_dead
};
void
berserk_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */,
berserk_die(edict_t *self, edict_t *inflictor /* unsued */, edict_t *attacker /* unused */,
int damage, vec3_t point /* unused */)
{
int n;
if (!self)
if (!self)
{
return;
}
@ -528,18 +471,15 @@ berserk_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /*
for (n = 0; n < 2; n++)
{
ThrowGib(self, "models/objects/gibs/bone/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
}
for (n = 0; n < 4; n++)
{
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
}
ThrowHead(self, "models/objects/gibs/head2/tris.md2",
damage, GIB_ORGANIC);
ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
@ -569,7 +509,7 @@ berserk_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /*
void
SP_monster_berserk(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -580,11 +520,6 @@ SP_monster_berserk(edict_t *self)
return;
}
// Force recaching at next footstep to ensure
// that the sound indices are correct.
sound_step = 0;
sound_step2 = 0;
/* pre-caches */
sound_pain = gi.soundindex("berserk/berpain2.wav");
sound_die = gi.soundindex("berserk/berdeth2.wav");

View file

@ -149,7 +149,7 @@ Boss2MachineGun(edict_t *self)
boss2_firebullet_right(self);
}
static mframe_t boss2_frames_stand[] = {
mframe_t boss2_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -180,7 +180,7 @@ mmove_t boss2_move_stand = {
NULL
};
static mframe_t boss2_frames_fidget[] = {
mframe_t boss2_frames_fidget[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -220,7 +220,7 @@ mmove_t boss2_move_fidget = {
NULL
};
static mframe_t boss2_frames_walk[] = {
mframe_t boss2_frames_walk[] = {
{ai_walk, 8, NULL},
{ai_walk, 8, NULL},
{ai_walk, 8, NULL},
@ -250,7 +250,7 @@ mmove_t boss2_move_walk = {
NULL
};
static mframe_t boss2_frames_run[] = {
mframe_t boss2_frames_run[] = {
{ai_run, 8, NULL},
{ai_run, 8, NULL},
{ai_run, 8, NULL},
@ -280,7 +280,7 @@ mmove_t boss2_move_run = {
NULL
};
static mframe_t boss2_frames_attack_pre_mg[] = {
mframe_t boss2_frames_attack_pre_mg[] = {
{ai_charge, 1, NULL},
{ai_charge, 1, NULL},
{ai_charge, 1, NULL},
@ -299,7 +299,7 @@ mmove_t boss2_move_attack_pre_mg = {
NULL
};
static mframe_t boss2_frames_attack_mg[] = {
mframe_t boss2_frames_attack_mg[] = {
{ai_charge, 1, Boss2MachineGun},
{ai_charge, 1, Boss2MachineGun},
{ai_charge, 1, Boss2MachineGun},
@ -315,7 +315,7 @@ mmove_t boss2_move_attack_mg = {
NULL
};
static mframe_t boss2_frames_attack_post_mg[] = {
mframe_t boss2_frames_attack_post_mg[] = {
{ai_charge, 1, NULL},
{ai_charge, 1, NULL},
{ai_charge, 1, NULL},
@ -329,7 +329,7 @@ mmove_t boss2_move_attack_post_mg = {
boss2_run
};
static mframe_t boss2_frames_attack_rocket[] = {
mframe_t boss2_frames_attack_rocket[] = {
{ai_charge, 1, NULL},
{ai_charge, 1, NULL},
{ai_charge, 1, NULL},
@ -360,7 +360,7 @@ mmove_t boss2_move_attack_rocket = {
boss2_run
};
static mframe_t boss2_frames_pain_heavy[] = {
mframe_t boss2_frames_pain_heavy[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -388,7 +388,7 @@ mmove_t boss2_move_pain_heavy = {
boss2_run
};
static mframe_t boss2_frames_pain_light[] = {
mframe_t boss2_frames_pain_light[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -402,7 +402,7 @@ mmove_t boss2_move_pain_light = {
boss2_run
};
static mframe_t boss2_frames_death[] = {
mframe_t boss2_frames_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},

View file

@ -67,7 +67,7 @@ jorg_search(edict_t *self)
}
/* stand */
static mframe_t jorg_frames_stand[] = {
mframe_t jorg_frames_stand[] = {
{ai_stand, 0, jorg_idle},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -183,7 +183,7 @@ jorg_stand(edict_t *self)
self->monsterinfo.currentmove = &jorg_move_stand;
}
static mframe_t jorg_frames_run[] = {
mframe_t jorg_frames_run[] = {
{ai_run, 17, jorg_step_left},
{ai_run, 0, NULL},
{ai_run, 0, NULL},
@ -208,7 +208,7 @@ mmove_t jorg_move_run = {
};
/* walk */
static mframe_t jorg_frames_start_walk[] = {
mframe_t jorg_frames_start_walk[] = {
{ai_walk, 5, NULL},
{ai_walk, 6, NULL},
{ai_walk, 7, NULL},
@ -223,7 +223,7 @@ mmove_t jorg_move_start_walk = {
NULL
};
static mframe_t jorg_frames_walk[] = {
mframe_t jorg_frames_walk[] = {
{ai_walk, 17, NULL},
{ai_walk, 0, NULL},
{ai_walk, 0, NULL},
@ -247,7 +247,7 @@ mmove_t jorg_move_walk = {
NULL
};
static mframe_t jorg_frames_end_walk[] = {
mframe_t jorg_frames_end_walk[] = {
{ai_walk, 11, NULL},
{ai_walk, 0, NULL},
{ai_walk, 0, NULL},
@ -292,7 +292,7 @@ jorg_run(edict_t *self)
}
}
static mframe_t jorg_frames_pain3[] = {
mframe_t jorg_frames_pain3[] = {
{ai_move, -28, NULL},
{ai_move, -6, NULL},
{ai_move, -3, jorg_step_left},
@ -327,7 +327,7 @@ mmove_t jorg_move_pain3 = {
jorg_run
};
static mframe_t jorg_frames_pain2[] = {
mframe_t jorg_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
@ -340,7 +340,7 @@ mmove_t jorg_move_pain2 = {
jorg_run
};
static mframe_t jorg_frames_pain1[] = {
mframe_t jorg_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
@ -353,7 +353,7 @@ mmove_t jorg_move_pain1 = {
jorg_run
};
static mframe_t jorg_frames_death1[] = {
mframe_t jorg_frames_death1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -413,7 +413,7 @@ mmove_t jorg_move_death = {
jorg_dead
};
static mframe_t jorg_frames_attack2[] = {
mframe_t jorg_frames_attack2[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -436,7 +436,7 @@ mmove_t jorg_move_attack2 = {
jorg_run
};
static mframe_t jorg_frames_start_attack1[] = {
mframe_t jorg_frames_start_attack1[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -454,7 +454,7 @@ mmove_t jorg_move_start_attack1 = {
jorg_attack1
};
static mframe_t jorg_frames_attack1[] = {
mframe_t jorg_frames_attack1[] = {
{ai_charge, 0, jorg_firebullet},
{ai_charge, 0, jorg_firebullet},
{ai_charge, 0, jorg_firebullet},
@ -470,7 +470,7 @@ mmove_t jorg_move_attack1 = {
jorg_reattack1
};
static mframe_t jorg_frames_end_attack1[] = {
mframe_t jorg_frames_end_attack1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},

View file

@ -60,7 +60,7 @@ makron_taunt(edict_t *self)
}
/* stand */
static mframe_t makron_frames_stand[] = {
mframe_t makron_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -141,7 +141,7 @@ makron_stand(edict_t *self)
self->monsterinfo.currentmove = &makron_move_stand;
}
static mframe_t makron_frames_run[] = {
mframe_t makron_frames_run[] = {
{ai_run, 3, makron_step_left},
{ai_run, 12, NULL},
{ai_run, 8, NULL},
@ -227,6 +227,19 @@ makron_prerailgun(edict_t *self)
gi.sound(self, CHAN_WEAPON, sound_prerailgun, 1, ATTN_NORM, 0);
}
mframe_t makron_frames_walk[] = {
{ai_walk, 3, makron_step_left},
{ai_walk, 12, NULL},
{ai_walk, 8, NULL},
{ai_walk, 8, NULL},
{ai_walk, 8, makron_step_right},
{ai_walk, 6, NULL},
{ai_walk, 12, NULL},
{ai_walk, 9, NULL},
{ai_walk, 6, NULL},
{ai_walk, 12, NULL}
};
mmove_t makron_move_walk = {
FRAME_walk204,
FRAME_walk213,
@ -263,7 +276,7 @@ makron_run(edict_t *self)
}
}
static mframe_t makron_frames_pain6[] = {
mframe_t makron_frames_pain6[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -300,7 +313,7 @@ mmove_t makron_move_pain6 = {
makron_run
};
static mframe_t makron_frames_pain5[] = {
mframe_t makron_frames_pain5[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -314,7 +327,7 @@ mmove_t makron_move_pain5 = {
makron_run
};
static mframe_t makron_frames_pain4[] = {
mframe_t makron_frames_pain4[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -328,7 +341,7 @@ mmove_t makron_move_pain4 = {
makron_run
};
static mframe_t makron_frames_death2[] = {
mframe_t makron_frames_death2[] = {
{ai_move, -15, NULL},
{ai_move, 3, NULL},
{ai_move, -12, NULL},
@ -433,7 +446,7 @@ mmove_t makron_move_death2 = {
makron_dead
};
static mframe_t makron_frames_death3[] = {
mframe_t makron_frames_death3[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -463,7 +476,7 @@ mmove_t makron_move_death3 = {
NULL
};
static mframe_t makron_frames_sight[] = {
mframe_t makron_frames_sight[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -511,7 +524,7 @@ makronBFG(edict_t *self)
monster_fire_bfg(self, start, dir, 50, 300, 100, 300, MZ2_MAKRON_BFG);
}
static mframe_t makron_frames_attack3[] = {
mframe_t makron_frames_attack3[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -529,7 +542,7 @@ mmove_t makron_move_attack3 = {
makron_run
};
static mframe_t makron_frames_attack4[] = {
mframe_t makron_frames_attack4[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -565,7 +578,7 @@ mmove_t makron_move_attack4 = {
makron_run
};
static mframe_t makron_frames_attack5[] = {
mframe_t makron_frames_attack5[] = {
{ai_charge, 0, makron_prerailgun},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -746,6 +759,12 @@ makron_pain(edict_t *self, edict_t *other /* unused */,
void
makron_sight(edict_t *self, edict_t *other /* unused */)
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &makron_move_sight;
}
void
@ -784,14 +803,7 @@ makron_torso_think(edict_t *self)
return;
}
/* detach from the makron if the legs are gone completely */
if (self->owner && (!self->owner->inuse || (self->owner->health <= self->owner->gib_health)))
{
self->owner = NULL;
}
/* if the makron is revived the torso was put back on him */
if (self->owner && self->owner->deadflag != DEAD_DEAD)
if (self->owner && self->owner->inuse && self->owner->deadflag != DEAD_DEAD)
{
G_FreeEdict(self);
return;
@ -805,84 +817,24 @@ makron_torso_think(edict_t *self)
self->nextthink = level.time + FRAMETIME;
}
static void
makron_torso_origin(edict_t *self, edict_t *torso)
{
vec3_t v;
trace_t tr;
AngleVectors(self->s.angles, v, NULL, NULL);
VectorMA(self->s.origin, -84.0f, v, v);
tr = gi.trace(self->s.origin, torso->mins, torso->maxs, v, self, MASK_SOLID);
VectorCopy (tr.endpos, torso->s.origin);
}
void
makron_torso_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */,
int damage /* unused */, vec3_t point /* unused */)
makron_torso(edict_t *ent)
{
int n;
if (self->health > self->gib_health)
if (!ent)
{
return;
}
gi.sound(self, CHAN_VOICE, gi.soundindex( "misc/udeath.wav"), 1, ATTN_NORM, 0);
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2",
damage, GIB_ORGANIC);
for (n = 0; n < 4; n++)
{
ThrowGib(self, "models/objects/gibs/sm_metal/tris.md2",
damage, GIB_METALLIC);
}
G_FreeEdict(self);
}
void
makron_torso(edict_t *self)
{
edict_t *torso;
if (!self)
{
return;
}
torso = G_SpawnOptional();
if (!torso)
{
return;
}
VectorCopy(self->s.angles, torso->s.angles);
VectorSet(torso->mins, -24, -24, 0);
VectorSet(torso->maxs, 24, 24, 16);
makron_torso_origin(self, torso);
torso->gib_health = -800;
torso->takedamage = DAMAGE_YES;
torso->die = makron_torso_die;
torso->deadflag = DEAD_DEAD;
torso->owner = self;
torso->movetype = MOVETYPE_TOSS;
torso->solid = SOLID_BBOX;
torso->svflags = SVF_MONSTER|SVF_DEADMONSTER;
torso->clipmask = MASK_MONSTERSOLID;
torso->s.frame = FRAME_death301;
torso->s.modelindex = gi.modelindex("models/monsters/boss3/rider/tris.md2");
torso->think = makron_torso_think;
torso->nextthink = level.time + 2 * FRAMETIME;
torso->s.sound = gi.soundindex("makron/spine.wav");
gi.linkentity(torso);
ent->movetype = MOVETYPE_NONE;
ent->solid = SOLID_NOT;
VectorSet(ent->mins, -8, -8, 0);
VectorSet(ent->maxs, 8, 8, 8);
ent->s.frame = FRAME_death301;
ent->s.modelindex = gi.modelindex("models/monsters/boss3/rider/tris.md2");
ent->think = makron_torso_think;
ent->nextthink = level.time + 2 * FRAMETIME;
ent->s.sound = gi.soundindex("makron/spine.wav");
gi.linkentity(ent);
}
/* death */
@ -894,8 +846,8 @@ makron_dead(edict_t *self)
return;
}
VectorSet(self->mins, -48, -48, 0);
VectorSet(self->maxs, 48, 48, 24);
VectorSet(self->mins, -60, -60, 0);
VectorSet(self->maxs, 60, 60, 72);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
@ -906,6 +858,7 @@ void
makron_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */,
int damage /* unused */, vec3_t point /* unused */)
{
edict_t *tempent;
int n;
if (!self)
@ -948,11 +901,12 @@ makron_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /*
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
makron_torso(self);
/* lower bbox since the torso is gone */
self->maxs[2] = 64;
gi.linkentity (self);
tempent = G_Spawn();
VectorCopy(self->s.origin, tempent->s.origin);
VectorCopy(self->s.angles, tempent->s.angles);
tempent->s.origin[1] -= 84;
tempent->owner = self;
makron_torso(tempent);
self->monsterinfo.currentmove = &makron_move_death2;
}
@ -1142,74 +1096,24 @@ void
MakronSpawn(edict_t *self)
{
vec3_t vec;
edict_t *enemy;
edict_t *oldenemy;
edict_t *player;
if (!self)
SP_monster_makron(self);
/* jump at player */
player = level.sight_client;
if (!player)
{
return;
}
/* spawning can mess with enemy state so clear it temporarily */
enemy = self->enemy;
self->enemy = NULL;
oldenemy = self->oldenemy;
self->oldenemy = NULL;
SP_monster_makron(self);
if (self->think)
{
self->think(self);
}
/* and re-link enemy state now that he's spawned */
if (enemy && enemy->inuse && enemy->deadflag != DEAD_DEAD)
{
self->enemy = enemy;
}
if (oldenemy && oldenemy->inuse && oldenemy->deadflag != DEAD_DEAD)
{
self->oldenemy = oldenemy;
}
if (!self->enemy)
{
self->enemy = self->oldenemy;
self->oldenemy = NULL;
}
enemy = self->enemy;
if (enemy)
{
FoundTarget(self);
VectorCopy(self->pos1, self->monsterinfo.last_sighting);
}
if (enemy && visible(self, enemy))
{
VectorSubtract(enemy->s.origin, self->s.origin, vec);
self->s.angles[YAW] = vectoyaw(vec);
VectorNormalize(vec);
}
else
{
AngleVectors(self->s.angles, vec, NULL, NULL);
}
VectorScale(vec, 400, self->velocity);
/* the jump frames are fixed length so best to normalize the up speed */
self->velocity[2] = 200.0f * (sv_gravity->value / 800.0f);
VectorSubtract(player->s.origin, self->s.origin, vec);
self->s.angles[YAW] = vectoyaw(vec);
VectorNormalize(vec);
VectorMA(vec3_origin, 400, vec, self->velocity);
self->velocity[2] = 200;
self->groundentity = NULL;
self->s.origin[2] += 1;
gi.linkentity(self);
self->pain_debounce_time = level.time + 1;
self->monsterinfo.currentmove = &makron_move_sight;
}
/*
@ -1220,20 +1124,10 @@ MakronToss(edict_t *self)
{
edict_t *ent;
if (!self)
{
return;
}
ent = G_Spawn();
ent->classname = "monster_makron";
ent->nextthink = level.time + 0.8;
ent->think = MakronSpawn;
ent->target = self->target;
VectorCopy(self->s.origin, ent->s.origin);
VectorCopy(self->s.angles, ent->s.angles);
VectorCopy(self->monsterinfo.last_sighting, ent->pos1);
ent->enemy = self->enemy;
ent->oldenemy = self->oldenemy;
}

View file

@ -53,7 +53,7 @@ boss5_search(edict_t *self)
}
/* stand */
static mframe_t boss5_frames_stand[] = {
mframe_t boss5_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -134,7 +134,7 @@ boss5_stand(edict_t *self)
self->monsterinfo.currentmove = &boss5_move_stand;
}
static mframe_t boss5_frames_run[] = {
mframe_t boss5_frames_run[] = {
{ai_run, 12, TreadSound2},
{ai_run, 12, NULL},
{ai_run, 12, NULL},
@ -163,7 +163,7 @@ mmove_t boss5_move_run = {
};
/* walk */
static mframe_t boss5_frames_forward[] = {
mframe_t boss5_frames_forward[] = {
{ai_walk, 4, TreadSound2},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
@ -231,7 +231,7 @@ boss5_run(edict_t *self)
}
}
static mframe_t boss5_frames_turn_right[] = {
mframe_t boss5_frames_turn_right[] = {
{ai_move, 0, TreadSound2},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -259,7 +259,7 @@ mmove_t boss5_move_turn_right = {
boss5_run
};
static mframe_t boss5_frames_turn_left[] = {
mframe_t boss5_frames_turn_left[] = {
{ai_move, 0, TreadSound2},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -287,7 +287,7 @@ mmove_t boss5_move_turn_left = {
boss5_run
};
static mframe_t boss5_frames_pain3[] = {
mframe_t boss5_frames_pain3[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -301,7 +301,7 @@ mmove_t boss5_move_pain3 = {
boss5_run
};
static mframe_t boss5_frames_pain2[] = {
mframe_t boss5_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -315,7 +315,7 @@ mmove_t boss5_move_pain2 = {
boss5_run
};
static mframe_t boss5_frames_pain1[] = {
mframe_t boss5_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -329,7 +329,7 @@ mmove_t boss5_move_pain1 = {
boss5_run
};
static mframe_t boss5_frames_death1[] = {
mframe_t boss5_frames_death1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -363,7 +363,7 @@ mmove_t boss5_move_death = {
boss5_dead
};
static mframe_t boss5_frames_backward[] = {
mframe_t boss5_frames_backward[] = {
{ai_walk, 0, TreadSound2},
{ai_walk, 0, NULL},
{ai_walk, 0, NULL},
@ -391,7 +391,7 @@ mmove_t boss5_move_backward = {
NULL
};
static mframe_t boss5_frames_attack4[] = {
mframe_t boss5_frames_attack4[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -407,7 +407,7 @@ mmove_t boss5_move_attack4 = {
boss5_run
};
static mframe_t boss5_frames_attack3[] = {
mframe_t boss5_frames_attack3[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -444,7 +444,7 @@ mmove_t boss5_move_attack3 = {
boss5_run
};
static mframe_t boss5_frames_attack2[] = {
mframe_t boss5_frames_attack2[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -481,7 +481,7 @@ mmove_t boss5_move_attack2 = {
boss5_run
};
static mframe_t boss5_frames_attack1[] = {
mframe_t boss5_frames_attack1[] = {
{ai_charge, 0, boss5MachineGun},
{ai_charge, 0, boss5MachineGun},
{ai_charge, 0, boss5MachineGun},
@ -497,7 +497,7 @@ mmove_t boss5_move_attack1 = {
boss5_reattack1
};
static mframe_t boss5_frames_end_attack1[] = {
mframe_t boss5_frames_end_attack1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},

View file

@ -1,23 +1,4 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
/* =======================================================================
*
* Brain.
*
@ -41,42 +22,13 @@ static int sound_search;
static int sound_melee1;
static int sound_melee2;
static int sound_melee3;
static int sound_step;
static int sound_step2;
void brain_run(edict_t *self);
void brain_dead(edict_t *self);
void
brain_footstep(edict_t *self)
{
if (!g_monsterfootsteps->value)
return;
// Lazy loading for savegame compatibility.
if (sound_step == 0 || sound_step2 == 0)
{
sound_step = gi.soundindex("brain/step1.wav");
sound_step2 = gi.soundindex("brain/step2.wav");
}
if (randk() % 2 == 0)
{
gi.sound(self, CHAN_BODY, sound_step, 1, ATTN_NORM, 0);
}
else
{
gi.sound(self, CHAN_BODY, sound_step2, 1, ATTN_NORM, 0);
}
}
void
brain_sight(edict_t *self, edict_t *other /* unused */)
{
if (!self)
if (!self)
{
return;
}
@ -87,7 +39,7 @@ brain_sight(edict_t *self, edict_t *other /* unused */)
void
brain_search(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -97,7 +49,7 @@ brain_search(edict_t *self)
/* STAND */
static mframe_t brain_frames_stand[] = {
mframe_t brain_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -132,18 +84,17 @@ static mframe_t brain_frames_stand[] = {
{ai_stand, 0, NULL}
};
mmove_t brain_move_stand =
{
mmove_t brain_move_stand = {
FRAME_stand01,
FRAME_stand30,
brain_frames_stand,
NULL
FRAME_stand30,
brain_frames_stand,
NULL
};
void
brain_stand(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -153,7 +104,7 @@ brain_stand(edict_t *self)
/* IDLE */
static mframe_t brain_frames_idle[] = {
mframe_t brain_frames_idle[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -188,18 +139,17 @@ static mframe_t brain_frames_idle[] = {
{ai_stand, 0, NULL}
};
mmove_t brain_move_idle =
{
mmove_t brain_move_idle = {
FRAME_stand31,
FRAME_stand60,
brain_frames_idle,
brain_stand
FRAME_stand60,
brain_frames_idle,
brain_stand
};
void
brain_idle(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -210,32 +160,31 @@ brain_idle(edict_t *self)
/* WALK */
static mframe_t brain_frames_walk1[] = {
mframe_t brain_frames_walk1[] = {
{ai_walk, 7, NULL},
{ai_walk, 2, NULL},
{ai_walk, 3, NULL},
{ai_walk, 3, brain_footstep},
{ai_walk, 3, NULL},
{ai_walk, 1, NULL},
{ai_walk, 0, NULL},
{ai_walk, 0, NULL},
{ai_walk, 9, NULL},
{ai_walk, -4, NULL},
{ai_walk, -1, brain_footstep},
{ai_walk, -1, NULL},
{ai_walk, 2, NULL}
};
mmove_t brain_move_walk1 =
{
mmove_t brain_move_walk1 = {
FRAME_walk101,
FRAME_walk111,
brain_frames_walk1,
NULL
brain_frames_walk1,
NULL
};
void
brain_walk(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -243,7 +192,7 @@ brain_walk(edict_t *self)
self->monsterinfo.currentmove = &brain_move_walk1;
}
static mframe_t brain_frames_defense[] = {
mframe_t brain_frames_defense[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -255,15 +204,14 @@ static mframe_t brain_frames_defense[] = {
{ai_move, 0, NULL}
};
mmove_t brain_move_defense =
{
mmove_t brain_move_defense = {
FRAME_defens01,
FRAME_defens08,
brain_frames_defense,
NULL
FRAME_defens08,
brain_frames_defense,
NULL
};
static mframe_t brain_frames_pain3[] = {
mframe_t brain_frames_pain3[] = {
{ai_move, -2, NULL},
{ai_move, 2, NULL},
{ai_move, 1, NULL},
@ -272,15 +220,14 @@ static mframe_t brain_frames_pain3[] = {
{ai_move, -4, NULL}
};
mmove_t brain_move_pain3 =
{
mmove_t brain_move_pain3 = {
FRAME_pain301,
FRAME_pain306,
brain_frames_pain3,
brain_run
FRAME_pain306,
brain_frames_pain3,
brain_run
};
static mframe_t brain_frames_pain2[] = {
mframe_t brain_frames_pain2[] = {
{ai_move, -2, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -291,18 +238,17 @@ static mframe_t brain_frames_pain2[] = {
{ai_move, -2, NULL}
};
mmove_t brain_move_pain2 =
{
mmove_t brain_move_pain2 = {
FRAME_pain201,
FRAME_pain208,
brain_frames_pain2,
brain_run
};
static mframe_t brain_frames_pain1[] = {
mframe_t brain_frames_pain1[] = {
{ai_move, -6, NULL},
{ai_move, -2, NULL},
{ai_move, -6, brain_footstep},
{ai_move, -6, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -319,16 +265,15 @@ static mframe_t brain_frames_pain1[] = {
{ai_move, 1, NULL},
{ai_move, 7, NULL},
{ai_move, 0, NULL},
{ai_move, 3, brain_footstep},
{ai_move, 3, NULL},
{ai_move, -1, NULL}
};
mmove_t brain_move_pain1 =
{
mmove_t brain_move_pain1 = {
FRAME_pain101,
FRAME_pain121,
brain_frames_pain1,
brain_run
FRAME_pain121,
brain_frames_pain1,
brain_run
};
/* DUCK */
@ -336,7 +281,7 @@ mmove_t brain_move_pain1 =
void
brain_duck_down(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -355,7 +300,7 @@ brain_duck_down(edict_t *self)
void
brain_duck_hold(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -373,7 +318,7 @@ brain_duck_hold(edict_t *self)
void
brain_duck_up(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -384,19 +329,18 @@ brain_duck_up(edict_t *self)
gi.linkentity(self);
}
static mframe_t brain_frames_duck[] = {
mframe_t brain_frames_duck[] = {
{ai_move, 0, NULL},
{ai_move, -2, brain_duck_down},
{ai_move, 17, brain_duck_hold},
{ai_move, -3, brain_footstep},
{ai_move, -3, NULL},
{ai_move, -1, brain_duck_up},
{ai_move, -5, NULL},
{ai_move, -6, NULL},
{ai_move, -6, brain_footstep}
{ai_move, -6, NULL}
};
mmove_t brain_move_duck =
{
mmove_t brain_move_duck = {
FRAME_duck01,
FRAME_duck08,
brain_frames_duck,
@ -426,7 +370,7 @@ brain_dodge(edict_t *self, edict_t *attacker, float eta)
self->monsterinfo.currentmove = &brain_move_duck;
}
static mframe_t brain_frames_death2[] = {
mframe_t brain_frames_death2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -434,15 +378,14 @@ static mframe_t brain_frames_death2[] = {
{ai_move, 0, NULL}
};
mmove_t brain_move_death2 =
{
mmove_t brain_move_death2 = {
FRAME_death201,
FRAME_death205,
brain_frames_death2,
brain_dead
brain_dead
};
static mframe_t brain_frames_death1[] = {
mframe_t brain_frames_death1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, -2, NULL},
@ -463,8 +406,7 @@ static mframe_t brain_frames_death1[] = {
{ai_move, 0, NULL}
};
mmove_t brain_move_death1 =
{
mmove_t brain_move_death1 = {
FRAME_death101,
FRAME_death118,
brain_frames_death1,
@ -476,7 +418,7 @@ mmove_t brain_move_death1 =
void
brain_swing_right(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -489,7 +431,7 @@ brain_hit_right(edict_t *self)
{
vec3_t aim;
if (!self)
if (!self)
{
return;
}
@ -505,7 +447,7 @@ brain_hit_right(edict_t *self)
void
brain_swing_left(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -518,7 +460,7 @@ brain_hit_left(edict_t *self)
{
vec3_t aim;
if (!self)
if (!self)
{
return;
}
@ -531,11 +473,11 @@ brain_hit_left(edict_t *self)
}
}
static mframe_t brain_frames_attack1[] = {
mframe_t brain_frames_attack1[] = {
{ai_charge, 8, NULL},
{ai_charge, 3, NULL},
{ai_charge, 5, NULL},
{ai_charge, 0, brain_footstep},
{ai_charge, 0, NULL},
{ai_charge, -3, brain_swing_right},
{ai_charge, 0, NULL},
{ai_charge, -5, NULL},
@ -549,21 +491,20 @@ static mframe_t brain_frames_attack1[] = {
{ai_charge, -1, NULL},
{ai_charge, -3, NULL},
{ai_charge, 2, NULL},
{ai_charge, -11, brain_footstep}
{ai_charge, -11, NULL}
};
mmove_t brain_move_attack1 =
{
mmove_t brain_move_attack1 = {
FRAME_attak101,
FRAME_attak118,
brain_frames_attack1,
brain_run
FRAME_attak118,
brain_frames_attack1,
brain_run
};
void
brain_chest_open(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -578,7 +519,7 @@ brain_tentacle_attack(edict_t *self)
{
vec3_t aim;
if (!self)
if (!self)
{
return;
}
@ -596,7 +537,7 @@ brain_tentacle_attack(edict_t *self)
void
brain_chest_closed(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -610,7 +551,7 @@ brain_chest_closed(edict_t *self)
}
}
static mframe_t brain_frames_attack2[] = {
mframe_t brain_frames_attack2[] = {
{ai_charge, 5, NULL},
{ai_charge, -4, NULL},
{ai_charge, -4, NULL},
@ -630,18 +571,17 @@ static mframe_t brain_frames_attack2[] = {
{ai_charge, -6, NULL}
};
mmove_t brain_move_attack2 =
{
mmove_t brain_move_attack2 = {
FRAME_attak201,
FRAME_attak217,
brain_frames_attack2,
brain_run
FRAME_attak217,
brain_frames_attack2,
brain_run
};
void
brain_melee(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -866,7 +806,7 @@ brain_laserbeam_reattack(edict_t *self)
}
}
static mframe_t brain_frames_attack3[] = {
mframe_t brain_frames_attack3[] = {
{ai_charge, 5, NULL},
{ai_charge, -4, NULL},
{ai_charge, -4, NULL},
@ -893,7 +833,7 @@ mmove_t brain_move_attack3 = {
brain_run
};
static mframe_t brain_frames_attack4[] = {
mframe_t brain_frames_attack4[] = {
{ai_charge, 9, brain_laserbeam},
{ai_charge, 2, brain_laserbeam},
{ai_charge, 3, brain_laserbeam},
@ -948,24 +888,23 @@ brain_attack(edict_t *self)
/* RUN */
static mframe_t brain_frames_run[] = {
mframe_t brain_frames_run[] = {
{ai_run, 9, NULL},
{ai_run, 2, NULL},
{ai_run, 3, NULL},
{ai_run, 3, brain_footstep},
{ai_run, 3, NULL},
{ai_run, 1, NULL},
{ai_run, 0, NULL},
{ai_run, 0, NULL},
{ai_run, 10, NULL},
{ai_run, -4, NULL},
{ai_run, -1, brain_footstep},
{ai_run, -1, NULL},
{ai_run, 2, NULL}
};
mmove_t brain_move_run =
{
mmove_t brain_move_run = {
FRAME_walk101,
FRAME_walk111,
FRAME_walk111,
brain_frames_run,
NULL
};
@ -973,7 +912,7 @@ mmove_t brain_move_run =
void
brain_run(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -996,7 +935,7 @@ brain_pain(edict_t *self, edict_t *other /* unused */,
{
float r;
if (!self)
if (!self)
{
return;
}
@ -1040,7 +979,7 @@ brain_pain(edict_t *self, edict_t *other /* unused */,
void
brain_dead(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -1059,7 +998,7 @@ brain_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* u
{
int n;
if (!self)
if (!self)
{
return;
}
@ -1117,7 +1056,7 @@ brain_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* u
void
SP_monster_brain(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -1128,11 +1067,6 @@ SP_monster_brain(edict_t *self)
return;
}
// Force recaching at next footstep to ensure
// that the sound indices are correct.
sound_step = 0;
sound_step2 = 0;
sound_chest_open = gi.soundindex("brain/brnatck1.wav");
sound_tentacles_extend = gi.soundindex("brain/brnatck2.wav");
sound_tentacles_retract = gi.soundindex("brain/brnatck3.wav");

View file

@ -1,23 +1,4 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
/* =======================================================================
*
* Iron Maiden.
*
@ -51,38 +32,10 @@ static int sound_pain3;
static int sound_sight;
static int sound_search;
static int sound_step;
static int sound_step2;
void
chick_footstep(edict_t *self)
{
if (!g_monsterfootsteps->value)
return;
// Lazy loading for savegame compatibility.
if (sound_step == 0 || sound_step2 == 0)
{
sound_step = gi.soundindex("bitch/step1.wav");
sound_step2 = gi.soundindex("bitch/step2.wav");
}
if (randk() % 2 == 0)
{
gi.sound(self, CHAN_BODY, sound_step, 1, ATTN_NORM, 0);
}
else
{
gi.sound(self, CHAN_BODY, sound_step2, 1, ATTN_NORM, 0);
}
}
void
ChickMoan(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -97,7 +50,7 @@ ChickMoan(edict_t *self)
}
}
static mframe_t chick_frames_fidget[] = {
mframe_t chick_frames_fidget[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -130,8 +83,7 @@ static mframe_t chick_frames_fidget[] = {
{ai_stand, 0, NULL}
};
mmove_t chick_move_fidget =
{
mmove_t chick_move_fidget = {
FRAME_stand201,
FRAME_stand230,
chick_frames_fidget,
@ -141,7 +93,7 @@ mmove_t chick_move_fidget =
void
chick_fidget(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -157,7 +109,7 @@ chick_fidget(edict_t *self)
}
}
static mframe_t chick_frames_stand[] = {
mframe_t chick_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -190,8 +142,7 @@ static mframe_t chick_frames_stand[] = {
{ai_stand, 0, chick_fidget},
};
mmove_t chick_move_stand =
{
mmove_t chick_move_stand = {
FRAME_stand101,
FRAME_stand130,
chick_frames_stand,
@ -201,7 +152,7 @@ mmove_t chick_move_stand =
void
chick_stand(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -209,7 +160,7 @@ chick_stand(edict_t *self)
self->monsterinfo.currentmove = &chick_move_stand;
}
static mframe_t chick_frames_start_run[] = {
mframe_t chick_frames_start_run[] = {
{ai_run, 1, NULL},
{ai_run, 0, NULL},
{ai_run, 0, NULL},
@ -222,50 +173,47 @@ static mframe_t chick_frames_start_run[] = {
{ai_run, 3, NULL}
};
mmove_t chick_move_start_run =
{
mmove_t chick_move_start_run = {
FRAME_walk01,
FRAME_walk10,
chick_frames_start_run,
chick_run
};
static mframe_t chick_frames_run[] = {
mframe_t chick_frames_run[] = {
{ai_run, 6, NULL},
{ai_run, 8, chick_footstep},
{ai_run, 8, NULL},
{ai_run, 13, NULL},
{ai_run, 5, NULL},
{ai_run, 7, NULL},
{ai_run, 4, NULL},
{ai_run, 11, chick_footstep},
{ai_run, 11, NULL},
{ai_run, 5, NULL},
{ai_run, 9, NULL},
{ai_run, 7, NULL}
};
mmove_t chick_move_run =
{
mmove_t chick_move_run = {
FRAME_walk11,
FRAME_walk20,
chick_frames_run,
NULL
};
static mframe_t chick_frames_walk[] = {
mframe_t chick_frames_walk[] = {
{ai_walk, 6, NULL},
{ai_walk, 8, chick_footstep},
{ai_walk, 8, NULL},
{ai_walk, 13, NULL},
{ai_walk, 5, NULL},
{ai_walk, 7, NULL},
{ai_walk, 4, NULL},
{ai_walk, 11, chick_footstep},
{ai_walk, 11, NULL},
{ai_walk, 5, NULL},
{ai_walk, 9, NULL},
{ai_walk, 7, NULL}
};
mmove_t chick_move_walk =
{
mmove_t chick_move_walk = {
FRAME_walk11,
FRAME_walk20,
chick_frames_walk,
@ -275,7 +223,7 @@ mmove_t chick_move_walk =
void
chick_walk(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -286,7 +234,7 @@ chick_walk(edict_t *self)
void
chick_run(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -308,7 +256,7 @@ chick_run(edict_t *self)
}
}
static mframe_t chick_frames_pain1[] = {
mframe_t chick_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -316,15 +264,14 @@ static mframe_t chick_frames_pain1[] = {
{ai_move, 0, NULL}
};
mmove_t chick_move_pain1 =
{
mmove_t chick_move_pain1 = {
FRAME_pain101,
FRAME_pain105,
chick_frames_pain1,
chick_run
};
static mframe_t chick_frames_pain2[] = {
mframe_t chick_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -332,15 +279,14 @@ static mframe_t chick_frames_pain2[] = {
{ai_move, 0, NULL}
};
mmove_t chick_move_pain2 =
{
mmove_t chick_move_pain2 = {
FRAME_pain201,
FRAME_pain205,
chick_frames_pain2,
chick_frames_pain2,
chick_run
};
static mframe_t chick_frames_pain3[] = {
mframe_t chick_frames_pain3[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, -6, NULL},
@ -364,11 +310,10 @@ static mframe_t chick_frames_pain3[] = {
{ai_move, 2, NULL}
};
mmove_t chick_move_pain3 =
{
mmove_t chick_move_pain3 = {
FRAME_pain301,
FRAME_pain321,
chick_frames_pain3,
chick_frames_pain3,
chick_run
};
@ -378,7 +323,7 @@ chick_pain(edict_t *self, edict_t *other /* unused */,
{
float r;
if (!self)
if (!self)
{
return;
}
@ -432,7 +377,7 @@ chick_pain(edict_t *self, edict_t *other /* unused */,
void
chick_dead(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -445,24 +390,24 @@ chick_dead(edict_t *self)
gi.linkentity(self);
}
static mframe_t chick_frames_death2[] = {
mframe_t chick_frames_death2[] = {
{ai_move, -6, NULL},
{ai_move, 0, NULL},
{ai_move, -1, NULL},
{ai_move, -5, chick_footstep},
{ai_move, -5, NULL},
{ai_move, 0, NULL},
{ai_move, -1, NULL},
{ai_move, -2, NULL},
{ai_move, 1, NULL},
{ai_move, 10, NULL},
{ai_move, 2, NULL},
{ai_move, 3, chick_footstep},
{ai_move, 3, NULL},
{ai_move, 1, NULL},
{ai_move, 2, NULL},
{ai_move, 0, NULL},
{ai_move, 3, NULL},
{ai_move, 3, NULL},
{ai_move, 1, chick_footstep},
{ai_move, 1, NULL},
{ai_move, -3, NULL},
{ai_move, -5, NULL},
{ai_move, 4, NULL},
@ -471,15 +416,14 @@ static mframe_t chick_frames_death2[] = {
{ai_move, 1, NULL}
};
mmove_t chick_move_death2 =
{
mmove_t chick_move_death2 = {
FRAME_death201,
FRAME_death223,
chick_frames_death2,
chick_dead
};
static mframe_t chick_frames_death1[] = {
mframe_t chick_frames_death1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, -7, NULL},
@ -494,12 +438,11 @@ static mframe_t chick_frames_death1[] = {
{ai_move, 0, NULL}
};
mmove_t chick_move_death1 =
{
mmove_t chick_move_death1 = {
FRAME_death101,
FRAME_death112,
chick_frames_death1,
chick_dead
FRAME_death112,
chick_frames_death1,
chick_dead
};
void
@ -509,7 +452,7 @@ chick_die(edict_t *self, edict_t *inflictor /* unused */,
{
int n;
if (!self)
if (!self)
{
return;
}
@ -564,7 +507,7 @@ chick_die(edict_t *self, edict_t *inflictor /* unused */,
void
chick_duck_down(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -584,7 +527,7 @@ chick_duck_down(edict_t *self)
void
chick_duck_hold(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -602,7 +545,7 @@ chick_duck_hold(edict_t *self)
void
chick_duck_up(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -613,7 +556,7 @@ chick_duck_up(edict_t *self)
gi.linkentity(self);
}
static mframe_t chick_frames_duck[] = {
mframe_t chick_frames_duck[] = {
{ai_move, 0, chick_duck_down},
{ai_move, 1, NULL},
{ai_move, 4, chick_duck_hold},
@ -623,16 +566,15 @@ static mframe_t chick_frames_duck[] = {
{ai_move, 1, NULL}
};
mmove_t chick_move_duck =
{
mmove_t chick_move_duck = {
FRAME_duck01,
FRAME_duck07,
chick_frames_duck,
chick_run
FRAME_duck07,
chick_frames_duck,
chick_run
};
void
chick_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
chick_dodge(edict_t *self, edict_t *attacker, float eta)
{
if (!self || !attacker)
{
@ -658,7 +600,7 @@ ChickSlash(edict_t *self)
{
vec3_t aim;
if (!self)
if (!self)
{
return;
}
@ -703,7 +645,7 @@ ChickRocket(edict_t *self)
void
Chick_PreAttack1(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -714,7 +656,7 @@ Chick_PreAttack1(edict_t *self)
void
ChickReload(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -722,7 +664,7 @@ ChickReload(edict_t *self)
gi.sound(self, CHAN_VOICE, sound_missile_reload, 1, ATTN_NORM, 0);
}
static mframe_t chick_frames_start_attack1[] = {
mframe_t chick_frames_start_attack1[] = {
{ai_charge, 0, Chick_PreAttack1},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -731,66 +673,63 @@ static mframe_t chick_frames_start_attack1[] = {
{ai_charge, -3, NULL},
{ai_charge, 3, NULL},
{ai_charge, 5, NULL},
{ai_charge, 7, chick_footstep},
{ai_charge, 7, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, chick_attack1}
};
mmove_t chick_move_start_attack1 =
{
mmove_t chick_move_start_attack1 = {
FRAME_attak101,
FRAME_attak113,
chick_frames_start_attack1,
NULL
FRAME_attak113,
chick_frames_start_attack1,
NULL
};
static mframe_t chick_frames_attack1[] = {
mframe_t chick_frames_attack1[] = {
{ai_charge, 19, ChickRocket},
{ai_charge, -6, NULL},
{ai_charge, -5, chick_footstep},
{ai_charge, -5, NULL},
{ai_charge, -2, NULL},
{ai_charge, -7, chick_footstep},
{ai_charge, -7, NULL},
{ai_charge, 0, NULL},
{ai_charge, 1, NULL},
{ai_charge, 10, ChickReload},
{ai_charge, 4, NULL},
{ai_charge, 5, chick_footstep},
{ai_charge, 5, NULL},
{ai_charge, 6, NULL},
{ai_charge, 6, NULL},
{ai_charge, 4, chick_footstep},
{ai_charge, 4, NULL},
{ai_charge, 3, chick_rerocket}
};
mmove_t chick_move_attack1 =
{
mmove_t chick_move_attack1 = {
FRAME_attak114,
FRAME_attak127,
chick_frames_attack1,
NULL
FRAME_attak127,
chick_frames_attack1,
NULL
};
static mframe_t chick_frames_end_attack1[] = {
mframe_t chick_frames_end_attack1[] = {
{ai_charge, -3, NULL},
{ai_charge, 0, NULL},
{ai_charge, -6, NULL},
{ai_charge, -4, NULL},
{ai_charge, -2, chick_footstep}
{ai_charge, -2, NULL}
};
mmove_t chick_move_end_attack1 =
{
mmove_t chick_move_end_attack1 = {
FRAME_attak128,
FRAME_attak132,
chick_frames_end_attack1,
chick_run
chick_run
};
void
chick_rerocket(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -816,7 +755,7 @@ chick_rerocket(edict_t *self)
void
chick_attack1(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -824,7 +763,7 @@ chick_attack1(edict_t *self)
self->monsterinfo.currentmove = &chick_move_attack1;
}
static mframe_t chick_frames_slash[] = {
mframe_t chick_frames_slash[] = {
{ai_charge, 1, NULL},
{ai_charge, 7, ChickSlash},
{ai_charge, -7, NULL},
@ -836,33 +775,31 @@ static mframe_t chick_frames_slash[] = {
{ai_charge, -2, chick_reslash}
};
mmove_t chick_move_slash =
{
mmove_t chick_move_slash = {
FRAME_attak204,
FRAME_attak212,
chick_frames_slash,
NULL
FRAME_attak212,
chick_frames_slash,
NULL
};
static mframe_t chick_frames_end_slash[] = {
mframe_t chick_frames_end_slash[] = {
{ai_charge, -6, NULL},
{ai_charge, -1, NULL},
{ai_charge, -6, NULL},
{ai_charge, 0, chick_footstep}
{ai_charge, 0, NULL}
};
mmove_t chick_move_end_slash =
{
mmove_t chick_move_end_slash = {
FRAME_attak213,
FRAME_attak216,
chick_frames_end_slash,
chick_frames_end_slash,
chick_run
};
void
chick_reslash(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -890,32 +827,26 @@ chick_reslash(edict_t *self)
void
chick_slash(edict_t *self)
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &chick_move_slash;
}
static mframe_t chick_frames_start_slash[] = {
mframe_t chick_frames_start_slash[] = {
{ai_charge, 1, NULL},
{ai_charge, 8, NULL},
{ai_charge, 3, chick_footstep}
{ai_charge, 3, NULL}
};
mmove_t chick_move_start_slash =
{
mmove_t chick_move_start_slash = {
FRAME_attak201,
FRAME_attak203,
chick_frames_start_slash,
chick_slash
chick_slash
};
void
chick_melee(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -926,7 +857,7 @@ chick_melee(edict_t *self)
void
chick_attack(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -937,7 +868,7 @@ chick_attack(edict_t *self)
void
chick_sight(edict_t *self, edict_t *other /* unused */)
{
if (!self)
if (!self)
{
return;
}
@ -951,7 +882,7 @@ chick_sight(edict_t *self, edict_t *other /* unused */)
void
SP_monster_chick(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -962,11 +893,6 @@ SP_monster_chick(edict_t *self)
return;
}
// Force recaching at next footstep to ensure
// that the sound indices are correct.
sound_step = 0;
sound_step2 = 0;
sound_missile_prelaunch = gi.soundindex("chick/chkatck1.wav");
sound_missile_launch = gi.soundindex("chick/chkatck2.wav");
sound_melee_swing = gi.soundindex("chick/chkatck3.wav");

View file

@ -691,7 +691,7 @@ fly_vertical2(edict_t *self)
}
}
static mframe_t fixbot_frames_landing[] = {
mframe_t fixbot_frames_landing[] = {
{ai_move, 0, NULL},
{ai_move, 0, fly_vertical2},
{ai_move, 0, fly_vertical2},
@ -765,7 +765,7 @@ mmove_t fixbot_move_landing = {
};
/* generic ambient stand */
static mframe_t fixbot_frames_stand[] = {
mframe_t fixbot_frames_stand[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -795,7 +795,7 @@ mmove_t fixbot_move_stand = {
NULL
};
static mframe_t fixbot_frames_stand2[] = {
mframe_t fixbot_frames_stand2[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -831,7 +831,7 @@ mmove_t fixbot_move_stand2 = {
* and take the object with it ( this may require a
* variant of liftoff and landing )
*/
static mframe_t fixbot_frames_pickup[] = {
mframe_t fixbot_frames_pickup[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -871,7 +871,7 @@ mmove_t fixbot_move_pickup = {
};
/* generic frame to move bot */
static mframe_t fixbot_frames_roamgoal[] = {
mframe_t fixbot_frames_roamgoal[] = {
{ai_move, 0, roam_goal}
};
@ -904,7 +904,7 @@ ai_facing(edict_t *self, float dist)
}
}
static mframe_t fixbot_frames_turn[] = {
mframe_t fixbot_frames_turn[] = {
{ai_facing, 0, NULL}
};
@ -927,7 +927,7 @@ go_roam(edict_t *self)
}
/* takeoff */
static mframe_t fixbot_frames_takeoff[] = {
mframe_t fixbot_frames_takeoff[] = {
{ai_move, 0.01, fly_vertical},
{ai_move, 0.01, fly_vertical},
{ai_move, 0.01, fly_vertical},
@ -955,7 +955,7 @@ mmove_t fixbot_move_takeoff = {
};
/* findout what this is */
static mframe_t fixbot_frames_paina[] = {
mframe_t fixbot_frames_paina[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -972,7 +972,7 @@ mmove_t fixbot_move_paina = {
};
/* findout what this is */
static mframe_t fixbot_frames_painb[] = {
mframe_t fixbot_frames_painb[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -995,7 +995,7 @@ mmove_t fixbot_move_painb = {
* call a generic painsound
* some spark effects
*/
static mframe_t fixbot_frames_pain3[] = {
mframe_t fixbot_frames_pain3[] = {
{ai_move, -1, NULL}
};
@ -1012,7 +1012,7 @@ mmove_t fixbot_move_pain3 = {
* ( may need second land if the
* bot is releasing jib into jib vat )
*/
static mframe_t fixbot_frames_land[] = {
mframe_t fixbot_frames_land[] = {
{ai_move, 0, NULL}
};
@ -1034,7 +1034,7 @@ ai_movetogoal(edict_t *self, float dist)
M_MoveToGoal(self, dist);
}
static mframe_t fixbot_frames_forward[] = {
mframe_t fixbot_frames_forward[] = {
{ai_movetogoal, 5, use_scanner}
};
@ -1045,7 +1045,7 @@ mmove_t fixbot_move_forward = {
NULL
};
static mframe_t fixbot_frames_walk[] = {
mframe_t fixbot_frames_walk[] = {
{ai_walk, 5, NULL}
};
@ -1056,7 +1056,7 @@ mmove_t fixbot_move_walk = {
NULL
};
static mframe_t fixbot_frames_run[] = {
mframe_t fixbot_frames_run[] = {
{ai_run, 10, NULL}
};
@ -1067,7 +1067,7 @@ mmove_t fixbot_move_run = {
NULL
};
static mframe_t fixbot_frames_death1[] = {
mframe_t fixbot_frames_death1[] = {
{ai_move, 0, NULL}
};
@ -1078,7 +1078,7 @@ mmove_t fixbot_move_death1 = {
fixbot_dead
};
static mframe_t fixbot_frames_backward[] = {
mframe_t fixbot_frames_backward[] = {
{ai_move, 0, NULL}
};
@ -1089,7 +1089,7 @@ mmove_t fixbot_move_backward = {
NULL
};
static mframe_t fixbot_frames_start_attack[] = {
mframe_t fixbot_frames_start_attack[] = {
{ai_charge, 0, NULL}
};
@ -1100,7 +1100,7 @@ mmove_t fixbot_move_start_attack = {
fixbot_attack
};
static mframe_t fixbot_frames_attack1[] = {
mframe_t fixbot_frames_attack1[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -1218,7 +1218,7 @@ fixbot_fire_laser(edict_t *self)
}
}
static mframe_t fixbot_frames_laserattack[] = {
mframe_t fixbot_frames_laserattack[] = {
{ai_charge, 0, fixbot_fire_laser},
{ai_charge, 0, fixbot_fire_laser},
{ai_charge, 0, fixbot_fire_laser},
@ -1236,7 +1236,7 @@ mmove_t fixbot_move_laserattack = {
/* need to get forward translation
data for the charge attack */
static mframe_t fixbot_frames_attack2[] = {
mframe_t fixbot_frames_attack2[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -1331,7 +1331,7 @@ ai_move2(edict_t *self, float dist)
M_ChangeYaw(self);
}
static mframe_t fixbot_frames_weld_start[] = {
mframe_t fixbot_frames_weld_start[] = {
{ai_move2, 0, NULL},
{ai_move2, 0, NULL},
{ai_move2, 0, NULL},
@ -1351,7 +1351,7 @@ mmove_t fixbot_move_weld_start = {
NULL
};
static mframe_t fixbot_frames_weld[] = {
mframe_t fixbot_frames_weld[] = {
{ai_move2, 0, fixbot_fire_welder},
{ai_move2, 0, fixbot_fire_welder},
{ai_move2, 0, fixbot_fire_welder},
@ -1368,7 +1368,7 @@ mmove_t fixbot_move_weld = {
NULL
};
static mframe_t fixbot_frames_weld_end[] = {
mframe_t fixbot_frames_weld_end[] = {
{ai_move2, -2, NULL},
{ai_move2, -2, NULL},
{ai_move2, -2, NULL},

View file

@ -21,7 +21,7 @@ static int sound_sight;
void flipper_stand(edict_t *self);
static mframe_t flipper_frames_stand[] = {
mframe_t flipper_frames_stand[] = {
{ai_stand, 0, NULL}
};
@ -43,7 +43,7 @@ flipper_stand(edict_t *self)
self->monsterinfo.currentmove = &flipper_move_stand;
}
static mframe_t flipper_frames_run[] = {
mframe_t flipper_frames_run[] = {
{ai_run, FLIPPER_RUN_SPEED, NULL}, /* 6 */
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
@ -90,7 +90,7 @@ flipper_run_loop(edict_t *self)
self->monsterinfo.currentmove = &flipper_move_run_loop;
}
static mframe_t flipper_frames_run_start[] = {
mframe_t flipper_frames_run_start[] = {
{ai_run, 8, NULL},
{ai_run, 8, NULL},
{ai_run, 8, NULL},
@ -118,7 +118,7 @@ flipper_run(edict_t *self)
}
/* Standard Swimming */
static mframe_t flipper_frames_walk[] = {
mframe_t flipper_frames_walk[] = {
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
@ -163,7 +163,7 @@ flipper_walk(edict_t *self)
self->monsterinfo.currentmove = &flipper_move_walk;
}
static mframe_t flipper_frames_start_run[] = {
mframe_t flipper_frames_start_run[] = {
{ai_run, 8, NULL},
{ai_run, 8, NULL},
{ai_run, 8, NULL},
@ -188,7 +188,7 @@ flipper_start_run(edict_t *self)
self->monsterinfo.currentmove = &flipper_move_start_run;
}
static mframe_t flipper_frames_pain2[] = {
mframe_t flipper_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -203,7 +203,7 @@ mmove_t flipper_move_pain2 = {
flipper_run
};
static mframe_t flipper_frames_pain1[] = {
mframe_t flipper_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -243,7 +243,7 @@ flipper_preattack(edict_t *self)
gi.sound(self, CHAN_WEAPON, sound_chomp, 1, ATTN_NORM, 0);
}
static mframe_t flipper_frames_attack[] = {
mframe_t flipper_frames_attack[] = {
{ai_charge, 0, flipper_preattack},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -353,7 +353,7 @@ flipper_dead(edict_t *self)
gi.linkentity(self);
}
static mframe_t flipper_frames_death[] = {
mframe_t flipper_frames_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},

View file

@ -79,7 +79,7 @@ floater_fire_blaster(edict_t *self)
monster_fire_blaster(self, start, dir, 1, 1000, MZ2_FLOAT_BLASTER_1, effect);
}
static mframe_t floater_frames_stand1[] = {
mframe_t floater_frames_stand1[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -141,7 +141,7 @@ mmove_t floater_move_stand1 = {
NULL
};
static mframe_t floater_frames_stand2[] = {
mframe_t floater_frames_stand2[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -221,7 +221,7 @@ floater_stand(edict_t *self)
}
}
static mframe_t floater_frames_activate[] = {
mframe_t floater_frames_activate[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -261,7 +261,7 @@ mmove_t floater_move_activate = {
NULL
};
static mframe_t floater_frames_attack1[] = {
mframe_t floater_frames_attack1[] = {
{ai_charge, 0, NULL}, /* Blaster attack */
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -285,7 +285,7 @@ mmove_t floater_move_attack1 = {
floater_run
};
static mframe_t floater_frames_attack2[] = {
mframe_t floater_frames_attack2[] = {
{ai_charge, 0, NULL}, /* Claws */
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -320,7 +320,7 @@ mmove_t floater_move_attack2 = {
floater_run
};
static mframe_t floater_frames_attack3[] = {
mframe_t floater_frames_attack3[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -364,7 +364,7 @@ mmove_t floater_move_attack3 = {
floater_run
};
static mframe_t floater_frames_death[] = {
mframe_t floater_frames_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -387,7 +387,7 @@ mmove_t floater_move_death = {
floater_dead
};
static mframe_t floater_frames_pain1[] = {
mframe_t floater_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -404,7 +404,7 @@ mmove_t floater_move_pain1 = {
floater_run
};
static mframe_t floater_frames_pain2[] = {
mframe_t floater_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -422,7 +422,7 @@ mmove_t floater_move_pain2 = {
floater_run
};
static mframe_t floater_frames_pain3[] = {
mframe_t floater_frames_pain3[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -444,7 +444,7 @@ mmove_t floater_move_pain3 = {
floater_run
};
static mframe_t floater_frames_walk[] = {
mframe_t floater_frames_walk[] = {
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
@ -506,7 +506,7 @@ mmove_t floater_move_walk = {
NULL
};
static mframe_t floater_frames_run[] = {
mframe_t floater_frames_run[] = {
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},

View file

@ -59,7 +59,7 @@ flyer_pop_blades(edict_t *self)
gi.sound(self, CHAN_VOICE, sound_sproing, 1, ATTN_NORM, 0);
}
static mframe_t flyer_frames_stand[] = {
mframe_t flyer_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -114,7 +114,7 @@ mmove_t flyer_move_stand = {
NULL
};
static mframe_t flyer_frames_walk[] = {
mframe_t flyer_frames_walk[] = {
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
@ -169,7 +169,7 @@ mmove_t flyer_move_walk = {
NULL
};
static mframe_t flyer_frames_run[] = {
mframe_t flyer_frames_run[] = {
{ai_run, 10, NULL},
{ai_run, 10, NULL},
{ai_run, 10, NULL},
@ -264,7 +264,7 @@ flyer_stand(edict_t *self)
self->monsterinfo.currentmove = &flyer_move_stand;
}
static mframe_t flyer_frames_start[] = {
mframe_t flyer_frames_start[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -280,7 +280,7 @@ mmove_t flyer_move_start = {
NULL
};
static mframe_t flyer_frames_stop[] = {
mframe_t flyer_frames_stop[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -319,7 +319,7 @@ flyer_start(edict_t *self)
self->monsterinfo.currentmove = &flyer_move_start;
}
static mframe_t flyer_frames_rollright[] = {
mframe_t flyer_frames_rollright[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -338,7 +338,7 @@ mmove_t flyer_move_rollright = {
NULL
};
static mframe_t flyer_frames_rollleft[] = {
mframe_t flyer_frames_rollleft[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -357,7 +357,7 @@ mmove_t flyer_move_rollleft = {
NULL
};
static mframe_t flyer_frames_pain3[] = {
mframe_t flyer_frames_pain3[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -371,7 +371,7 @@ mmove_t flyer_move_pain3 = {
flyer_run
};
static mframe_t flyer_frames_pain2[] = {
mframe_t flyer_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -385,7 +385,7 @@ mmove_t flyer_move_pain2 = {
flyer_run
};
static mframe_t flyer_frames_pain1[] = {
mframe_t flyer_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -404,7 +404,7 @@ mmove_t flyer_move_pain1 = {
flyer_run
};
static mframe_t flyer_frames_defense[] = {
mframe_t flyer_frames_defense[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}, /* Hold this frame */
@ -420,7 +420,7 @@ mmove_t flyer_move_defense = {
NULL
};
static mframe_t flyer_frames_bankright[] = {
mframe_t flyer_frames_bankright[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -437,7 +437,7 @@ mmove_t flyer_move_bankright = {
NULL
};
static mframe_t flyer_frames_bankleft[] = {
mframe_t flyer_frames_bankleft[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -511,7 +511,7 @@ flyer_fireright(edict_t *self)
flyer_fire(self, MZ2_FLYER_BLASTER_2);
}
static mframe_t flyer_frames_attack2[] = {
mframe_t flyer_frames_attack2[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -568,7 +568,7 @@ flyer_slash_right(edict_t *self)
gi.sound(self, CHAN_WEAPON, sound_slash, 1, ATTN_NORM, 0);
}
static mframe_t flyer_frames_start_melee[] = {
mframe_t flyer_frames_start_melee[] = {
{ai_charge, 0, flyer_pop_blades},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -584,7 +584,7 @@ mmove_t flyer_move_start_melee = {
flyer_loop_melee
};
static mframe_t flyer_frames_end_melee[] = {
mframe_t flyer_frames_end_melee[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL}
@ -597,7 +597,7 @@ mmove_t flyer_move_end_melee = {
flyer_run
};
static mframe_t flyer_frames_loop_melee[] = {
mframe_t flyer_frames_loop_melee[] = {
{ai_charge, 0, NULL}, /* Loop Start */
{ai_charge, 0, NULL},
{ai_charge, 0, flyer_slash_left}, /* Left Wing Strike */

View file

@ -325,7 +325,7 @@ ai_stand2(edict_t *self, float dist)
}
}
static mframe_t gekk_frames_stand[] = {
mframe_t gekk_frames_stand[] = {
{ai_stand2, 0, NULL},
{ai_stand2, 0, NULL},
{ai_stand2, 0, NULL},
@ -378,7 +378,7 @@ mmove_t gekk_move_stand = {
NULL
};
static mframe_t gekk_frames_standunderwater[] = {
mframe_t gekk_frames_standunderwater[] = {
{ai_stand2, 0, NULL},
{ai_stand2, 0, NULL},
{ai_stand2, 0, NULL},
@ -405,7 +405,7 @@ gekk_swim_loop(edict_t *self)
self->monsterinfo.currentmove = &gekk_move_swim_loop;
}
static mframe_t gekk_frames_swim[] = {
mframe_t gekk_frames_swim[] = {
{ai_run, 16, NULL},
{ai_run, 16, NULL},
{ai_run, 16, NULL},
@ -420,7 +420,7 @@ mmove_t gekk_move_swim_loop = {
gekk_swim_loop
};
static mframe_t gekk_frames_swim_start[] = {
mframe_t gekk_frames_swim_start[] = {
{ai_run, 14, NULL},
{ai_run, 14, NULL},
{ai_run, 14, NULL},
@ -516,7 +516,7 @@ gekk_idle_loop(edict_t *self)
}
}
static mframe_t gekk_frames_idle[] = {
mframe_t gekk_frames_idle[] = {
{ai_stand2, 0, gekk_search},
{ai_stand2, 0, NULL},
{ai_stand2, 0, NULL},
@ -586,7 +586,7 @@ gekk_idle(edict_t *self)
}
}
static mframe_t gekk_frames_walk[] = {
mframe_t gekk_frames_walk[] = {
{ai_walk, 3.849, gekk_check_underwater}, /* frame 0 */
{ai_walk, 19.606, NULL}, /* frame 1 */
{ai_walk, 25.583, NULL}, /* frame 2 */
@ -657,7 +657,7 @@ gekk_run(edict_t *self)
}
}
static mframe_t gekk_frames_run[] = {
mframe_t gekk_frames_run[] = {
{ai_run, 3.849, gekk_check_underwater}, /* frame 0 */
{ai_run, 19.606, NULL}, /* frame 1 */
{ai_run, 25.583, NULL}, /* frame 2 */
@ -673,7 +673,7 @@ mmove_t gekk_move_run = {
NULL
};
static mframe_t gekk_frames_run_st[] = {
mframe_t gekk_frames_run_st[] = {
{ai_run, 0.212, NULL}, /* frame 0 */
{ai_run, 19.753, NULL}, /* frame 1 */
};
@ -895,7 +895,7 @@ reloogie(edict_t *self)
}
}
static mframe_t gekk_frames_spit[] = {
mframe_t gekk_frames_spit[] = {
{ai_charge, 0.000, NULL},
{ai_charge, 0.000, NULL},
{ai_charge, 0.000, NULL},
@ -913,7 +913,7 @@ mmove_t gekk_move_spit = {
gekk_run_start
};
static mframe_t gekk_frames_attack1[] = {
mframe_t gekk_frames_attack1[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -934,7 +934,7 @@ mmove_t gekk_move_attack1 = {
gekk_run_start
};
static mframe_t gekk_frames_attack2[] = {
mframe_t gekk_frames_attack2[] = {
{ai_charge, 0.000, NULL},
{ai_charge, 0.000, NULL},
{ai_charge, 0.000, gekk_hit_left},
@ -969,7 +969,7 @@ gekk_check_underwater(edict_t *self)
}
}
static mframe_t gekk_frames_leapatk[] = {
mframe_t gekk_frames_leapatk[] = {
{ai_charge, 0.000, NULL}, /* frame 0 */
{ai_charge, -0.387, NULL}, /* frame 1 */
{ai_charge, -1.113, NULL}, /* frame 2 */
@ -999,7 +999,7 @@ mmove_t gekk_move_leapatk = {
gekk_run_start
};
static mframe_t gekk_frames_leapatk2[] = {
mframe_t gekk_frames_leapatk2[] = {
{ai_charge, 0.000, NULL}, /* frame 0 */
{ai_charge, -0.387, NULL}, /* frame 1 */
{ai_charge, -1.113, NULL}, /* frame 2 */
@ -1049,7 +1049,7 @@ gekk_preattack(edict_t *self)
/* Unused but PITA to remove */
}
static mframe_t gekk_frames_attack[] = {
mframe_t gekk_frames_attack[] = {
{ai_charge, 16, gekk_preattack},
{ai_charge, 16, NULL},
{ai_charge, 16, NULL},
@ -1296,7 +1296,7 @@ gekk_jump(edict_t *self)
}
}
static mframe_t gekk_frames_pain[] = {
mframe_t gekk_frames_pain[] = {
{ai_move, 0.000, NULL}, /* frame 0 */
{ai_move, 0.000, NULL}, /* frame 1 */
{ai_move, 0.000, NULL}, /* frame 2 */
@ -1312,7 +1312,7 @@ mmove_t gekk_move_pain = {
gekk_run_start
};
static mframe_t gekk_frames_pain1[] = {
mframe_t gekk_frames_pain1[] = {
{ai_move, 0.000, NULL}, /* frame 0 */
{ai_move, 0.000, NULL}, /* frame 1 */
{ai_move, 0.000, NULL}, /* frame 2 */
@ -1334,7 +1334,7 @@ mmove_t gekk_move_pain1 = {
gekk_run_start
};
static mframe_t gekk_frames_pain2[] = {
mframe_t gekk_frames_pain2[] = {
{ai_move, 0.000, NULL}, /* frame 0 */
{ai_move, 0.000, NULL}, /* frame 1 */
{ai_move, 0.000, NULL}, /* frame 2 */
@ -1480,7 +1480,7 @@ isgibfest(edict_t *self)
}
}
static mframe_t gekk_frames_death1[] = {
mframe_t gekk_frames_death1[] = {
{ai_move, -5.151, NULL}, /* frame 0 */
{ai_move, -12.223, NULL}, /* frame 1 */
{ai_move, -11.484, NULL}, /* frame 2 */
@ -1500,7 +1500,7 @@ mmove_t gekk_move_death1 = {
gekk_dead
};
static mframe_t gekk_frames_death3[] = {
mframe_t gekk_frames_death3[] = {
{ai_move, 0.000, NULL}, /* frame 0 */
{ai_move, 0.022, NULL}, /* frame 1 */
{ai_move, 0.169, NULL}, /* frame 2 */
@ -1517,7 +1517,7 @@ mmove_t gekk_move_death3 = {
gekk_dead
};
static mframe_t gekk_frames_death4[] = {
mframe_t gekk_frames_death4[] = {
{ai_move, 5.103, NULL}, /* frame 0 */
{ai_move, -4.808, NULL}, /* frame 1 */
{ai_move, -10.509, NULL}, /* frame 2 */
@ -1562,7 +1562,7 @@ mmove_t gekk_move_death4 = {
gekk_dead
};
static mframe_t gekk_frames_wdeath[] = {
mframe_t gekk_frames_wdeath[] = {
{ai_move, 0.000, NULL}, /* frame 0 */
{ai_move, 0.000, NULL}, /* frame 1 */
{ai_move, 0.000, NULL}, /* frame 2 */
@ -1731,7 +1731,7 @@ gekk_duck_hold(edict_t *self)
}
}
static mframe_t gekk_frames_lduck[] = {
mframe_t gekk_frames_lduck[] = {
{ai_move, 0.000, NULL}, /* frame 0 */
{ai_move, 0.000, NULL}, /* frame 1 */
{ai_move, 0.000, NULL}, /* frame 2 */
@ -1754,7 +1754,7 @@ mmove_t gekk_move_lduck = {
gekk_run_start
};
static mframe_t gekk_frames_rduck[] = {
mframe_t gekk_frames_rduck[] = {
{ai_move, 0.000, NULL}, /* frame 0 */
{ai_move, 0.000, NULL}, /* frame 1 */
{ai_move, 0.000, NULL}, /* frame 2 */

View file

@ -63,7 +63,7 @@ gladb_cleaver_swing(edict_t *self)
gi.sound(self, CHAN_WEAPON, sound_cleaver_swing, 1, ATTN_NORM, 0);
}
static mframe_t gladb_frames_stand[] = {
mframe_t gladb_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -91,7 +91,7 @@ gladb_stand(edict_t *self)
self->monsterinfo.currentmove = &gladb_move_stand;
}
static mframe_t gladb_frames_walk[] = {
mframe_t gladb_frames_walk[] = {
{ai_walk, 15, NULL},
{ai_walk, 7, NULL},
{ai_walk, 6, NULL},
@ -128,7 +128,7 @@ gladb_walk(edict_t *self)
self->monsterinfo.currentmove = &gladb_move_walk;
}
static mframe_t gladb_frames_run[] = {
mframe_t gladb_frames_run[] = {
{ai_run, 23, NULL},
{ai_run, 14, NULL},
{ai_run, 14, NULL},
@ -184,7 +184,7 @@ GladbMelee(edict_t *self)
}
}
static mframe_t gladb_frames_attack_melee[] = {
mframe_t gladb_frames_attack_melee[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -259,7 +259,7 @@ gladbGun_check(edict_t *self)
}
}
static mframe_t gladb_frames_attack_gun[] = {
mframe_t gladb_frames_attack_gun[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, gladbGun},
@ -289,19 +289,13 @@ gladb_attack(edict_t *self)
return;
}
/* a small safe zone
but not for stand-ground ones since players can
abuse it by standing still inside this range
*/
if (!(self->monsterinfo.aiflags & AI_STAND_GROUND))
{
VectorSubtract(self->s.origin, self->enemy->s.origin, v);
range = VectorLength(v);
/* a small safe zone */
VectorSubtract(self->s.origin, self->enemy->s.origin, v);
range = VectorLength(v);
if (range <= (MELEE_DISTANCE + 32))
{
return;
}
if (range <= (MELEE_DISTANCE + 32))
{
return;
}
/* charge up the railgun */
@ -311,7 +305,7 @@ gladb_attack(edict_t *self)
self->monsterinfo.currentmove = &gladb_move_attack_gun;
}
static mframe_t gladb_frames_pain[] = {
mframe_t gladb_frames_pain[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -326,7 +320,7 @@ mmove_t gladb_move_pain = {
gladb_frames_pain, gladb_run
};
static mframe_t gladb_frames_pain_air[] = {
mframe_t gladb_frames_pain_air[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -405,7 +399,7 @@ gladb_dead(edict_t *self)
gi.linkentity(self);
}
static mframe_t gladb_frames_death[] = {
mframe_t gladb_frames_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},

View file

@ -1,23 +1,4 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
/* =======================================================================
*
* Gladiator.
*
@ -38,37 +19,10 @@ static int sound_idle;
static int sound_search;
static int sound_sight;
static int sound_step;
static int sound_step2;
void
gladiator_footstep(edict_t *self)
{
if (!g_monsterfootsteps->value)
return;
// Lazy loading for savegame compatibility.
if (sound_step == 0 || sound_step2 == 0)
{
sound_step = gi.soundindex("gladiator/step1.wav");
sound_step2 = gi.soundindex("gladiator/step2.wav");
}
if (randk() % 2 == 0)
{
gi.sound(self, CHAN_BODY, sound_step, 1, ATTN_NORM, 0);
}
else
{
gi.sound(self, CHAN_BODY, sound_step2, 1, ATTN_NORM, 0);
}
}
void
gladiator_idle(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -79,7 +33,7 @@ gladiator_idle(edict_t *self)
void
gladiator_sight(edict_t *self, edict_t *other /* unused */)
{
if (!self)
if (!self)
{
return;
}
@ -90,7 +44,7 @@ gladiator_sight(edict_t *self, edict_t *other /* unused */)
void
gladiator_search(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -101,7 +55,7 @@ gladiator_search(edict_t *self)
void
gladiator_cleaver_swing(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -109,7 +63,7 @@ gladiator_cleaver_swing(edict_t *self)
gi.sound(self, CHAN_WEAPON, sound_cleaver_swing, 1, ATTN_NORM, 0);
}
static mframe_t gladiator_frames_stand[] = {
mframe_t gladiator_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -119,18 +73,17 @@ static mframe_t gladiator_frames_stand[] = {
{ai_stand, 0, NULL}
};
mmove_t gladiator_move_stand =
{
mmove_t gladiator_move_stand = {
FRAME_stand1,
FRAME_stand7,
gladiator_frames_stand,
NULL
FRAME_stand7,
gladiator_frames_stand,
NULL
};
void
gladiator_stand(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -138,12 +91,12 @@ gladiator_stand(edict_t *self)
self->monsterinfo.currentmove = &gladiator_move_stand;
}
static mframe_t gladiator_frames_walk[] = {
mframe_t gladiator_frames_walk[] = {
{ai_walk, 15, NULL},
{ai_walk, 7, NULL},
{ai_walk, 6, NULL},
{ai_walk, 5, NULL},
{ai_walk, 2, gladiator_footstep},
{ai_walk, 2, NULL},
{ai_walk, 0, NULL},
{ai_walk, 2, NULL},
{ai_walk, 8, NULL},
@ -151,24 +104,23 @@ static mframe_t gladiator_frames_walk[] = {
{ai_walk, 8, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 2, gladiator_footstep},
{ai_walk, 2, NULL},
{ai_walk, 2, NULL},
{ai_walk, 1, NULL},
{ai_walk, 8, NULL}
};
mmove_t gladiator_move_walk =
{
mmove_t gladiator_move_walk = {
FRAME_walk1,
FRAME_walk16,
gladiator_frames_walk,
NULL
FRAME_walk16,
gladiator_frames_walk,
NULL
};
void
gladiator_walk(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -176,27 +128,26 @@ gladiator_walk(edict_t *self)
self->monsterinfo.currentmove = &gladiator_move_walk;
}
static mframe_t gladiator_frames_run[] = {
mframe_t gladiator_frames_run[] = {
{ai_run, 23, NULL},
{ai_run, 14, NULL},
{ai_run, 14, gladiator_footstep},
{ai_run, 14, NULL},
{ai_run, 21, NULL},
{ai_run, 12, NULL},
{ai_run, 13, gladiator_footstep}
{ai_run, 13, NULL}
};
mmove_t gladiator_move_run =
{
mmove_t gladiator_move_run = {
FRAME_run1,
FRAME_run6,
gladiator_frames_run,
NULL
FRAME_run6,
gladiator_frames_run,
NULL
};
void
gladiator_run(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -216,7 +167,7 @@ GaldiatorMelee(edict_t *self)
{
vec3_t aim;
if (!self)
if (!self)
{
return;
}
@ -233,7 +184,7 @@ GaldiatorMelee(edict_t *self)
}
}
static mframe_t gladiator_frames_attack_melee[] = {
mframe_t gladiator_frames_attack_melee[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -253,18 +204,17 @@ static mframe_t gladiator_frames_attack_melee[] = {
{ai_charge, 0, NULL}
};
mmove_t gladiator_move_attack_melee =
{
mmove_t gladiator_move_attack_melee = {
FRAME_melee1,
FRAME_melee17,
gladiator_frames_attack_melee,
gladiator_run
FRAME_melee17,
gladiator_frames_attack_melee,
gladiator_run
};
void
gladiator_melee(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -279,7 +229,7 @@ GladiatorGun(edict_t *self)
vec3_t dir;
vec3_t forward, right;
if (!self)
if (!self)
{
return;
}
@ -295,7 +245,7 @@ GladiatorGun(edict_t *self)
monster_fire_railgun(self, start, dir, 50, 100, MZ2_GLADIATOR_RAILGUN_1);
}
static mframe_t gladiator_frames_attack_gun[] = {
mframe_t gladiator_frames_attack_gun[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -307,12 +257,11 @@ static mframe_t gladiator_frames_attack_gun[] = {
{ai_charge, 0, NULL}
};
mmove_t gladiator_move_attack_gun =
{
mmove_t gladiator_move_attack_gun = {
FRAME_attack1,
FRAME_attack9,
gladiator_frames_attack_gun,
gladiator_run
FRAME_attack9,
gladiator_frames_attack_gun,
gladiator_run
};
void
@ -321,24 +270,18 @@ gladiator_attack(edict_t *self)
float range;
vec3_t v;
if (!self)
if (!self)
{
return;
}
/* a small safe zone
but not for stand-ground ones since players can
abuse it by standing still inside this range
*/
if (!(self->monsterinfo.aiflags & AI_STAND_GROUND))
{
VectorSubtract(self->s.origin, self->enemy->s.origin, v);
range = VectorLength(v);
/* a small safe zone */
VectorSubtract(self->s.origin, self->enemy->s.origin, v);
range = VectorLength(v);
if (range <= (MELEE_DISTANCE + 32))
{
return;
}
if (range <= (MELEE_DISTANCE + 32))
{
return;
}
/* charge up the railgun */
@ -348,7 +291,7 @@ gladiator_attack(edict_t *self)
self->monsterinfo.currentmove = &gladiator_move_attack_gun;
}
static mframe_t gladiator_frames_pain[] = {
mframe_t gladiator_frames_pain[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -357,15 +300,14 @@ static mframe_t gladiator_frames_pain[] = {
{ai_move, 0, NULL}
};
mmove_t gladiator_move_pain =
{
mmove_t gladiator_move_pain = {
FRAME_pain1,
FRAME_pain6,
gladiator_frames_pain,
gladiator_run
FRAME_pain6,
gladiator_frames_pain,
gladiator_run
};
static mframe_t gladiator_frames_pain_air[] = {
mframe_t gladiator_frames_pain_air[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -375,19 +317,18 @@ static mframe_t gladiator_frames_pain_air[] = {
{ai_move, 0, NULL}
};
mmove_t gladiator_move_pain_air =
{
mmove_t gladiator_move_pain_air = {
FRAME_painup1,
FRAME_painup7,
gladiator_frames_pain_air,
gladiator_run
FRAME_painup7,
gladiator_frames_pain_air,
gladiator_run
};
void
gladiator_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
if (!self)
if (!self)
{
return;
}
@ -437,7 +378,7 @@ gladiator_pain(edict_t *self, edict_t *other /* unused */,
void
gladiator_dead(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -450,7 +391,7 @@ gladiator_dead(edict_t *self)
gi.linkentity(self);
}
static mframe_t gladiator_frames_death[] = {
mframe_t gladiator_frames_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -475,12 +416,11 @@ static mframe_t gladiator_frames_death[] = {
{ai_move, 0, NULL}
};
mmove_t gladiator_move_death =
{
mmove_t gladiator_move_death = {
FRAME_death1,
FRAME_death22,
gladiator_frames_death,
gladiator_dead
FRAME_death22,
gladiator_frames_death,
gladiator_dead
};
void
@ -490,7 +430,7 @@ gladiator_die(edict_t *self, edict_t *inflictor /* unused */,
{
int n;
if (!self)
if (!self)
{
return;
}
@ -538,7 +478,7 @@ gladiator_die(edict_t *self, edict_t *inflictor /* unused */,
void
SP_monster_gladiator(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -549,11 +489,6 @@ SP_monster_gladiator(edict_t *self)
return;
}
// Force recaching at next footstep to ensure
// that the sound indices are correct.
sound_step = 0;
sound_step2 = 0;
sound_pain1 = gi.soundindex("gladiator/pain.wav");
sound_pain2 = gi.soundindex("gladiator/gldpain2.wav");
sound_die = gi.soundindex("gladiator/glddeth2.wav");

View file

@ -1,23 +1,4 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
/* =======================================================================
*
* Gunner.
*
@ -35,9 +16,6 @@ static int sound_open;
static int sound_search;
static int sound_sight;
static int sound_step;
static int sound_step2;
qboolean visible(edict_t *self, edict_t *other);
void GunnerGrenade(edict_t *self);
void GunnerFire(edict_t *self);
@ -45,34 +23,10 @@ void gunner_fire_chain(edict_t *self);
void gunner_refire_chain(edict_t *self);
void gunner_stand(edict_t *self);
void
gunner_footstep(edict_t *self)
{
if (!g_monsterfootsteps->value)
return;
// Lazy loading for savegame compatibility.
if (sound_step == 0 || sound_step2 == 0)
{
sound_step = gi.soundindex("gunner/step1.wav");
sound_step2 = gi.soundindex("gunner/step2.wav");
}
if (randk() % 2 == 0)
{
gi.sound(self, CHAN_BODY, sound_step, 1, ATTN_NORM, 0);
}
else
{
gi.sound(self, CHAN_BODY, sound_step2, 1, ATTN_NORM, 0);
}
}
void
gunner_idlesound(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -81,9 +35,9 @@ gunner_idlesound(edict_t *self)
}
void
gunner_sight(edict_t *self, edict_t *other /* unused */)
gunner_sight(edict_t *self, edict_t *other)
{
if (!self)
if (!self)
{
return;
}
@ -94,7 +48,7 @@ gunner_sight(edict_t *self, edict_t *other /* unused */)
void
gunner_search(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -102,7 +56,7 @@ gunner_search(edict_t *self)
gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
static mframe_t gunner_frames_fidget[] = {
mframe_t gunner_frames_fidget[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -158,18 +112,17 @@ static mframe_t gunner_frames_fidget[] = {
{ai_stand, 0, NULL}
};
mmove_t gunner_move_fidget =
{
mmove_t gunner_move_fidget = {
FRAME_stand31,
FRAME_stand70,
gunner_frames_fidget,
gunner_frames_fidget,
gunner_stand
};
void
gunner_fidget(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -190,7 +143,7 @@ gunner_fidget(edict_t *self)
}
}
static mframe_t gunner_frames_stand[] = {
mframe_t gunner_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -225,18 +178,17 @@ static mframe_t gunner_frames_stand[] = {
{ai_stand, 0, gunner_fidget}
};
mmove_t gunner_move_stand =
{
mmove_t gunner_move_stand = {
FRAME_stand01,
FRAME_stand30,
gunner_frames_stand,
NULL
FRAME_stand30,
gunner_frames_stand,
NULL
};
void
gunner_stand(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -244,34 +196,33 @@ gunner_stand(edict_t *self)
self->monsterinfo.currentmove = &gunner_move_stand;
}
static mframe_t gunner_frames_walk[] = {
{ai_walk, 0, gunner_footstep},
mframe_t gunner_frames_walk[] = {
{ai_walk, 0, NULL},
{ai_walk, 3, NULL},
{ai_walk, 4, NULL},
{ai_walk, 5, NULL},
{ai_walk, 7, NULL},
{ai_walk, 2, gunner_footstep},
{ai_walk, 2, NULL},
{ai_walk, 6, NULL},
{ai_walk, 4, NULL},
{ai_walk, 2, NULL},
{ai_walk, 7, NULL},
{ai_walk, 5, NULL},
{ai_walk, 7, NULL},
{ai_walk, 4, gunner_footstep}
{ai_walk, 4, NULL}
};
mmove_t gunner_move_walk =
{
mmove_t gunner_move_walk = {
FRAME_walk07,
FRAME_walk19,
gunner_frames_walk,
NULL
FRAME_walk19,
gunner_frames_walk,
NULL
};
void
gunner_walk(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -279,29 +230,28 @@ gunner_walk(edict_t *self)
self->monsterinfo.currentmove = &gunner_move_walk;
}
static mframe_t gunner_frames_run[] = {
mframe_t gunner_frames_run[] = {
{ai_run, 26, NULL},
{ai_run, 9, gunner_footstep},
{ai_run, 9, NULL},
{ai_run, 9, NULL},
{ai_run, 9, NULL},
{ai_run, 15, NULL},
{ai_run, 10, gunner_footstep},
{ai_run, 10, NULL},
{ai_run, 13, NULL},
{ai_run, 6, NULL}
};
mmove_t gunner_move_run =
{
mmove_t gunner_move_run = {
FRAME_run01,
FRAME_run08,
gunner_frames_run,
NULL
gunner_frames_run,
NULL
};
void
gunner_run(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -316,27 +266,26 @@ gunner_run(edict_t *self)
}
}
static mframe_t gunner_frames_runandshoot[] = {
mframe_t gunner_frames_runandshoot[] = {
{ai_run, 32, NULL},
{ai_run, 15, gunner_footstep},
{ai_run, 15, NULL},
{ai_run, 10, NULL},
{ai_run, 18, NULL},
{ai_run, 8, gunner_footstep},
{ai_run, 8, NULL},
{ai_run, 20, NULL}
};
mmove_t gunner_move_runandshoot =
{
mmove_t gunner_move_runandshoot = {
FRAME_runs01,
FRAME_runs06,
FRAME_runs06,
gunner_frames_runandshoot,
NULL
NULL
};
void
gunner_runandshoot(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -344,7 +293,7 @@ gunner_runandshoot(edict_t *self)
self->monsterinfo.currentmove = &gunner_move_runandshoot;
}
static mframe_t gunner_frames_pain3[] = {
mframe_t gunner_frames_pain3[] = {
{ai_move, -3, NULL},
{ai_move, 1, NULL},
{ai_move, 1, NULL},
@ -352,37 +301,35 @@ static mframe_t gunner_frames_pain3[] = {
{ai_move, 1, NULL}
};
mmove_t gunner_move_pain3 =
{
mmove_t gunner_move_pain3 = {
FRAME_pain301,
FRAME_pain305,
gunner_frames_pain3,
gunner_run
FRAME_pain305,
gunner_frames_pain3,
gunner_run
};
static mframe_t gunner_frames_pain2[] = {
mframe_t gunner_frames_pain2[] = {
{ai_move, -2, NULL},
{ai_move, 11, NULL},
{ai_move, 6, gunner_footstep},
{ai_move, 6, NULL},
{ai_move, 2, NULL},
{ai_move, -1, NULL},
{ai_move, -7, NULL},
{ai_move, -2, NULL},
{ai_move, -7, gunner_footstep}
{ai_move, -7, NULL}
};
mmove_t gunner_move_pain2 =
{
mmove_t gunner_move_pain2 = {
FRAME_pain201,
FRAME_pain208,
gunner_frames_pain2,
gunner_run
FRAME_pain208,
gunner_frames_pain2,
gunner_run
};
static mframe_t gunner_frames_pain1[] = {
mframe_t gunner_frames_pain1[] = {
{ai_move, 2, NULL},
{ai_move, 0, NULL},
{ai_move, -5, gunner_footstep},
{ai_move, -5, NULL},
{ai_move, 3, NULL},
{ai_move, -1, NULL},
{ai_move, 0, NULL},
@ -392,27 +339,26 @@ static mframe_t gunner_frames_pain1[] = {
{ai_move, 1, NULL},
{ai_move, 1, NULL},
{ai_move, 2, NULL},
{ai_move, 1, gunner_footstep},
{ai_move, 1, NULL},
{ai_move, 0, NULL},
{ai_move, -2, NULL},
{ai_move, -2, NULL},
{ai_move, 0, gunner_footstep},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t gunner_move_pain1 =
{
mmove_t gunner_move_pain1 = {
FRAME_pain101,
FRAME_pain118,
gunner_frames_pain1,
gunner_run
FRAME_pain118,
gunner_frames_pain1,
gunner_run
};
void
gunner_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
if (!self)
if (!self)
{
return;
}
@ -440,7 +386,7 @@ gunner_pain(edict_t *self, edict_t *other /* unused */,
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
return; /* no pain anims in nightmare */
}
if (damage <= 10)
@ -460,7 +406,7 @@ gunner_pain(edict_t *self, edict_t *other /* unused */,
void
gunner_dead(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -473,7 +419,7 @@ gunner_dead(edict_t *self)
gi.linkentity(self);
}
static mframe_t gunner_frames_death[] = {
mframe_t gunner_frames_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -487,12 +433,11 @@ static mframe_t gunner_frames_death[] = {
{ai_move, 0, NULL}
};
mmove_t gunner_move_death =
{
mmove_t gunner_move_death = {
FRAME_death01,
FRAME_death11,
gunner_frames_death,
gunner_dead
FRAME_death11,
gunner_frames_death,
gunner_dead
};
void
@ -502,7 +447,7 @@ gunner_die(edict_t *self, edict_t *inflictor /* unused */,
{
int n;
if (!self)
if (!self)
{
return;
}
@ -514,18 +459,15 @@ gunner_die(edict_t *self, edict_t *inflictor /* unused */,
for (n = 0; n < 2; n++)
{
ThrowGib(self, "models/objects/gibs/bone/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
}
for (n = 0; n < 4; n++)
{
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
}
ThrowHead(self, "models/objects/gibs/head2/tris.md2",
damage, GIB_ORGANIC);
ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
@ -545,7 +487,7 @@ gunner_die(edict_t *self, edict_t *inflictor /* unused */,
void
gunner_duck_down(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -574,7 +516,7 @@ gunner_duck_down(edict_t *self)
void
gunner_duck_hold(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -592,7 +534,7 @@ gunner_duck_hold(edict_t *self)
void
gunner_duck_up(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -603,7 +545,7 @@ gunner_duck_up(edict_t *self)
gi.linkentity(self);
}
static mframe_t gunner_frames_duck[] = {
mframe_t gunner_frames_duck[] = {
{ai_move, 1, gunner_duck_down},
{ai_move, 1, NULL},
{ai_move, 1, gunner_duck_hold},
@ -614,16 +556,15 @@ static mframe_t gunner_frames_duck[] = {
{ai_move, -1, NULL}
};
mmove_t gunner_move_duck =
{
mmove_t gunner_move_duck = {
FRAME_duck01,
FRAME_duck08,
gunner_frames_duck,
gunner_run
gunner_run
};
void
gunner_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
gunner_dodge(edict_t *self, edict_t *attacker, float eta /* unsued */)
{
if (!self || !attacker)
{
@ -647,7 +588,7 @@ gunner_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
void
gunner_opengun(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -664,7 +605,7 @@ GunnerFire(edict_t *self)
vec3_t aim;
int flash_number;
if (!self)
if (!self)
{
return;
}
@ -694,7 +635,7 @@ GunnerGrenade(edict_t *self)
vec3_t aim;
int flash_number;
if (!self)
if (!self)
{
return;
}
@ -719,15 +660,13 @@ GunnerGrenade(edict_t *self)
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[flash_number],
forward, right, start);
VectorCopy(forward, aim);
monster_fire_grenade(self, start, aim, 50, 600, flash_number);
}
static mframe_t gunner_frames_attack_chain[] = {
mframe_t gunner_frames_attack_chain[] = {
{ai_charge, 0, gunner_opengun},
{ai_charge, 0, gunner_footstep},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -735,15 +674,14 @@ static mframe_t gunner_frames_attack_chain[] = {
{ai_charge, 0, NULL}
};
mmove_t gunner_move_attack_chain =
{
mmove_t gunner_move_attack_chain = {
FRAME_attak209,
FRAME_attak215,
gunner_frames_attack_chain,
gunner_fire_chain
FRAME_attak215,
gunner_frames_attack_chain,
gunner_fire_chain
};
static mframe_t gunner_frames_fire_chain[] = {
mframe_t gunner_frames_fire_chain[] = {
{ai_charge, 0, GunnerFire},
{ai_charge, 0, GunnerFire},
{ai_charge, 0, GunnerFire},
@ -754,33 +692,31 @@ static mframe_t gunner_frames_fire_chain[] = {
{ai_charge, 0, GunnerFire}
};
mmove_t gunner_move_fire_chain =
{
mmove_t gunner_move_fire_chain = {
FRAME_attak216,
FRAME_attak223,
gunner_frames_fire_chain,
gunner_refire_chain
FRAME_attak223,
gunner_frames_fire_chain,
gunner_refire_chain
};
static mframe_t gunner_frames_endfire_chain[] = {
mframe_t gunner_frames_endfire_chain[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, gunner_footstep}
{ai_charge, 0, NULL}
};
mmove_t gunner_move_endfire_chain =
{
mmove_t gunner_move_endfire_chain = {
FRAME_attak224,
FRAME_attak230,
gunner_frames_endfire_chain,
gunner_run
FRAME_attak230,
gunner_frames_endfire_chain,
gunner_run
};
static mframe_t gunner_frames_attack_grenade[] = {
mframe_t gunner_frames_attack_grenade[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -804,18 +740,17 @@ static mframe_t gunner_frames_attack_grenade[] = {
{ai_charge, 0, NULL}
};
mmove_t gunner_move_attack_grenade =
{
mmove_t gunner_move_attack_grenade = {
FRAME_attak101,
FRAME_attak121,
gunner_frames_attack_grenade,
gunner_run
FRAME_attak121,
gunner_frames_attack_grenade,
gunner_run
};
void
gunner_attack(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -840,7 +775,7 @@ gunner_attack(edict_t *self)
void
gunner_fire_chain(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -851,7 +786,7 @@ gunner_fire_chain(edict_t *self)
void
gunner_refire_chain(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -877,7 +812,7 @@ gunner_refire_chain(edict_t *self)
void
SP_monster_gunner(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -888,11 +823,6 @@ SP_monster_gunner(edict_t *self)
return;
}
// Force recaching at next footstep to ensure
// that the sound indices are correct.
sound_step = 0;
sound_step2 = 0;
sound_death = gi.soundindex("gunner/death1.wav");
sound_pain = gi.soundindex("gunner/gunpain2.wav");
sound_pain2 = gi.soundindex("gunner/gunpain1.wav");
@ -933,3 +863,4 @@ SP_monster_gunner(edict_t *self)
walkmonster_start(self);
}

View file

@ -55,7 +55,7 @@ hover_search(edict_t *self)
}
}
static mframe_t hover_frames_stand[] = {
mframe_t hover_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -95,7 +95,7 @@ mmove_t hover_move_stand = {
NULL
};
static mframe_t hover_frames_stop1[] = {
mframe_t hover_frames_stop1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -114,7 +114,7 @@ mmove_t hover_move_stop1 = {
NULL
};
static mframe_t hover_frames_stop2[] = {
mframe_t hover_frames_stop2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -132,7 +132,7 @@ mmove_t hover_move_stop2 = {
NULL
};
static mframe_t hover_frames_takeoff[] = {
mframe_t hover_frames_takeoff[] = {
{ai_move, 0, NULL},
{ai_move, -2, NULL},
{ai_move, 5, NULL},
@ -172,7 +172,7 @@ mmove_t hover_move_takeoff = {
NULL
};
static mframe_t hover_frames_pain3[] = {
mframe_t hover_frames_pain3[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -191,7 +191,7 @@ mmove_t hover_move_pain3 = {
hover_run
};
static mframe_t hover_frames_pain2[] = {
mframe_t hover_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -213,7 +213,7 @@ mmove_t hover_move_pain2 = {
hover_run
};
static mframe_t hover_frames_pain1[] = {
mframe_t hover_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 2, NULL},
@ -251,7 +251,7 @@ mmove_t hover_move_pain1 = {
hover_run
};
static mframe_t hover_frames_land[] = {
mframe_t hover_frames_land[] = {
{ai_move, 0, NULL}
};
@ -262,7 +262,7 @@ mmove_t hover_move_land = {
NULL
};
static mframe_t hover_frames_forward[] = {
mframe_t hover_frames_forward[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -307,7 +307,7 @@ mmove_t hover_move_forward = {
NULL
};
static mframe_t hover_frames_walk[] = {
mframe_t hover_frames_walk[] = {
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
@ -352,7 +352,7 @@ mmove_t hover_move_walk = {
NULL
};
static mframe_t hover_frames_run[] = {
mframe_t hover_frames_run[] = {
{ai_run, 10, NULL},
{ai_run, 10, NULL},
{ai_run, 10, NULL},
@ -397,7 +397,7 @@ mmove_t hover_move_run = {
NULL
};
static mframe_t hover_frames_death1[] = {
mframe_t hover_frames_death1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -418,7 +418,7 @@ mmove_t hover_move_death1 = {
hover_dead
};
static mframe_t hover_frames_backward[] = {
mframe_t hover_frames_backward[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -452,7 +452,7 @@ mmove_t hover_move_backward = {
NULL
};
static mframe_t hover_frames_start_attack[] = {
mframe_t hover_frames_start_attack[] = {
{ai_charge, 1, NULL},
{ai_charge, 1, NULL},
{ai_charge, 1, NULL}
@ -465,7 +465,7 @@ mmove_t hover_move_start_attack = {
hover_attack
};
static mframe_t hover_frames_attack1[] = {
mframe_t hover_frames_attack1[] = {
{ai_charge, -10, hover_fire_blaster},
{ai_charge, -10, hover_fire_blaster},
{ai_charge, 0, hover_reattack},
@ -478,7 +478,7 @@ mmove_t hover_move_attack1 = {
NULL
};
static mframe_t hover_frames_end_attack[] = {
mframe_t hover_frames_end_attack[] = {
{ai_charge, 1, NULL},
{ai_charge, 1, NULL}
};

View file

@ -1,23 +1,4 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
/* =======================================================================
*
* Infantry.
*
@ -42,34 +23,7 @@ static int sound_sight;
static int sound_search;
static int sound_idle;
static int sound_step;
static int sound_step2;
void
infantry_footstep(edict_t *self)
{
if (!g_monsterfootsteps->value)
return;
// Lazy loading for savegame compatibility.
if (sound_step == 0 || sound_step2 == 0)
{
sound_step = gi.soundindex("infantry/step1.wav");
sound_step2 = gi.soundindex("infantry/step2.wav");
}
if (randk() % 2 == 0)
{
gi.sound(self, CHAN_BODY, sound_step, 1, ATTN_NORM, 0);
}
else
{
gi.sound(self, CHAN_BODY, sound_step2, 1, ATTN_NORM, 0);
}
}
static mframe_t infantry_frames_stand[] = {
mframe_t infantry_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -94,10 +48,9 @@ static mframe_t infantry_frames_stand[] = {
{ai_stand, 0, NULL}
};
mmove_t infantry_move_stand =
{
mmove_t infantry_move_stand = {
FRAME_stand50,
FRAME_stand71,
FRAME_stand71,
infantry_frames_stand,
NULL
};
@ -105,7 +58,7 @@ mmove_t infantry_move_stand =
void
infantry_stand(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -113,13 +66,13 @@ infantry_stand(edict_t *self)
self->monsterinfo.currentmove = &infantry_move_stand;
}
static mframe_t infantry_frames_fidget[] = {
mframe_t infantry_frames_fidget[] = {
{ai_stand, 1, NULL},
{ai_stand, 0, NULL},
{ai_stand, 1, NULL},
{ai_stand, 3, NULL},
{ai_stand, 6, NULL},
{ai_stand, 3, infantry_footstep},
{ai_stand, 3, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -161,22 +114,21 @@ static mframe_t infantry_frames_fidget[] = {
{ai_stand, -3, NULL},
{ai_stand, -2, NULL},
{ai_stand, -3, NULL},
{ai_stand, -3, infantry_footstep},
{ai_stand, -3, NULL},
{ai_stand, -2, NULL}
};
mmove_t infantry_move_fidget =
{
mmove_t infantry_move_fidget = {
FRAME_stand01,
FRAME_stand49,
infantry_frames_fidget,
infantry_stand
FRAME_stand49,
infantry_frames_fidget,
infantry_stand
};
void
infantry_fidget(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -185,14 +137,14 @@ infantry_fidget(edict_t *self)
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
static mframe_t infantry_frames_walk[] = {
{ai_walk, 5, infantry_footstep},
mframe_t infantry_frames_walk[] = {
{ai_walk, 5, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 5, NULL},
{ai_walk, 4, NULL},
{ai_walk, 5, NULL},
{ai_walk, 6, infantry_footstep},
{ai_walk, 6, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
@ -200,18 +152,17 @@ static mframe_t infantry_frames_walk[] = {
{ai_walk, 5, NULL}
};
mmove_t infantry_move_walk =
{
mmove_t infantry_move_walk = {
FRAME_walk03,
FRAME_walk14,
infantry_frames_walk,
FRAME_walk14,
infantry_frames_walk,
NULL
};
void
infantry_walk(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -219,22 +170,21 @@ infantry_walk(edict_t *self)
self->monsterinfo.currentmove = &infantry_move_walk;
}
static mframe_t infantry_frames_run[] = {
mframe_t infantry_frames_run[] = {
{ai_run, 10, NULL},
{ai_run, 20, infantry_footstep},
{ai_run, 20, NULL},
{ai_run, 5, NULL},
{ai_run, 7, NULL},
{ai_run, 30, NULL},
{ai_run, 35, infantry_footstep},
{ai_run, 35, NULL},
{ai_run, 2, NULL},
{ai_run, 6, NULL}
};
mmove_t infantry_move_run =
{
mmove_t infantry_move_run = {
FRAME_run01,
FRAME_run08,
infantry_frames_run,
FRAME_run08,
infantry_frames_run,
NULL
};
@ -256,46 +206,44 @@ infantry_run(edict_t *self)
}
}
static mframe_t infantry_frames_pain1[] = {
mframe_t infantry_frames_pain1[] = {
{ai_move, -3, NULL},
{ai_move, -2, NULL},
{ai_move, -1, NULL},
{ai_move, -2, NULL},
{ai_move, -1, infantry_footstep},
{ai_move, -1, NULL},
{ai_move, 1, NULL},
{ai_move, -1, NULL},
{ai_move, 1, NULL},
{ai_move, 6, NULL},
{ai_move, 2, infantry_footstep}
{ai_move, 2, NULL}
};
mmove_t infantry_move_pain1 =
{
mmove_t infantry_move_pain1 = {
FRAME_pain101,
FRAME_pain110,
infantry_frames_pain1,
infantry_run
};
static mframe_t infantry_frames_pain2[] = {
mframe_t infantry_frames_pain2[] = {
{ai_move, -3, NULL},
{ai_move, -3, NULL},
{ai_move, 0, NULL},
{ai_move, -1, NULL},
{ai_move, -2, infantry_footstep},
{ai_move, -2, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 2, NULL},
{ai_move, 5, NULL},
{ai_move, 2, infantry_footstep}
{ai_move, 2, NULL}
};
mmove_t infantry_move_pain2 =
{
mmove_t infantry_move_pain2 = {
FRAME_pain201,
FRAME_pain210,
infantry_frames_pain2,
infantry_run
FRAME_pain210,
infantry_frames_pain2,
infantry_run
};
void
@ -304,7 +252,7 @@ infantry_pain(edict_t *self, edict_t *other /* unused */,
{
int n;
if (!self)
if (!self)
{
return;
}
@ -363,7 +311,7 @@ InfantryMachineGun(edict_t *self)
vec3_t vec;
int flash_number;
if (!self)
if (!self)
{
return;
}
@ -389,8 +337,7 @@ InfantryMachineGun(edict_t *self)
}
else
{
flash_number = MZ2_INFANTRY_MACHINEGUN_2 +
(self->s.frame - FRAME_death211);
flash_number = MZ2_INFANTRY_MACHINEGUN_2 + (self->s.frame - FRAME_death211);
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[flash_number],
@ -407,7 +354,7 @@ InfantryMachineGun(edict_t *self)
void
infantry_sight(edict_t *self, edict_t *other /* unused */)
{
if (!self)
if (!self)
{
return;
}
@ -418,7 +365,7 @@ infantry_sight(edict_t *self, edict_t *other /* unused */)
void
infantry_dead(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -432,16 +379,16 @@ infantry_dead(edict_t *self)
M_FlyCheck(self);
}
static mframe_t infantry_frames_death1[] = {
mframe_t infantry_frames_death1[] = {
{ai_move, -4, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, -1, NULL},
{ai_move, -4, infantry_footstep},
{ai_move, -4, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, -1, infantry_footstep},
{ai_move, -1, NULL},
{ai_move, 3, NULL},
{ai_move, 1, NULL},
{ai_move, 1, NULL},
@ -455,23 +402,22 @@ static mframe_t infantry_frames_death1[] = {
{ai_move, -3, NULL}
};
mmove_t infantry_move_death1 =
{
mmove_t infantry_move_death1 = {
FRAME_death101,
FRAME_death120,
infantry_frames_death1,
infantry_dead
FRAME_death120,
infantry_frames_death1,
infantry_dead
};
/* Off with his head */
static mframe_t infantry_frames_death2[] = {
mframe_t infantry_frames_death2[] = {
{ai_move, 0, NULL},
{ai_move, 1, NULL},
{ai_move, 5, NULL},
{ai_move, -1, NULL},
{ai_move, 0, NULL},
{ai_move, 1, infantry_footstep},
{ai_move, 1, infantry_footstep},
{ai_move, 1, NULL},
{ai_move, 1, NULL},
{ai_move, 4, NULL},
{ai_move, 3, NULL},
{ai_move, 0, NULL},
@ -492,15 +438,14 @@ static mframe_t infantry_frames_death2[] = {
{ai_move, 0, NULL}
};
mmove_t infantry_move_death2 =
{
mmove_t infantry_move_death2 = {
FRAME_death201,
FRAME_death225,
FRAME_death225,
infantry_frames_death2,
infantry_dead
};
static mframe_t infantry_frames_death3[] = {
mframe_t infantry_frames_death3[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -512,8 +457,7 @@ static mframe_t infantry_frames_death3[] = {
{ai_move, 0, NULL}
};
mmove_t infantry_move_death3 =
{
mmove_t infantry_move_death3 = {
FRAME_death301,
FRAME_death309,
infantry_frames_death3,
@ -527,7 +471,7 @@ infantry_die(edict_t *self, edict_t *inflictor /* unused */,
{
int n;
if (!self)
if (!self)
{
return;
}
@ -539,18 +483,15 @@ infantry_die(edict_t *self, edict_t *inflictor /* unused */,
for (n = 0; n < 2; n++)
{
ThrowGib(self, "models/objects/gibs/bone/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
}
for (n = 0; n < 4; n++)
{
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
}
ThrowHead(self, "models/objects/gibs/head2/tris.md2",
damage, GIB_ORGANIC);
ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
@ -587,7 +528,7 @@ infantry_die(edict_t *self, edict_t *inflictor /* unused */,
void
infantry_duck_down(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -607,7 +548,7 @@ infantry_duck_down(edict_t *self)
void
infantry_duck_hold(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -625,7 +566,7 @@ infantry_duck_hold(edict_t *self)
void
infantry_duck_up(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -636,20 +577,19 @@ infantry_duck_up(edict_t *self)
gi.linkentity(self);
}
static mframe_t infantry_frames_duck[] = {
mframe_t infantry_frames_duck[] = {
{ai_move, -2, infantry_duck_down},
{ai_move, -5, infantry_duck_hold},
{ai_move, 3, NULL},
{ai_move, 4, infantry_duck_up},
{ai_move, 0, infantry_footstep}
{ai_move, 0, NULL}
};
mmove_t infantry_move_duck =
{
mmove_t infantry_move_duck = {
FRAME_duck01,
FRAME_duck05,
infantry_frames_duck,
infantry_run
FRAME_duck05,
infantry_frames_duck,
infantry_run
};
void
@ -679,7 +619,7 @@ infantry_set_firetime(edict_t *self)
{
int n;
if (!self)
if (!self)
{
return;
}
@ -702,7 +642,7 @@ infantry_cock_gun(edict_t *self)
void
infantry_fire(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -719,7 +659,7 @@ infantry_fire(edict_t *self)
}
}
static mframe_t infantry_frames_attack1[] = {
mframe_t infantry_frames_attack1[] = {
{ai_charge, 10, infantry_set_firetime},
{ai_charge, 6, NULL},
{ai_charge, 0, infantry_fire},
@ -737,18 +677,17 @@ static mframe_t infantry_frames_attack1[] = {
{ai_charge, -1, NULL}
};
mmove_t infantry_move_attack1 =
{
mmove_t infantry_move_attack1 = {
FRAME_attak101,
FRAME_attak115,
infantry_frames_attack1,
infantry_frames_attack1,
infantry_run
};
void
infantry_swing(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -761,7 +700,7 @@ infantry_smack(edict_t *self)
{
vec3_t aim;
if (!self)
if (!self)
{
return;
}
@ -774,29 +713,28 @@ infantry_smack(edict_t *self)
}
}
static mframe_t infantry_frames_attack2[] = {
mframe_t infantry_frames_attack2[] = {
{ai_charge, 3, NULL},
{ai_charge, 6, NULL},
{ai_charge, 0, infantry_swing},
{ai_charge, 8, infantry_footstep},
{ai_charge, 8, NULL},
{ai_charge, 5, NULL},
{ai_charge, 8, infantry_smack},
{ai_charge, 6, NULL},
{ai_charge, 3, NULL},
};
mmove_t infantry_move_attack2 =
{
mmove_t infantry_move_attack2 = {
FRAME_attak201,
FRAME_attak208,
infantry_frames_attack2,
infantry_run
infantry_frames_attack2,
infantry_run
};
void
infantry_attack(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -817,7 +755,7 @@ infantry_attack(edict_t *self)
void
SP_monster_infantry(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -828,11 +766,6 @@ SP_monster_infantry(edict_t *self)
return;
}
// Force recaching at next footstep to ensure
// that the sound indices are correct.
sound_step = 0;
sound_step2 = 0;
sound_pain1 = gi.soundindex("infantry/infpain1.wav");
sound_pain2 = gi.soundindex("infantry/infpain2.wav");
sound_die1 = gi.soundindex("infantry/infdeth1.wav");
@ -876,3 +809,4 @@ SP_monster_infantry(edict_t *self)
walkmonster_start(self);
}

View file

@ -1,23 +1,4 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
/* =======================================================================
*
* The insane earth soldiers.
*
@ -34,11 +15,6 @@ static int sound_shake;
static int sound_moan;
static int sound_scream[8];
static int sound_step;
static int sound_step2;
static int sound_step3;
static int sound_step4;
void insane_stand(edict_t *self);
void insane_dead(edict_t *self);
void insane_cross(edict_t *self);
@ -48,47 +24,10 @@ void insane_checkdown(edict_t *self);
void insane_checkup(edict_t *self);
void insane_onground(edict_t *self);
void
insane_footstep(edict_t *self)
{
if (!g_monsterfootsteps->value)
return;
// Lazy loading for savegame compatibility.
if (sound_step == 0 || sound_step2 == 0 || sound_step3 == 0 || sound_step4 == 0)
{
sound_step = gi.soundindex("player/step1.wav");
sound_step2 = gi.soundindex("player/step2.wav");
sound_step3 = gi.soundindex("player/step3.wav");
sound_step4 = gi.soundindex("player/step4.wav");
}
int i;
i = randk() % 4;
if (i == 0)
{
gi.sound(self, CHAN_BODY, sound_step, 0.7, ATTN_NORM, 0);
}
else if (i == 1)
{
gi.sound(self, CHAN_BODY, sound_step2, 0.7, ATTN_NORM, 0);
}
else if (i == 2)
{
gi.sound(self, CHAN_BODY, sound_step3, 0.7, ATTN_NORM, 0);
}
else if (i == 3)
{
gi.sound(self, CHAN_BODY, sound_step4, 0.7, ATTN_NORM, 0);
}
}
void
insane_fist(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -99,7 +38,7 @@ insane_fist(edict_t *self)
void
insane_shake(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -110,7 +49,7 @@ insane_shake(edict_t *self)
void
insane_moan(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -141,7 +80,7 @@ insane_scream(edict_t *self)
gi.sound(self, CHAN_VOICE, sound_scream[rand() % 8], 1, ATTN_IDLE, 0);
}
static mframe_t insane_frames_stand_normal[] = {
mframe_t insane_frames_stand_normal[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -150,15 +89,14 @@ static mframe_t insane_frames_stand_normal[] = {
{ai_stand, 0, insane_checkdown}
};
mmove_t insane_move_stand_normal =
{
mmove_t insane_move_stand_normal = {
FRAME_stand60,
FRAME_stand65,
FRAME_stand65,
insane_frames_stand_normal,
insane_stand
};
static mframe_t insane_frames_stand_insane[] = {
mframe_t insane_frames_stand_insane[] = {
{ai_stand, 0, insane_shake},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -191,15 +129,14 @@ static mframe_t insane_frames_stand_insane[] = {
{ai_stand, 0, insane_checkdown}
};
mmove_t insane_move_stand_insane =
{
mmove_t insane_move_stand_insane = {
FRAME_stand65,
FRAME_stand94,
insane_frames_stand_insane,
insane_frames_stand_insane,
insane_stand
};
static mframe_t insane_frames_uptodown[] = {
mframe_t insane_frames_uptodown[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -245,15 +182,14 @@ static mframe_t insane_frames_uptodown[] = {
{ai_move, 0, NULL}
};
mmove_t insane_move_uptodown =
{
mmove_t insane_move_uptodown = {
FRAME_stand1,
FRAME_stand40,
insane_frames_uptodown,
insane_onground
};
static mframe_t insane_frames_downtoup[] = {
mframe_t insane_frames_downtoup[] = {
{ai_move, -0.7, NULL}, /* 41 */
{ai_move, -1.2, NULL}, /* 42 */
{ai_move, -1.5, NULL}, /* 43 */
@ -272,18 +208,17 @@ static mframe_t insane_frames_downtoup[] = {
{ai_move, -0.3, NULL}, /* 56 */
{ai_move, 0, NULL}, /* 57 */
{ai_move, 0, NULL}, /* 58 */
{ai_move, 0, NULL} /* 59 */
{ai_move, 0, NULL} /* 59 */
};
mmove_t insane_move_downtoup =
{
mmove_t insane_move_downtoup = {
FRAME_stand41,
FRAME_stand59,
insane_frames_downtoup,
insane_stand
FRAME_stand59,
insane_frames_downtoup,
insane_stand
};
static mframe_t insane_frames_jumpdown[] = {
mframe_t insane_frames_jumpdown[] = {
{ai_move, 0.2, NULL},
{ai_move, 11.5, NULL},
{ai_move, 5.1, NULL},
@ -291,15 +226,14 @@ static mframe_t insane_frames_jumpdown[] = {
{ai_move, 0, NULL}
};
mmove_t insane_move_jumpdown =
{
mmove_t insane_move_jumpdown = {
FRAME_stand96,
FRAME_stand100,
FRAME_stand100,
insane_frames_jumpdown,
insane_onground
};
static mframe_t insane_frames_down[] = {
mframe_t insane_frames_down[] = {
{ai_move, 0, NULL}, /* 100 */
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -363,97 +297,92 @@ static mframe_t insane_frames_down[] = {
{ai_move, 0, insane_checkup} /* 160 */
};
mmove_t insane_move_down =
{
mmove_t insane_move_down = {
FRAME_stand100,
FRAME_stand160,
FRAME_stand160,
insane_frames_down,
insane_onground
};
static mframe_t insane_frames_walk_normal[] = {
mframe_t insane_frames_walk_normal[] = {
{ai_walk, 0, insane_scream},
{ai_walk, 2.5, NULL},
{ai_walk, 3.5, NULL},
{ai_walk, 1.7, NULL},
{ai_walk, 2.3, NULL},
{ai_walk, 2.4, NULL},
{ai_walk, 2.2, insane_footstep},
{ai_walk, 2.2, NULL},
{ai_walk, 4.2, NULL},
{ai_walk, 5.6, NULL},
{ai_walk, 3.3, NULL},
{ai_walk, 2.4, NULL},
{ai_walk, 0.9, NULL},
{ai_walk, 0, insane_footstep}
{ai_walk, 0, NULL}
};
mmove_t insane_move_walk_normal =
{
FRAME_walk27,
FRAME_walk39,
insane_frames_walk_normal,
insane_walk
};
mmove_t insane_move_run_normal =
{
mmove_t insane_move_walk_normal = {
FRAME_walk27,
FRAME_walk39,
insane_frames_walk_normal,
insane_run
insane_walk
};
static mframe_t insane_frames_walk_insane[] = {
mmove_t insane_move_run_normal = {
FRAME_walk27,
FRAME_walk39,
insane_frames_walk_normal,
insane_run
};
mframe_t insane_frames_walk_insane[] = {
{ai_walk, 0, insane_scream}, /* walk 1 */
{ai_walk, 3.4, NULL}, /* walk 2 */
{ai_walk, 3.6, NULL}, /* 3 */
{ai_walk, 2.9, NULL}, /* 4 */
{ai_walk, 2.2, NULL}, /* 5 */
{ai_walk, 2.6, NULL}, /* 6 */
{ai_walk, 0, insane_footstep}, /* 7 */
{ai_walk, 0, NULL}, /* 7 */
{ai_walk, 0.7, NULL}, /* 8 */
{ai_walk, 4.8, NULL}, /* 9 */
{ai_walk, 5.3, NULL}, /* 10 */
{ai_walk, 1.1, NULL}, /* 11 */
{ai_walk, 2, insane_footstep}, /* 12 */
{ai_walk, 2, NULL}, /* 12 */
{ai_walk, 0.5, NULL}, /* 13 */
{ai_walk, 0, NULL}, /* 14 */
{ai_walk, 0, NULL}, /* 15 */
{ai_walk, 4.9, NULL}, /* 16 */
{ai_walk, 6.7, NULL}, /* 17 */
{ai_walk, 3.8, NULL}, /* 18 */
{ai_walk, 2, insane_footstep}, /* 19 */
{ai_walk, 2, NULL}, /* 19 */
{ai_walk, 0.2, NULL}, /* 20 */
{ai_walk, 0, NULL}, /* 21 */
{ai_walk, 3.4, NULL}, /* 22 */
{ai_walk, 6.4, NULL}, /* 23 */
{ai_walk, 5, NULL}, /* 24 */
{ai_walk, 1.8, insane_footstep}, /* 25 */
{ai_walk, 1.8, NULL}, /* 25 */
{ai_walk, 0, NULL} /* 26 */
};
mmove_t insane_move_walk_insane =
{
mmove_t insane_move_walk_insane = {
FRAME_walk1,
FRAME_walk26,
FRAME_walk26,
insane_frames_walk_insane,
insane_walk
};
mmove_t insane_move_run_insane =
{
mmove_t insane_move_run_insane = {
FRAME_walk1,
FRAME_walk26,
FRAME_walk26,
insane_frames_walk_insane,
insane_run
};
static mframe_t insane_frames_stand_pain[] = {
mframe_t insane_frames_stand_pain[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, insane_footstep},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -462,15 +391,14 @@ static mframe_t insane_frames_stand_pain[] = {
{ai_move, 0, NULL}
};
mmove_t insane_move_stand_pain =
{
mmove_t insane_move_stand_pain = {
FRAME_st_pain2,
FRAME_st_pain12,
insane_frames_stand_pain,
insane_run
};
static mframe_t insane_frames_stand_death[] = {
mframe_t insane_frames_stand_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -490,15 +418,14 @@ static mframe_t insane_frames_stand_death[] = {
{ai_move, 0, NULL}
};
mmove_t insane_move_stand_death =
{
mmove_t insane_move_stand_death = {
FRAME_st_death2,
FRAME_st_death18,
insane_frames_stand_death,
insane_dead
insane_dead
};
static mframe_t insane_frames_crawl[] = {
mframe_t insane_frames_crawl[] = {
{ai_walk, 0, insane_scream},
{ai_walk, 1.5, NULL},
{ai_walk, 2.1, NULL},
@ -510,23 +437,21 @@ static mframe_t insane_frames_crawl[] = {
{ai_walk, 2.4, NULL}
};
mmove_t insane_move_crawl =
{
mmove_t insane_move_crawl = {
FRAME_crawl1,
FRAME_crawl9,
insane_frames_crawl,
NULL
};
mmove_t insane_move_runcrawl =
{
mmove_t insane_move_runcrawl = {
FRAME_crawl1,
FRAME_crawl9,
insane_frames_crawl,
insane_frames_crawl,
NULL
};
static mframe_t insane_frames_crawl_pain[] = {
mframe_t insane_frames_crawl_pain[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -538,15 +463,14 @@ static mframe_t insane_frames_crawl_pain[] = {
{ai_move, 0, NULL}
};
mmove_t insane_move_crawl_pain =
{
mmove_t insane_move_crawl_pain = {
FRAME_cr_pain2,
FRAME_cr_pain10,
insane_frames_crawl_pain,
insane_run
};
static mframe_t insane_frames_crawl_death[] = {
mframe_t insane_frames_crawl_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -556,15 +480,14 @@ static mframe_t insane_frames_crawl_death[] = {
{ai_move, 0, NULL}
};
mmove_t insane_move_crawl_death =
{
mmove_t insane_move_crawl_death = {
FRAME_cr_death10,
FRAME_cr_death16,
FRAME_cr_death16,
insane_frames_crawl_death,
insane_dead
};
static mframe_t insane_frames_cross[] = {
mframe_t insane_frames_cross[] = {
{ai_move, 0, insane_moan},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -582,15 +505,14 @@ static mframe_t insane_frames_cross[] = {
{ai_move, 0, NULL}
};
mmove_t insane_move_cross =
{
mmove_t insane_move_cross = {
FRAME_cross1,
FRAME_cross15,
FRAME_cross15,
insane_frames_cross,
insane_cross
};
static mframe_t insane_frames_struggle_cross[] = {
mframe_t insane_frames_struggle_cross[] = {
{ai_move, 0, insane_scream},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -608,18 +530,17 @@ static mframe_t insane_frames_struggle_cross[] = {
{ai_move, 0, NULL}
};
mmove_t insane_move_struggle_cross =
{
mmove_t insane_move_struggle_cross = {
FRAME_cross16,
FRAME_cross30,
insane_frames_struggle_cross,
insane_cross
insane_frames_struggle_cross,
insane_cross
};
void
insane_cross(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -637,7 +558,7 @@ insane_cross(edict_t *self)
void
insane_walk(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -669,7 +590,7 @@ insane_walk(edict_t *self)
void
insane_run(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -704,7 +625,7 @@ insane_pain(edict_t *self, edict_t *other /* unused */,
{
int l, r;
if (!self)
if (!self)
{
return;
}
@ -755,8 +676,7 @@ insane_pain(edict_t *self, edict_t *other /* unused */,
if (((self->s.frame >= FRAME_crawl1) &&
(self->s.frame <= FRAME_crawl9)) ||
((self->s.frame >= FRAME_stand99) &&
(self->s.frame <= FRAME_stand160)))
((self->s.frame >= FRAME_stand99) && (self->s.frame <= FRAME_stand160)))
{
self->monsterinfo.currentmove = &insane_move_crawl_pain;
}
@ -769,7 +689,7 @@ insane_pain(edict_t *self, edict_t *other /* unused */,
void
insane_onground(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -780,7 +700,7 @@ insane_onground(edict_t *self)
void
insane_checkdown(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -806,12 +726,11 @@ insane_checkdown(edict_t *self)
void
insane_checkup(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
/* If Hold_Ground and Crawl are set */
if ((self->spawnflags & 4) && (self->spawnflags & 16))
{
return;
@ -826,7 +745,7 @@ insane_checkup(edict_t *self)
void
insane_stand(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -836,7 +755,6 @@ insane_stand(edict_t *self)
self->monsterinfo.currentmove = &insane_move_cross;
self->monsterinfo.aiflags |= AI_STAND_GROUND;
}
/* If Hold_Ground and Crawl are set */
else if ((self->spawnflags & 4) && (self->spawnflags & 16))
{
self->monsterinfo.currentmove = &insane_move_down;
@ -855,7 +773,7 @@ insane_stand(edict_t *self)
void
insane_dead(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -883,7 +801,7 @@ insane_die(edict_t *self, edict_t *inflictor /* unused */,
{
int n;
if (!self)
if (!self)
{
return;
}
@ -894,18 +812,15 @@ insane_die(edict_t *self, edict_t *inflictor /* unused */,
for (n = 0; n < 2; n++)
{
ThrowGib(self, "models/objects/gibs/bone/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
}
for (n = 0; n < 4; n++)
{
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
}
ThrowHead(self, "models/objects/gibs/head2/tris.md2",
damage, GIB_ORGANIC);
ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
@ -947,7 +862,7 @@ insane_die(edict_t *self, edict_t *inflictor /* unused */,
void
SP_misc_insane(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -958,13 +873,6 @@ SP_misc_insane(edict_t *self)
return;
}
// Force recaching at next footstep to ensure
// that the sound indices are correct.
sound_step = 0;
sound_step2 = 0;
sound_step3 = 0;
sound_step4 = 0;
sound_fist = gi.soundindex("insane/insane11.wav");
sound_shake = gi.soundindex("insane/insane5.wav");
sound_moan = gi.soundindex("insane/insane7.wav");

View file

@ -1,23 +1,4 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
/* =======================================================================
*
* Medic.
*
@ -28,7 +9,6 @@
#include "medic.h"
qboolean visible(edict_t *self, edict_t *other);
static int sound_idle1;
static int sound_pain1;
static int sound_pain2;
@ -40,41 +20,15 @@ static int sound_hook_hit;
static int sound_hook_heal;
static int sound_hook_retract;
static int sound_step;
static int sound_step2;
void ED_CallSpawn(edict_t *ent);
void
medic_footstep(edict_t *self)
{
if (!g_monsterfootsteps->value)
return;
// Lazy loading for savegame compatibility.
if (sound_step == 0 || sound_step2 == 0)
{
sound_step = gi.soundindex("medic/step1.wav");
sound_step2 = gi.soundindex("medic/step2.wav");
}
if (randk() % 2 == 0)
{
gi.sound(self, CHAN_BODY, sound_step, 1, ATTN_NORM, 0);
}
else
{
gi.sound(self, CHAN_BODY, sound_step2, 1, ATTN_NORM, 0);
}
}
edict_t *
medic_FindDeadMonster(edict_t *self)
{
edict_t *ent = NULL;
edict_t *best = NULL;
if (!self)
if (!self)
{
return NULL;
}
@ -138,7 +92,7 @@ medic_idle(edict_t *self)
{
edict_t *ent;
if (!self)
if (!self)
{
return;
}
@ -161,7 +115,7 @@ medic_search(edict_t *self)
{
edict_t *ent;
if (!self)
if (!self)
{
return;
}
@ -186,7 +140,7 @@ medic_search(edict_t *self)
void
medic_sight(edict_t *self, edict_t *other /* unused */)
{
if (!self)
if (!self)
{
return;
}
@ -194,7 +148,7 @@ medic_sight(edict_t *self, edict_t *other /* unused */)
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
static mframe_t medic_frames_stand[] = {
mframe_t medic_frames_stand[] = {
{ai_stand, 0, medic_idle},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -287,8 +241,7 @@ static mframe_t medic_frames_stand[] = {
{ai_stand, 0, NULL},
};
mmove_t medic_move_stand =
{
mmove_t medic_move_stand = {
FRAME_wait1,
FRAME_wait90,
medic_frames_stand,
@ -298,7 +251,7 @@ mmove_t medic_move_stand =
void
medic_stand(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -306,23 +259,22 @@ medic_stand(edict_t *self)
self->monsterinfo.currentmove = &medic_move_stand;
}
static mframe_t medic_frames_walk[] = {
mframe_t medic_frames_walk[] = {
{ai_walk, 6.2, NULL},
{ai_walk, 18.1, medic_footstep},
{ai_walk, 18.1, NULL},
{ai_walk, 1, NULL},
{ai_walk, 9, NULL},
{ai_walk, 10, NULL},
{ai_walk, 9, NULL},
{ai_walk, 11, NULL},
{ai_walk, 11.6, medic_footstep},
{ai_walk, 11.6, NULL},
{ai_walk, 2, NULL},
{ai_walk, 9.9, NULL},
{ai_walk, 14, NULL},
{ai_walk, 9.3, NULL}
};
mmove_t medic_move_walk =
{
mmove_t medic_move_walk = {
FRAME_walk1,
FRAME_walk12,
medic_frames_walk,
@ -332,7 +284,7 @@ mmove_t medic_move_walk =
void
medic_walk(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -340,27 +292,26 @@ medic_walk(edict_t *self)
self->monsterinfo.currentmove = &medic_move_walk;
}
static mframe_t medic_frames_run[] = {
{ai_run, 18, medic_footstep},
mframe_t medic_frames_run[] = {
{ai_run, 18, NULL},
{ai_run, 22.5, NULL},
{ai_run, 25.4, NULL},
{ai_run, 23.4, NULL},
{ai_run, 24, medic_footstep},
{ai_run, 24, NULL},
{ai_run, 35.6, NULL}
};
mmove_t medic_move_run =
{
mmove_t medic_move_run = {
FRAME_run1,
FRAME_run6,
medic_frames_run,
FRAME_run6,
medic_frames_run,
NULL
};
void
medic_run(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -392,7 +343,7 @@ medic_run(edict_t *self)
}
}
static mframe_t medic_frames_pain1[] = {
mframe_t medic_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -403,19 +354,14 @@ static mframe_t medic_frames_pain1[] = {
{ai_move, 0, NULL}
};
mmove_t medic_move_pain1 =
{
mmove_t medic_move_pain1 = {
FRAME_paina1,
FRAME_paina8,
FRAME_paina8,
medic_frames_pain1,
medic_run
};
static mframe_t medic_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, medic_footstep},
mframe_t medic_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -426,11 +372,14 @@ static mframe_t medic_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, medic_footstep}
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t medic_move_pain2 =
{
mmove_t medic_move_pain2 = {
FRAME_painb1,
FRAME_painb15,
medic_frames_pain2,
@ -441,7 +390,7 @@ void
medic_pain(edict_t *self, edict_t *other /* unused */,
float kick, int damage /* unused */)
{
if (!self)
if (!self)
{
return;
}
@ -484,7 +433,7 @@ medic_fire_blaster(edict_t *self)
vec3_t dir;
int effect;
if (!self)
if (!self)
{
return;
}
@ -519,7 +468,7 @@ medic_fire_blaster(edict_t *self)
void
medic_dead(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -532,7 +481,7 @@ medic_dead(edict_t *self)
gi.linkentity(self);
}
static mframe_t medic_frames_death[] = {
mframe_t medic_frames_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -565,8 +514,7 @@ static mframe_t medic_frames_death[] = {
{ai_move, 0, NULL}
};
mmove_t medic_move_death =
{
mmove_t medic_move_death = {
FRAME_death1,
FRAME_death30,
medic_frames_death,
@ -580,7 +528,7 @@ medic_die(edict_t *self, edict_t *inflictor /* unused */,
{
int n;
if (!self)
if (!self)
{
return;
}
@ -598,18 +546,15 @@ medic_die(edict_t *self, edict_t *inflictor /* unused */,
for (n = 0; n < 2; n++)
{
ThrowGib(self, "models/objects/gibs/bone/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
}
for (n = 0; n < 4; n++)
{
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
}
ThrowHead(self, "models/objects/gibs/head2/tris.md2",
damage, GIB_ORGANIC);
ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
@ -630,7 +575,7 @@ medic_die(edict_t *self, edict_t *inflictor /* unused */,
void
medic_duck_down(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -650,7 +595,7 @@ medic_duck_down(edict_t *self)
void
medic_duck_hold(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -668,7 +613,7 @@ medic_duck_hold(edict_t *self)
void
medic_duck_up(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -679,7 +624,7 @@ medic_duck_up(edict_t *self)
gi.linkentity(self);
}
static mframe_t medic_frames_duck[] = {
mframe_t medic_frames_duck[] = {
{ai_move, -1, NULL},
{ai_move, -1, NULL},
{ai_move, -1, medic_duck_down},
@ -698,8 +643,7 @@ static mframe_t medic_frames_duck[] = {
{ai_move, -1, NULL}
};
mmove_t medic_move_duck =
{
mmove_t medic_move_duck = {
FRAME_duck1,
FRAME_duck16,
medic_frames_duck,
@ -709,7 +653,7 @@ mmove_t medic_move_duck =
void
medic_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
{
if (!self || !attacker)
if (!self || !attacker)
{
return;
}
@ -728,7 +672,7 @@ medic_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
self->monsterinfo.currentmove = &medic_move_duck;
}
static mframe_t medic_frames_attackHyperBlaster[] = {
mframe_t medic_frames_attackHyperBlaster[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -747,8 +691,7 @@ static mframe_t medic_frames_attackHyperBlaster[] = {
{ai_charge, 0, medic_fire_blaster}
};
mmove_t medic_move_attackHyperBlaster =
{
mmove_t medic_move_attackHyperBlaster = {
FRAME_attack15,
FRAME_attack30,
medic_frames_attackHyperBlaster,
@ -758,7 +701,7 @@ mmove_t medic_move_attackHyperBlaster =
void
medic_continue(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -772,7 +715,7 @@ medic_continue(edict_t *self)
}
}
static mframe_t medic_frames_attackBlaster[] = {
mframe_t medic_frames_attackBlaster[] = {
{ai_charge, 0, NULL},
{ai_charge, 5, NULL},
{ai_charge, 5, NULL},
@ -799,7 +742,7 @@ mmove_t medic_move_attackBlaster = {
void
medic_hook_launch(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -828,7 +771,7 @@ medic_cable_attack(edict_t *self)
vec3_t dir, angles;
float distance;
if (!self)
if (!self)
{
return;
}
@ -928,7 +871,7 @@ medic_cable_attack(edict_t *self)
void
medic_hook_retract(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -937,7 +880,7 @@ medic_hook_retract(edict_t *self)
self->enemy->monsterinfo.aiflags &= ~AI_RESURRECTING;
}
static mframe_t medic_frames_attackCable[] = {
mframe_t medic_frames_attackCable[] = {
{ai_move, 2, NULL},
{ai_move, 3, NULL},
{ai_move, 5, NULL},
@ -945,7 +888,7 @@ static mframe_t medic_frames_attackCable[] = {
{ai_charge, 4.7, NULL},
{ai_charge, 5, NULL},
{ai_charge, 6, NULL},
{ai_charge, 4, medic_footstep},
{ai_charge, 4, NULL},
{ai_charge, 0, NULL},
{ai_move, 0, medic_hook_launch},
{ai_move, 0, medic_cable_attack},
@ -959,7 +902,7 @@ static mframe_t medic_frames_attackCable[] = {
{ai_move, 0, medic_cable_attack},
{ai_move, -15, medic_hook_retract},
{ai_move, -1.5, NULL},
{ai_move, -1.2, medic_footstep},
{ai_move, -1.2, NULL},
{ai_move, -3, NULL},
{ai_move, -2, NULL},
{ai_move, 0.3, NULL},
@ -968,8 +911,7 @@ static mframe_t medic_frames_attackCable[] = {
{ai_move, 1.3, NULL}
};
mmove_t medic_move_attackCable =
{
mmove_t medic_move_attackCable = {
FRAME_attack33,
FRAME_attack60,
medic_frames_attackCable,
@ -979,7 +921,7 @@ mmove_t medic_move_attackCable =
void
medic_attack(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -997,7 +939,7 @@ medic_attack(edict_t *self)
qboolean
medic_checkattack(edict_t *self)
{
if (!self)
if (!self)
{
return false;
}
@ -1017,7 +959,7 @@ medic_checkattack(edict_t *self)
void
SP_monster_medic(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -1028,11 +970,6 @@ SP_monster_medic(edict_t *self)
return;
}
// Force recaching at next footstep to ensure
// that the sound indices are correct.
sound_step = 0;
sound_step2 = 0;
sound_idle1 = gi.soundindex("medic/idle.wav");
sound_pain1 = gi.soundindex("medic/medpain1.wav");
sound_pain2 = gi.soundindex("medic/medpain2.wav");

View file

@ -83,7 +83,7 @@ mutant_swing(edict_t *self)
gi.sound(self, CHAN_VOICE, sound_swing, 1, ATTN_NORM, 0);
}
static mframe_t mutant_frames_stand[] = {
mframe_t mutant_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -174,7 +174,7 @@ mutant_idle_loop(edict_t *self)
}
}
static mframe_t mutant_frames_idle[] = {
mframe_t mutant_frames_idle[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -209,7 +209,7 @@ mutant_idle(edict_t *self)
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
static mframe_t mutant_frames_walk[] = {
mframe_t mutant_frames_walk[] = {
{ai_walk, 3, NULL},
{ai_walk, 1, NULL},
{ai_walk, 5, NULL},
@ -242,7 +242,7 @@ mutant_walk_loop(edict_t *self)
self->monsterinfo.currentmove = &mutant_move_walk;
}
static mframe_t mutant_frames_start_walk[] = {
mframe_t mutant_frames_start_walk[] = {
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, -2, NULL},
@ -267,7 +267,7 @@ mutant_walk(edict_t *self)
self->monsterinfo.currentmove = &mutant_move_start_walk;
}
static mframe_t mutant_frames_run[] = {
mframe_t mutant_frames_run[] = {
{ai_run, 40, NULL},
{ai_run, 40, mutant_step},
{ai_run, 24, NULL},
@ -364,7 +364,7 @@ mutant_check_refire(edict_t *self)
}
}
static mframe_t mutant_frames_attack[] = {
mframe_t mutant_frames_attack[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, mutant_hit_left},
@ -484,7 +484,7 @@ mutant_check_landing(edict_t *self)
}
}
static mframe_t mutant_frames_jump[] = {
mframe_t mutant_frames_jump[] = {
{ai_charge, 0, NULL},
{ai_charge, 17, NULL},
{ai_charge, 15, mutant_jump_takeoff},
@ -599,7 +599,7 @@ mutant_checkattack(edict_t *self)
return false;
}
static mframe_t mutant_frames_pain1[] = {
mframe_t mutant_frames_pain1[] = {
{ai_move, 4, NULL},
{ai_move, -3, NULL},
{ai_move, -8, NULL},
@ -614,7 +614,7 @@ mmove_t mutant_move_pain1 = {
mutant_run
};
static mframe_t mutant_frames_pain2[] = {
mframe_t mutant_frames_pain2[] = {
{ai_move, -24, NULL},
{ai_move, 11, NULL},
{ai_move, 5, NULL},
@ -630,7 +630,7 @@ mmove_t mutant_move_pain2 = {
mutant_run
};
static mframe_t mutant_frames_pain3[] = {
mframe_t mutant_frames_pain3[] = {
{ai_move, -22, NULL},
{ai_move, 3, NULL},
{ai_move, 3, NULL},
@ -715,7 +715,7 @@ mutant_dead(edict_t *self)
M_FlyCheck(self);
}
static mframe_t mutant_frames_death1[] = {
mframe_t mutant_frames_death1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -734,7 +734,7 @@ mmove_t mutant_move_death1 = {
mutant_dead
};
static mframe_t mutant_frames_death2[] = {
mframe_t mutant_frames_death2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},

View file

@ -1,23 +1,4 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
/* =======================================================================
*
* Parasite.
*
@ -51,7 +32,7 @@ void parasite_refidget(edict_t *self);
void
parasite_launch(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -62,7 +43,7 @@ parasite_launch(edict_t *self)
void
parasite_reel_in(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -73,7 +54,7 @@ parasite_reel_in(edict_t *self)
void
parasite_sight(edict_t *self, edict_t *other /* unused */)
{
if (!self)
if (!self)
{
return;
}
@ -84,7 +65,7 @@ parasite_sight(edict_t *self, edict_t *other /* unused */)
void
parasite_tap(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -92,19 +73,10 @@ parasite_tap(edict_t *self)
gi.sound(self, CHAN_WEAPON, sound_tap, 1, ATTN_IDLE, 0);
}
void
parasite_footstep(edict_t *self)
{
if (g_monsterfootsteps->value)
{
parasite_tap(self);
}
}
void
parasite_scratch(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -115,7 +87,7 @@ parasite_scratch(edict_t *self)
void
parasite_search(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -123,22 +95,21 @@ parasite_search(edict_t *self)
gi.sound(self, CHAN_WEAPON, sound_search, 1, ATTN_IDLE, 0);
}
static mframe_t parasite_frames_start_fidget[] = {
mframe_t parasite_frames_start_fidget[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL}
};
mmove_t parasite_move_start_fidget =
{
mmove_t parasite_move_start_fidget = {
FRAME_stand18,
FRAME_stand21,
FRAME_stand21,
parasite_frames_start_fidget,
parasite_do_fidget
};
static mframe_t parasite_frames_fidget[] = {
mframe_t parasite_frames_fidget[] = {
{ai_stand, 0, parasite_scratch},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -147,15 +118,14 @@ static mframe_t parasite_frames_fidget[] = {
{ai_stand, 0, NULL}
};
mmove_t parasite_move_fidget =
{
mmove_t parasite_move_fidget = {
FRAME_stand22,
FRAME_stand27,
parasite_frames_fidget,
parasite_refidget
};
static mframe_t parasite_frames_end_fidget[] = {
mframe_t parasite_frames_end_fidget[] = {
{ai_stand, 0, parasite_scratch},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -166,8 +136,7 @@ static mframe_t parasite_frames_end_fidget[] = {
{ai_stand, 0, NULL}
};
mmove_t parasite_move_end_fidget =
{
mmove_t parasite_move_end_fidget = {
FRAME_stand28,
FRAME_stand35,
parasite_frames_end_fidget,
@ -177,7 +146,7 @@ mmove_t parasite_move_end_fidget =
void
parasite_end_fidget(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -188,7 +157,7 @@ parasite_end_fidget(edict_t *self)
void
parasite_do_fidget(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -199,7 +168,7 @@ parasite_do_fidget(edict_t *self)
void
parasite_refidget(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -217,7 +186,7 @@ parasite_refidget(edict_t *self)
void
parasite_idle(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -225,7 +194,7 @@ parasite_idle(edict_t *self)
self->monsterinfo.currentmove = &parasite_move_start_fidget;
}
static mframe_t parasite_frames_stand[] = {
mframe_t parasite_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, parasite_tap},
@ -245,10 +214,9 @@ static mframe_t parasite_frames_stand[] = {
{ai_stand, 0, parasite_tap}
};
mmove_t parasite_move_stand =
{
mmove_t parasite_move_stand = {
FRAME_stand01,
FRAME_stand17,
FRAME_stand17,
parasite_frames_stand,
parasite_stand
};
@ -256,7 +224,7 @@ mmove_t parasite_move_stand =
void
parasite_stand(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -264,58 +232,55 @@ parasite_stand(edict_t *self)
self->monsterinfo.currentmove = &parasite_move_stand;
}
static mframe_t parasite_frames_run[] = {
mframe_t parasite_frames_run[] = {
{ai_run, 30, NULL},
{ai_run, 30, NULL},
{ai_run, 22, parasite_footstep},
{ai_run, 19, parasite_footstep},
{ai_run, 22, NULL},
{ai_run, 19, NULL},
{ai_run, 24, NULL},
{ai_run, 28, parasite_footstep},
{ai_run, 28, NULL},
{ai_run, 25, NULL}
};
mmove_t parasite_move_run =
{
mmove_t parasite_move_run = {
FRAME_run03,
FRAME_run09,
parasite_frames_run,
NULL
FRAME_run09,
parasite_frames_run,
NULL
};
static mframe_t parasite_frames_start_run[] = {
mframe_t parasite_frames_start_run[] = {
{ai_run, 0, NULL},
{ai_run, 30, NULL},
};
mmove_t parasite_move_start_run =
{
mmove_t parasite_move_start_run = {
FRAME_run01,
FRAME_run02,
FRAME_run02,
parasite_frames_start_run,
parasite_run
};
static mframe_t parasite_frames_stop_run[] = {
mframe_t parasite_frames_stop_run[] = {
{ai_run, 20, NULL},
{ai_run, 20, NULL},
{ai_run, 12, parasite_footstep},
{ai_run, 12, NULL},
{ai_run, 10, NULL},
{ai_run, 0, NULL},
{ai_run, 0, NULL}
};
mmove_t parasite_move_stop_run =
{
mmove_t parasite_move_stop_run = {
FRAME_run10,
FRAME_run15,
parasite_frames_stop_run,
NULL
FRAME_run15,
parasite_frames_stop_run,
NULL
};
void
parasite_start_run(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -333,7 +298,7 @@ parasite_start_run(edict_t *self)
void
parasite_run(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -348,48 +313,45 @@ parasite_run(edict_t *self)
}
}
static mframe_t parasite_frames_walk[] = {
mframe_t parasite_frames_walk[] = {
{ai_walk, 30, NULL},
{ai_walk, 30, NULL},
{ai_walk, 22, parasite_footstep},
{ai_walk, 22, NULL},
{ai_walk, 19, NULL},
{ai_walk, 24, parasite_footstep},
{ai_walk, 28, parasite_footstep},
{ai_walk, 24, NULL},
{ai_walk, 28, NULL},
{ai_walk, 25, NULL}
};
mmove_t parasite_move_walk =
{
mmove_t parasite_move_walk = {
FRAME_run03,
FRAME_run09,
parasite_frames_walk,
parasite_walk
FRAME_run09,
parasite_frames_walk,
parasite_walk
};
static mframe_t parasite_frames_start_walk[] = {
mframe_t parasite_frames_start_walk[] = {
{ai_walk, 0, NULL},
{ai_walk, 30, parasite_walk}
};
mmove_t parasite_move_start_walk =
{
mmove_t parasite_move_start_walk = {
FRAME_run01,
FRAME_run02,
FRAME_run02,
parasite_frames_start_walk,
NULL
};
static mframe_t parasite_frames_stop_walk[] = {
mframe_t parasite_frames_stop_walk[] = {
{ai_walk, 20, NULL},
{ai_walk, 20, NULL},
{ai_walk, 12, parasite_footstep},
{ai_walk, 12, NULL},
{ai_walk, 10, NULL},
{ai_walk, 0, NULL},
{ai_walk, 0, NULL}
};
mmove_t parasite_move_stop_walk =
{
mmove_t parasite_move_stop_walk = {
FRAME_run10,
FRAME_run15,
parasite_frames_stop_walk,
@ -399,7 +361,7 @@ mmove_t parasite_move_stop_walk =
void
parasite_start_walk(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -410,7 +372,7 @@ parasite_start_walk(edict_t *self)
void
parasite_walk(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -418,7 +380,7 @@ parasite_walk(edict_t *self)
self->monsterinfo.currentmove = &parasite_move_walk;
}
static mframe_t parasite_frames_pain1[] = {
mframe_t parasite_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -432,10 +394,9 @@ static mframe_t parasite_frames_pain1[] = {
{ai_move, 0, NULL}
};
mmove_t parasite_move_pain1 =
{
mmove_t parasite_move_pain1 = {
FRAME_pain101,
FRAME_pain111,
FRAME_pain111,
parasite_frames_pain1,
parasite_start_run
};
@ -444,7 +405,7 @@ void
parasite_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage /* unused */)
{
if (!self)
if (!self)
{
return;
}
@ -514,7 +475,7 @@ parasite_drain_attack(edict_t *self)
trace_t tr;
int damage;
if (!self)
if (!self)
{
return;
}
@ -576,7 +537,7 @@ parasite_drain_attack(edict_t *self)
damage, 0, DAMAGE_NO_KNOCKBACK, MOD_UNKNOWN);
}
static mframe_t parasite_frames_drain[] = {
mframe_t parasite_frames_drain[] = {
{ai_charge, 0, parasite_launch},
{ai_charge, 0, NULL},
{ai_charge, 15, parasite_drain_attack}, /* Target hits */
@ -597,15 +558,14 @@ static mframe_t parasite_frames_drain[] = {
{ai_charge, 0, NULL}
};
mmove_t parasite_move_drain =
{
mmove_t parasite_move_drain = {
FRAME_drain01,
FRAME_drain18,
parasite_frames_drain,
parasite_start_run
};
static mframe_t parasite_frames_break[] = {
mframe_t parasite_frames_break[] = {
{ai_charge, 0, NULL},
{ai_charge, -3, NULL},
{ai_charge, 1, NULL},
@ -640,18 +600,18 @@ static mframe_t parasite_frames_break[] = {
{ai_charge, 1, NULL}
};
mmove_t parasite_move_break =
{
mmove_t parasite_move_break = {
FRAME_break01,
FRAME_break32,
parasite_frames_break,
FRAME_break32,
parasite_frames_break,
parasite_start_run
};
void
parasite_attack(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -662,7 +622,7 @@ parasite_attack(edict_t *self)
void
parasite_dead(edict_t *self)
{
if (!self)
if (!self)
{
return;
}
@ -675,7 +635,7 @@ parasite_dead(edict_t *self)
gi.linkentity(self);
}
static mframe_t parasite_frames_death[] = {
mframe_t parasite_frames_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -685,8 +645,7 @@ static mframe_t parasite_frames_death[] = {
{ai_move, 0, NULL}
};
mmove_t parasite_move_death =
{
mmove_t parasite_move_death = {
FRAME_death101,
FRAME_death107,
parasite_frames_death,
@ -712,18 +671,15 @@ parasite_die(edict_t *self, edict_t *inflictor /* unused */,
for (n = 0; n < 2; n++)
{
ThrowGib(self, "models/objects/gibs/bone/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
}
for (n = 0; n < 4; n++)
{
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2",
damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
}
ThrowHead(self, "models/objects/gibs/head2/tris.md2",
damage, GIB_ORGANIC);
ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
@ -746,7 +702,7 @@ parasite_die(edict_t *self, edict_t *inflictor /* unused */,
void
SP_monster_parasite(edict_t *self)
{
if (!self)
if (!self)
{
return;
}

File diff suppressed because it is too large Load diff

View file

@ -53,7 +53,7 @@ supertank_search(edict_t *self)
}
}
static mframe_t supertank_frames_stand[] = {
mframe_t supertank_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -134,7 +134,7 @@ supertank_stand(edict_t *self)
self->monsterinfo.currentmove = &supertank_move_stand;
}
static mframe_t supertank_frames_run[] = {
mframe_t supertank_frames_run[] = {
{ai_run, 12, TreadSound},
{ai_run, 12, NULL},
{ai_run, 12, NULL},
@ -162,7 +162,7 @@ mmove_t supertank_move_run = {
NULL
};
static mframe_t supertank_frames_forward[] = {
mframe_t supertank_frames_forward[] = {
{ai_walk, 4, TreadSound},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
@ -230,7 +230,7 @@ supertank_run(edict_t *self)
}
}
static mframe_t supertank_frames_turn_right[] = {
mframe_t supertank_frames_turn_right[] = {
{ai_move, 0, TreadSound},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -258,7 +258,7 @@ mmove_t supertank_move_turn_right = {
supertank_run
};
static mframe_t supertank_frames_turn_left[] = {
mframe_t supertank_frames_turn_left[] = {
{ai_move, 0, TreadSound},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -286,7 +286,7 @@ mmove_t supertank_move_turn_left = {
supertank_run
};
static mframe_t supertank_frames_pain3[] = {
mframe_t supertank_frames_pain3[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -300,7 +300,7 @@ mmove_t supertank_move_pain3 = {
supertank_run
};
static mframe_t supertank_frames_pain2[] = {
mframe_t supertank_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -314,7 +314,7 @@ mmove_t supertank_move_pain2 = {
supertank_run
};
static mframe_t supertank_frames_pain1[] = {
mframe_t supertank_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -328,7 +328,7 @@ mmove_t supertank_move_pain1 = {
supertank_run
};
static mframe_t supertank_frames_death1[] = {
mframe_t supertank_frames_death1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -362,7 +362,7 @@ mmove_t supertank_move_death = {
supertank_dead
};
static mframe_t supertank_frames_backward[] = {
mframe_t supertank_frames_backward[] = {
{ai_walk, 0, TreadSound},
{ai_walk, 0, NULL},
{ai_walk, 0, NULL},
@ -390,7 +390,7 @@ mmove_t supertank_move_backward = {
NULL
};
static mframe_t supertank_frames_attack4[] = {
mframe_t supertank_frames_attack4[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -406,7 +406,7 @@ mmove_t supertank_move_attack4 = {
supertank_run
};
static mframe_t supertank_frames_attack3[] = {
mframe_t supertank_frames_attack3[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -443,7 +443,7 @@ mmove_t supertank_move_attack3 = {
supertank_run
};
static mframe_t supertank_frames_attack2[] = {
mframe_t supertank_frames_attack2[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -480,7 +480,7 @@ mmove_t supertank_move_attack2 = {
supertank_run
};
static mframe_t supertank_frames_attack1[] = {
mframe_t supertank_frames_attack1[] = {
{ai_charge, 0, supertankMachineGun},
{ai_charge, 0, supertankMachineGun},
{ai_charge, 0, supertankMachineGun},
@ -496,7 +496,7 @@ mmove_t supertank_move_attack1 = {
supertank_reattack1
};
static mframe_t supertank_frames_end_attack1[] = {
mframe_t supertank_frames_end_attack1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},

View file

@ -78,7 +78,7 @@ tank_idle(edict_t *self)
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
static mframe_t tank_frames_stand[] = {
mframe_t tank_frames_stand[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
@ -129,7 +129,7 @@ tank_stand(edict_t *self)
self->monsterinfo.currentmove = &tank_move_stand;
}
static mframe_t tank_frames_start_walk[] = {
mframe_t tank_frames_start_walk[] = {
{ai_walk, 0, NULL},
{ai_walk, 6, NULL},
{ai_walk, 6, NULL},
@ -143,7 +143,7 @@ mmove_t tank_move_start_walk = {
tank_walk
};
static mframe_t tank_frames_walk[] = {
mframe_t tank_frames_walk[] = {
{ai_walk, 4, NULL},
{ai_walk, 5, NULL},
{ai_walk, 3, NULL},
@ -169,7 +169,7 @@ mmove_t tank_move_walk = {
NULL
};
static mframe_t tank_frames_stop_walk[] = {
mframe_t tank_frames_stop_walk[] = {
{ai_walk, 3, NULL},
{ai_walk, 3, NULL},
{ai_walk, 2, NULL},
@ -195,7 +195,7 @@ tank_walk(edict_t *self)
self->monsterinfo.currentmove = &tank_move_walk;
}
static mframe_t tank_frames_start_run[] = {
mframe_t tank_frames_start_run[] = {
{ai_run, 0, NULL},
{ai_run, 6, NULL},
{ai_run, 6, NULL},
@ -209,7 +209,7 @@ mmove_t tank_move_start_run = {
tank_run
};
static mframe_t tank_frames_run[] = {
mframe_t tank_frames_run[] = {
{ai_run, 4, NULL},
{ai_run, 5, NULL},
{ai_run, 3, NULL},
@ -235,7 +235,7 @@ mmove_t tank_move_run = {
NULL
};
static mframe_t tank_frames_stop_run[] = {
mframe_t tank_frames_stop_run[] = {
{ai_run, 3, NULL},
{ai_run, 3, NULL},
{ai_run, 2, NULL},
@ -284,7 +284,7 @@ tank_run(edict_t *self)
}
}
static mframe_t tank_frames_pain1[] = {
mframe_t tank_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -298,7 +298,7 @@ mmove_t tank_move_pain1 = {
tank_run
};
static mframe_t tank_frames_pain2[] = {
mframe_t tank_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -313,7 +313,7 @@ mmove_t tank_move_pain2 = {
tank_run
};
static mframe_t tank_frames_pain3[] = {
mframe_t tank_frames_pain3[] = {
{ai_move, -7, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
@ -547,7 +547,7 @@ TankMachineGun(edict_t *self)
DEFAULT_BULLET_VSPREAD, flash_number);
}
static mframe_t tank_frames_attack_blast[] = {
mframe_t tank_frames_attack_blast[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -573,7 +573,7 @@ mmove_t tank_move_attack_blast = {
tank_reattack_blaster
};
static mframe_t tank_frames_reattack_blast[] = {
mframe_t tank_frames_reattack_blast[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, TankBlaster},
@ -589,7 +589,7 @@ mmove_t tank_move_reattack_blast = {
tank_reattack_blaster
};
static mframe_t tank_frames_attack_post_blast[] = {
mframe_t tank_frames_attack_post_blast[] = {
{ai_move, 0, NULL}, /* 17 */
{ai_move, 0, NULL},
{ai_move, 2, NULL},
@ -638,7 +638,7 @@ tank_poststrike(edict_t *self)
tank_run(self);
}
static mframe_t tank_frames_attack_strike[] = {
mframe_t tank_frames_attack_strike[] = {
{ai_move, 3, NULL},
{ai_move, 2, NULL},
{ai_move, 2, NULL},
@ -686,7 +686,7 @@ mmove_t tank_move_attack_strike = {
tank_poststrike
};
static mframe_t tank_frames_attack_pre_rocket[] = {
mframe_t tank_frames_attack_pre_rocket[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -719,7 +719,7 @@ mmove_t tank_move_attack_pre_rocket = {
tank_doattack_rocket
};
static mframe_t tank_frames_attack_fire_rocket[] = {
mframe_t tank_frames_attack_fire_rocket[] = {
{ai_charge, -3, NULL}, /* Loop Start 22 */
{ai_charge, 0, NULL},
{ai_charge, 0, TankRocket}, /* 24 */
@ -738,7 +738,7 @@ mmove_t tank_move_attack_fire_rocket = {
tank_refire_rocket
};
static mframe_t tank_frames_attack_post_rocket[] = {
mframe_t tank_frames_attack_post_rocket[] = {
{ai_charge, 0, NULL}, /* 31 */
{ai_charge, -1, NULL},
{ai_charge, -1, NULL},
@ -773,7 +773,7 @@ mmove_t tank_move_attack_post_rocket = {
tank_run
};
static mframe_t tank_frames_attack_chain[] = {
mframe_t tank_frames_attack_chain[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
@ -930,7 +930,7 @@ tank_dead(edict_t *self)
gi.linkentity(self);
}
static mframe_t tank_frames_death1[] = {
mframe_t tank_frames_death1[] = {
{ai_move, -7, NULL},
{ai_move, -2, NULL},
{ai_move, -2, NULL},

View file

@ -383,7 +383,7 @@ G_SetStats(edict_t *ent)
/* health */
ent->client->ps.stats[STAT_HEALTH_ICON] = level.pic_health;
ent->client->ps.stats[STAT_HEALTH] = (ent->health < -99) ? -99 : ent->health;
ent->client->ps.stats[STAT_HEALTH] = ent->health;
/* ammo */
if (!ent->client->ammo_index)

View file

@ -7,7 +7,6 @@
#include "../header/local.h"
#include "../monster/misc/player.h"
#include <limits.h>
#define PLAYER_NOISE_SELF 0
#define PLAYER_NOISE_IMPACT 1
@ -494,31 +493,6 @@ Think_Weapon(edict_t *ent)
}
}
/*
* Client (player) animation for changing weapon
*/
static void
Change_Weap_Animation(edict_t *ent)
{
if (!ent)
{
return;
}
ent->client->anim_priority = ANIM_REVERSE;
if (ent->client->ps.pmove.pm_flags & PMF_DUCKED)
{
ent->s.frame = FRAME_crpain4 + 1;
ent->client->anim_end = FRAME_crpain1;
}
else
{
ent->s.frame = FRAME_pain304 + 1;
ent->client->anim_end = FRAME_pain301;
}
}
/*
* Make the weapon ready if there is ammo
*/
@ -686,9 +660,6 @@ Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST,
int *fire_frames, void (*fire)(edict_t *ent))
{
int n;
const unsigned short int change_speed = (g_swap_speed->value > 1)?
(g_swap_speed->value < USHRT_MAX)? (unsigned short int)g_swap_speed->value : 1
: 1;
if (!ent || !fire_frames || !fire)
{
@ -702,36 +673,41 @@ Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST,
if (ent->client->weaponstate == WEAPON_DROPPING)
{
if (ent->client->ps.gunframe >= FRAME_DEACTIVATE_LAST - change_speed + 1)
if (ent->client->ps.gunframe == FRAME_DEACTIVATE_LAST)
{
ChangeWeapon(ent);
return;
}
else if ( (FRAME_DEACTIVATE_LAST - FRAME_DEACTIVATE_FIRST) >= (4 * change_speed) )
else if ((FRAME_DEACTIVATE_LAST - ent->client->ps.gunframe) == 4)
{
unsigned short int remainder = FRAME_DEACTIVATE_LAST - ent->client->ps.gunframe;
// "if (remainder == 4)" at change_speed == 1
if ( ( remainder <= (4 * change_speed) )
&& ( remainder > (3 * change_speed) ) )
ent->client->anim_priority = ANIM_REVERSE;
if (ent->client->ps.pmove.pm_flags & PMF_DUCKED)
{
Change_Weap_Animation(ent);
ent->s.frame = FRAME_crpain4 + 1;
ent->client->anim_end = FRAME_crpain1;
}
else
{
ent->s.frame = FRAME_pain304 + 1;
ent->client->anim_end = FRAME_pain301;
}
}
ent->client->ps.gunframe += change_speed;
ent->client->ps.gunframe++;
return;
}
if (ent->client->weaponstate == WEAPON_ACTIVATING)
{
if (ent->client->ps.gunframe >= FRAME_ACTIVATE_LAST - change_speed + 1)
if (ent->client->ps.gunframe == FRAME_ACTIVATE_LAST)
{
ent->client->weaponstate = WEAPON_READY;
ent->client->ps.gunframe = FRAME_IDLE_FIRST;
return;
}
ent->client->ps.gunframe += change_speed;
ent->client->ps.gunframe++;
return;
}
@ -740,9 +716,20 @@ Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST,
ent->client->weaponstate = WEAPON_DROPPING;
ent->client->ps.gunframe = FRAME_DEACTIVATE_FIRST;
if ( (FRAME_DEACTIVATE_LAST - FRAME_DEACTIVATE_FIRST) < (4 * change_speed) )
if ((FRAME_DEACTIVATE_LAST - FRAME_DEACTIVATE_FIRST) < 4)
{
Change_Weap_Animation(ent);
ent->client->anim_priority = ANIM_REVERSE;
if (ent->client->ps.pmove.pm_flags & PMF_DUCKED)
{
ent->s.frame = FRAME_crpain4 + 1;
ent->client->anim_end = FRAME_crpain1;
}
else
{
ent->s.frame = FRAME_pain304 + 1;
ent->client->anim_end = FRAME_pain301;
}
}
return;
@ -1798,9 +1785,9 @@ weapon_supershotgun_fire(edict_t *ent)
v[YAW] = ent->client->v_angle[YAW] - 5;
v[ROLL] = ent->client->v_angle[ROLL];
AngleVectors(v, forward, NULL, NULL);
if (aimfix->value)
{
{
AngleVectors(v, forward, right, NULL);
VectorScale(forward, -2, ent->client->kick_origin);
@ -1808,16 +1795,16 @@ weapon_supershotgun_fire(edict_t *ent)
VectorSet(offset, 0, 8, ent->viewheight - 8);
P_ProjectSource(ent, offset, forward, right, start);
}
}
fire_shotgun(ent, start, forward, damage, kick, DEFAULT_SHOTGUN_HSPREAD,
DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SSHOTGUN_COUNT / 2, MOD_SSHOTGUN);
v[YAW] = ent->client->v_angle[YAW] + 5;
AngleVectors(v, forward, NULL, NULL);
if (aimfix->value)
{
{
AngleVectors(v, forward, right, NULL);
VectorScale(forward, -2, ent->client->kick_origin);
@ -1825,8 +1812,8 @@ weapon_supershotgun_fire(edict_t *ent)
VectorSet(offset, 0, 8, ent->viewheight - 8);
P_ProjectSource(ent, offset, forward, right, start);
}
}
fire_shotgun(ent, start, forward, damage, kick, DEFAULT_SHOTGUN_HSPREAD,
DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SSHOTGUN_COUNT / 2, MOD_SSHOTGUN);
@ -2172,17 +2159,6 @@ weapon_phalanx_fire(edict_t *ent)
v[ROLL] = ent->client->v_angle[ROLL];
AngleVectors(v, forward, right, up);
if (aimfix->value)
{
AngleVectors(v, forward, right, NULL);
VectorScale(forward, -2, ent->client->kick_origin);
ent->client->kick_angles[0] = -2;
VectorSet(offset, 0, 8, ent->viewheight - 8);
P_ProjectSource(ent, offset, forward, right, start);
}
radius_damage = 30;
damage_radius = 120;
@ -2200,18 +2176,6 @@ weapon_phalanx_fire(edict_t *ent)
v[YAW] = ent->client->v_angle[YAW] + 1.5;
v[ROLL] = ent->client->v_angle[ROLL];
AngleVectors(v, forward, right, up);
if (aimfix->value)
{
AngleVectors(v, forward, right, NULL);
VectorScale(forward, -2, ent->client->kick_origin);
ent->client->kick_angles[0] = -2;
VectorSet(offset, 0, 8, ent->viewheight - 8);
P_ProjectSource(ent, offset, forward, right, start);
}
fire_plasma(ent, start, forward, damage, 725,
damage_radius, radius_damage);

View file

@ -47,15 +47,12 @@
#include "../header/local.h"
/*
* When ever the savegame version is changed, q2 will refuse to
* load older savegames. This should be bumped if the files
* in tables/ are changed, otherwise strange things may happen.
*/
#define SAVEGAMEVER "YQ2-5"
* When ever the savegame version is changed, q2 will refuse to
* load older savegames. This should be bumped if the files
* in tables/ are changed, otherwise strange things may happen.
*/
#define SAVEGAMEVER "YQ2-4"
#ifndef BUILD_DATE
#define BUILD_DATE __DATE__
#endif
/*
* This macros are used to prohibit loading of savegames
@ -145,12 +142,12 @@ typedef struct
* to each of the functions
* prototyped above.
*/
static functionList_t functionList[] = {
functionList_t functionList[] = {
#include "tables/gamefunc_list.h"
};
/*
* Prototypes for forward
* Prtotypes for forward
* declaration for all game
* mmove_t functions.
*/
@ -162,12 +159,12 @@ static functionList_t functionList[] = {
* functions prototyped
* above.
*/
static mmoveList_t mmoveList[] = {
mmoveList_t mmoveList[] = {
#include "tables/gamemmove_list.h"
};
/*
* Fields to be saved (used in g_spawn.c)
* Fields to be saved
*/
field_t fields[] = {
#include "tables/fields.h"
@ -177,7 +174,7 @@ field_t fields[] = {
* Level fields to
* be saved
*/
static field_t levelfields[] = {
field_t levelfields[] = {
#include "tables/levelfields.h"
};
@ -185,7 +182,7 @@ static field_t levelfields[] = {
* Client fields to
* be saved
*/
static field_t clientfields[] = {
field_t clientfields[] = {
#include "tables/clientfields.h"
};
@ -200,7 +197,7 @@ void
InitGame(void)
{
gi.dprintf("Game is starting up.\n");
gi.dprintf("Game is %s built on %s.\n", GAMEVERSION, BUILD_DATE);
gi.dprintf("Game is %s built on %s.\n", GAMEVERSION, __DATE__);
gun_x = gi.cvar ("gun_x", "0", 0);
gun_y = gi.cvar ("gun_y", "0", 0);
@ -216,7 +213,7 @@ InitGame(void)
/* latched vars */
sv_cheats = gi.cvar ("cheats", "0", CVAR_SERVERINFO|CVAR_LATCH);
gi.cvar ("gamename", GAMEVERSION , CVAR_SERVERINFO | CVAR_LATCH);
gi.cvar ("gamedate", BUILD_DATE, CVAR_SERVERINFO | CVAR_LATCH);
gi.cvar ("gamedate", __DATE__ , CVAR_SERVERINFO | CVAR_LATCH);
maxclients = gi.cvar ("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH);
maxspectators = gi.cvar ("maxspectators", "4", CVAR_SERVERINFO);
deathmatch = gi.cvar ("deathmatch", "0", CVAR_LATCH);
@ -226,7 +223,6 @@ InitGame(void)
skill = gi.cvar ("skill", "1", CVAR_LATCH);
maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH);
g_footsteps = gi.cvar ("g_footsteps", "1", CVAR_ARCHIVE);
g_monsterfootsteps = gi.cvar("g_monsterfootsteps", "0", CVAR_ARCHIVE);
g_fix_triggered = gi.cvar ("g_fix_triggered", "0", 0);
/* change anytime vars */
@ -255,8 +251,6 @@ InitGame(void)
/* others */
aimfix = gi.cvar("aimfix", "0", CVAR_ARCHIVE);
g_machinegun_norecoil = gi.cvar("g_machinegun_norecoil", "0", CVAR_ARCHIVE);
g_quick_weap = gi.cvar("g_quick_weap", "1", CVAR_ARCHIVE);
g_swap_speed = gi.cvar("g_swap_speed", "1", CVAR_ARCHIVE);
/* items */
InitItems ();
@ -841,7 +835,6 @@ ReadGame(const char *filename)
{"YQ2-2", 2},
{"YQ2-3", 3},
{"YQ2-4", 4},
{"YQ2-5", 5},
};
for (i=0; i < sizeof(version_mappings)/sizeof(version_mappings[0]); ++i)
@ -852,7 +845,7 @@ ReadGame(const char *filename)
break;
}
}
if (save_ver == 0) // not found in mappings table
{
fclose(f);
@ -962,7 +955,7 @@ WriteEdict(FILE *f, edict_t *ent)
}
/*
* Helper function to write the
* Helper fcuntion to write the
* level local data into a file.
* Called by WriteLevel.
*/
@ -1078,10 +1071,10 @@ ReadLevelLocals(FILE *f)
/*
* Reads a level back into the memory.
* SpawnEntities were already called
* SpawnEntities were allready called
* in the same way when the level was
* saved. All world links were cleared
* before this function was called. When
* befor this function was called. When
* this function is called, no clients
* are connected to the server.
*/
@ -1177,3 +1170,4 @@ ReadLevel(const char *filename)
}
}
}

View file

@ -1,23 +1,4 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (C) 2011 Yamagi Burmeister
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* Prototypes for every function in the game.so.
@ -282,7 +263,6 @@ extern void SP_monster_soldier_ss ( edict_t * self ) ;
extern void SP_monster_soldier ( edict_t * self ) ;
extern void SP_monster_soldier_light ( edict_t * self ) ;
extern void SP_monster_soldier_x ( edict_t * self ) ;
extern void soldier_footstep( edict_t *self ) ;
extern void soldier_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
extern void soldier_dead ( edict_t * self ) ;
extern void soldier_fire7 ( edict_t * self ) ;
@ -369,7 +349,6 @@ extern void M_ChangeYaw ( edict_t * ent ) ;
extern qboolean SV_movestep ( edict_t * ent , vec3_t move , qboolean relink ) ;
extern qboolean M_CheckBottom ( edict_t * ent ) ;
extern void SP_monster_medic ( edict_t * self ) ;
extern void medic_footstep( edict_t *self ) ;
extern qboolean medic_checkattack ( edict_t * self ) ;
extern void medic_attack ( edict_t * self ) ;
extern void medic_hook_retract ( edict_t * self ) ;
@ -392,7 +371,6 @@ extern void medic_search ( edict_t * self ) ;
extern void medic_idle ( edict_t * self ) ;
extern edict_t * medic_FindDeadMonster ( edict_t * self ) ;
extern void SP_misc_insane ( edict_t * self ) ;
extern void insane_footstep( edict_t *self ) ;
extern void insane_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
extern void insane_dead ( edict_t * self ) ;
extern void insane_stand ( edict_t * self ) ;
@ -408,7 +386,6 @@ extern void insane_moan ( edict_t * self ) ;
extern void insane_shake ( edict_t * self ) ;
extern void insane_fist ( edict_t * self ) ;
extern void SP_monster_infantry ( edict_t * self ) ;
extern void infantry_footstep( edict_t *self ) ;
extern void infantry_attack ( edict_t * self ) ;
extern void infantry_smack ( edict_t * self ) ;
extern void infantry_swing ( edict_t * self ) ;
@ -443,7 +420,6 @@ extern void hover_reattack ( edict_t * self ) ;
extern void hover_search ( edict_t * self ) ;
extern void hover_sight ( edict_t * self , edict_t * other ) ;
extern void SP_monster_gunner ( edict_t * self ) ;
extern void gunner_footstep( edict_t *self ) ;
extern void gunner_refire_chain ( edict_t * self ) ;
extern void gunner_fire_chain ( edict_t * self ) ;
extern void gunner_attack ( edict_t * self ) ;
@ -466,7 +442,6 @@ extern void gunner_search ( edict_t * self ) ;
extern void gunner_sight ( edict_t * self , edict_t * other ) ;
extern void gunner_idlesound ( edict_t * self ) ;
extern void SP_monster_gladiator ( edict_t * self ) ;
extern void gladiator_footstep( edict_t *self ) ;
extern void gladiator_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
extern void gladiator_dead ( edict_t * self ) ;
extern void gladiator_pain ( edict_t * self , edict_t * other , float kick , int damage ) ;
@ -625,7 +600,6 @@ extern edict_t * fixbot_FindDeadMonster ( edict_t * self ) ;
extern float crand ( void ) ;
extern void SP_monster_chick_heat ( edict_t * self ) ;
extern void SP_monster_chick ( edict_t * self ) ;
extern void chick_footstep( edict_t *self ) ;
extern void chick_sight ( edict_t * self , edict_t * other ) ;
extern void chick_attack ( edict_t * self ) ;
extern void chick_melee ( edict_t * self ) ;
@ -650,7 +624,6 @@ extern void chick_stand ( edict_t * self ) ;
extern void chick_fidget ( edict_t * self ) ;
extern void ChickMoan ( edict_t * self ) ;
extern void SP_monster_brain ( edict_t * self ) ;
extern void brain_footstep( edict_t *self ) ;
extern void brain_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
extern void brain_dead ( edict_t * self ) ;
extern void brain_pain ( edict_t * self , edict_t * other , float kick , int damage ) ;
@ -698,7 +671,6 @@ extern void SP_monster_makron ( edict_t * self ) ;
extern void MakronPrecache ( void ) ;
extern qboolean Makron_CheckAttack ( edict_t * self ) ;
extern void makron_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
extern void makron_torso_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
extern void makron_dead ( edict_t * self ) ;
extern void makron_torso ( edict_t * ent ) ;
extern void makron_torso_think ( edict_t * self ) ;
@ -759,7 +731,6 @@ extern void boss2_firebullet_right ( edict_t * self ) ;
extern void Boss2Rocket ( edict_t * self ) ;
extern void boss2_search ( edict_t * self ) ;
extern void SP_monster_berserk ( edict_t * self ) ;
extern void berserk_footstep( edict_t *self ) ;
extern void berserk_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
extern void berserk_dead ( edict_t * self ) ;
extern void berserk_pain ( edict_t * self , edict_t * other , float kick , int damage ) ;
@ -897,7 +868,6 @@ extern void SP_target_secret ( edict_t * ent ) ;
extern void use_target_secret ( edict_t * ent , edict_t * other , edict_t * activator ) ;
extern void SP_target_help ( edict_t * ent ) ;
extern void Use_Target_Help ( edict_t * ent , edict_t * other , edict_t * activator ) ;
extern void Target_Help_Think ( edict_t * ent ) ;
extern void SP_target_speaker ( edict_t * ent ) ;
extern void Use_Target_Speaker ( edict_t * ent , edict_t * other , edict_t * activator ) ;
extern void SP_target_temp_entity ( edict_t * ent ) ;

View file

@ -1,23 +1,4 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (C) 2011 Yamagi Burmeister
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* Functionpointers to every function in the game.so.
@ -282,7 +263,6 @@
{"SP_monster_soldier", (byte *)SP_monster_soldier},
{"SP_monster_soldier_light", (byte *)SP_monster_soldier_light},
{"SP_monster_soldier_x", (byte *)SP_monster_soldier_x},
{"soldier_footstep", (byte *)soldier_footstep},
{"soldier_die", (byte *)soldier_die},
{"soldier_dead", (byte *)soldier_dead},
{"soldier_fire7", (byte *)soldier_fire7},
@ -369,7 +349,6 @@
{"SV_movestep", (byte *)SV_movestep},
{"M_CheckBottom", (byte *)M_CheckBottom},
{"SP_monster_medic", (byte *)SP_monster_medic},
{"medic_footstep", (byte *)medic_footstep},
{"medic_checkattack", (byte *)medic_checkattack},
{"medic_attack", (byte *)medic_attack},
{"medic_hook_retract", (byte *)medic_hook_retract},
@ -392,7 +371,6 @@
{"medic_idle", (byte *)medic_idle},
{"medic_FindDeadMonster", (byte *)medic_FindDeadMonster},
{"SP_misc_insane", (byte *)SP_misc_insane},
{"insane_footstep", (byte *)insane_footstep},
{"insane_die", (byte *)insane_die},
{"insane_dead", (byte *)insane_dead},
{"insane_stand", (byte *)insane_stand},
@ -408,7 +386,6 @@
{"insane_shake", (byte *)insane_shake},
{"insane_fist", (byte *)insane_fist},
{"SP_monster_infantry", (byte *)SP_monster_infantry},
{"infantry_footstep", (byte *)infantry_footstep},
{"infantry_attack", (byte *)infantry_attack},
{"infantry_smack", (byte *)infantry_smack},
{"infantry_swing", (byte *)infantry_swing},
@ -443,7 +420,6 @@
{"hover_search", (byte *)hover_search},
{"hover_sight", (byte *)hover_sight},
{"SP_monster_gunner", (byte *)SP_monster_gunner},
{"gunner_footstep", (byte *)gunner_footstep},
{"gunner_refire_chain", (byte *)gunner_refire_chain},
{"gunner_fire_chain", (byte *)gunner_fire_chain},
{"gunner_attack", (byte *)gunner_attack},
@ -466,7 +442,6 @@
{"gunner_sight", (byte *)gunner_sight},
{"gunner_idlesound", (byte *)gunner_idlesound},
{"SP_monster_gladiator", (byte *)SP_monster_gladiator},
{"gladiator_footstep", (byte *)gladiator_footstep},
{"gladiator_die", (byte *)gladiator_die},
{"gladiator_dead", (byte *)gladiator_dead},
{"gladiator_pain", (byte *)gladiator_pain},
@ -625,7 +600,6 @@
{"crand", (byte *)crand},
{"SP_monster_chick_heat", (byte *)SP_monster_chick_heat},
{"SP_monster_chick", (byte *)SP_monster_chick},
{"chick_footstep", (byte *)chick_footstep},
{"chick_sight", (byte *)chick_sight},
{"chick_attack", (byte *)chick_attack},
{"chick_melee", (byte *)chick_melee},
@ -650,7 +624,6 @@
{"chick_fidget", (byte *)chick_fidget},
{"ChickMoan", (byte *)ChickMoan},
{"SP_monster_brain", (byte *)SP_monster_brain},
{"brain_footstep", (byte *)brain_footstep},
{"brain_die", (byte *)brain_die},
{"brain_dead", (byte *)brain_dead},
{"brain_pain", (byte *)brain_pain},
@ -698,7 +671,6 @@
{"MakronPrecache", (byte *)MakronPrecache},
{"Makron_CheckAttack", (byte *)Makron_CheckAttack},
{"makron_die", (byte *)makron_die},
{"makron_torso_die", (byte *)makron_torso_die},
{"makron_dead", (byte *)makron_dead},
{"makron_torso", (byte *)makron_torso},
{"makron_torso_think", (byte *)makron_torso_think},
@ -759,7 +731,6 @@
{"Boss2Rocket", (byte *)Boss2Rocket},
{"boss2_search", (byte *)boss2_search},
{"SP_monster_berserk", (byte *)SP_monster_berserk},
{"berserk_footstep", (byte *)berserk_footstep},
{"berserk_die", (byte *)berserk_die},
{"berserk_dead", (byte *)berserk_dead},
{"berserk_pain", (byte *)berserk_pain},
@ -897,7 +868,6 @@
{"use_target_secret", (byte *)use_target_secret},
{"SP_target_help", (byte *)SP_target_help},
{"Use_Target_Help", (byte *)Use_Target_Help},
{"Target_Help_Think", (byte *)Target_Help_Think},
{"SP_target_speaker", (byte *)SP_target_speaker},
{"Use_Target_Speaker", (byte *)Use_Target_Speaker},
{"SP_target_temp_entity", (byte *)SP_target_temp_entity},

View file

@ -503,9 +503,20 @@ VectorNormalize(vec3_t v)
vec_t
VectorNormalize2(vec3_t v, vec3_t out)
{
VectorCopy(v, out);
float length, ilength;
return VectorNormalize(out);
length = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
length = (float)sqrt(length);
if (length)
{
ilength = 1 / length;
out[0] = v[0] * ilength;
out[1] = v[1] * ilength;
out[2] = v[2] * ilength;
}
return length;
}
void