Initial revision

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2002-09-03 00:56:30 +00:00
parent 304056caed
commit 2f5b2c30f3
778 changed files with 114777 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
# This AUTHORS file is used as input for cvs2cl.
# Lines beginning with (whitespaces plus) # and lines that do not have
# colons in them are always ignored. Other lines are in the form
# name : expansion
# Quote marks stripped. Leading spaces not allowed.
# cvs2cl will detect if you have a realname,
# and will retain the username if not.
# Programming:
# Additional programming:
mudry: Mudrony László <mudronyl@dragon.klte.hu>
+340
View File
@@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
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.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<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
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
View File
+30
View File
@@ -0,0 +1,30 @@
If you modify the sources or get them from the CVS repository,
you may need the following programs in addition to those listed in INSTALL:
CVS - Concurrent Versions System
http://www.loria.fr/~molli/cvs-index.html
http://www.cvshome.org
Debian package: cvs
GNU Autoconf
http://www.gnu.org/software/autoconf/autoconf.html
Debian package: autoconf
GNU Automake - a Makefile generator
http://www.gnu.org/software/automake/
Debian package: automake
GNU Libtool - generic shared library support
http://www.gnu.org/software/libtool/
ftp://ftp.gnu.org/pub/gnu/libtool/
Debian package: libtool
If you find these aren't enough, or if you know the names
of the corresponding RPM etc. packages, please report to
<sc2-devel@lists.sourceforge.net>.
For the CVS repository see sc2.sourceforge.net.
(Note: this file was written by Mudry <mudry@users.sf.net>,
and is a straight copy of the FSCP one.)
+42
View File
@@ -0,0 +1,42 @@
To build The Urquan Masters, you need at least the following software:
GCC - GNU C Compiler
http://gcc.gnu.org/
Debian package: gcc
GNU Make
ftp://ftp.gnu.org/
Debian package: make
Additionally, The Urquan Masters requires the following libraries:
OpenGL v1.2
http://www.xfree86.org/
Debian package: xlibmesa-dev OR nvidia-glx OR <vendor specific>
XFree86 4.x comes with Mesa, which is a clone.
Note: Mesa is a software emulation. For enjoyable results
you will need hardware accelerated OpenGL (GLX).
These usally conflict with mesa (can result in X server crash)
SDL v1.2
The Simple Direct-Media Layer
A fairly good multiplatform low level graphics library.
Homepage: www.libsdl.org
Debian package: libsdl1.2-dev (and various runtime debs)
SDL-image
An image loading library used with SDL.
Homepage: http://www.libsdl.org/projects/SDL_image/
Download: http://www.libsdl.org/projects/SDL_image/release/
SDL-mixer
A sound mixing library used with SDL.
Homepage: http://www.libsdl.org/projects/SDL_mixer/
Download: http://www.libsdl.org/projects/SDL_mixer/release/
If you find these aren't enough, or if you know the names
of the corresponding RPM etc. packages, please report to
<sc2-devel@lists.sourceforge.net> or visit
http://sourceforge.net/projects/sc2
+226
View File
@@ -0,0 +1,226 @@
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for variables by setting
them in the environment. You can do that on the command line like this:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Environment Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it cannot guess the host type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the host
platform (i.e., that on which the generated programs will eventually be
run) with `--host=TYPE'. In this case, you should also specify the
build platform with `--build=TYPE', because, in this case, it may not
be possible to guess the build platform (it sometimes involves
compiling and running simple test programs, and this can't be done if
the compiler is a cross compiler).
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Environment Variables
=====================
Variables not defined in a site shell script can be set in the
environment passed to configure. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
+7
View File
@@ -0,0 +1,7 @@
SUBDIRS = src
ACLOCAL_AMFLAGS =
EXTRA_DIST = # config.rpath mkinstalldirs
View File
View File
+205
View File
@@ -0,0 +1,205 @@
# autoconf master file. Mudry <mudry@users.sf.net>
# Read README.ac!
# Process this file with autoconf to produce a configure script.
# Initialize autoconf
AC_PREREQ(2.50)
AC_INIT(src/starcon2.c)
# Detect the canonical host and target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
# Define package name and version here. This should be the only place
# where the actual version number appears! Use the PACKAGE and VERSION
# varaibles/defines elsewhere.
AM_INIT_AUTOMAKE(sc2, 0.1)
# Make current date available for our tools
ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)
# This allows "--enable-maintainer-mode"
AM_MAINTAINER_MODE
# --------------------------------------------------------------------------
# Configurables
CFLAGS="$CFLAGS -g"
CPPFLAGS="$CPPFLAGS -g"
# These defines seem to be missing, and they are added here as a workaround.
AC_DEFINE(SAFE_X, (0), [If know what it is it for tell me])
AC_DEFINE(SAFE_Y, (0), [If know what it is it for tell me])
# --------------------------------------------------------------------------
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
# Checks for typedefs, structures, and compiler characteristics.
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
#AC_CHECK_TYPES(int8_t)
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_EXEEXT
# Checks for library functions.
# AC_FUNC_ALLOCA
# AC_FUNC_MALLOC
AC_CHECK_FUNCS([strupr])
# --------------------------------------------------------------------------
# This section checks for special libs, as SDL and OpenGL
# Checks for misc libs
#AC_CHECK_LIB([m], [sin])
#AC_CHECK_LIB([ltdl], [lt_dlopen])
#AC_CHECK_LIB([SDL_image],[IMG_Load])
#AC_CHECK_LIB([SGE],[sge_tt_textout])
# Check for SDL
SDL_VERSION=1.2.2
SMPEG_VERSION=0.4.0
AM_PATH_SDL($SDL_VERSION, , AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
AM_PATH_SMPEG($SMPEG_VERSION, , AC_MSG_ERROR([*** smpeg version $SMPEG_VERSION not found!]))
AC_CHECK_LIB(SDL_mixer, main, , AC_MSG_ERROR(Your system is missing libSDL_mixer!),`sdl-config --libs`)
AC_CHECK_LIB(SDL_image, main, , AC_MSG_ERROR(Your system is missing libSDL_image!),`sdl-config --libs`)
AC_CHECK_LIB(smpeg, main, , AC_MSG_ERROR(Your system is missing libsmpeg!),`smpeg-config --libs`)
AC_CHECK_HEADERS(SDL/SDL_image.h, , AC_MSG_ERROR(Your system is missing SDL_image.h!))
AC_CHECK_HEADERS(SDL/SDL_mixer.h, , AC_MSG_ERROR(Your system is missing SDL_mixer.h!))
# Select platform dependent OpenGL libs.. (tweak your patform here)
case "$target" in
*-*-linux-gnu*)
SYS_GL_LIBS="-lGL"
;;
*-*-cygwin* | *-*-mingw32*)
SYS_GL_LIBS="-lopengl32"
SYS_GL_CFLAGS="-DGL_VERSION_1_2"
;;
*-*-beos*)
SYS_GL_LIBS="-lGL"
;;
*-*-darwin*)
SYS_GL_LIBS=""
;;
*)
if test x$have_x = xyes; then
CFLAGS="$CFLAGS $X_CFLAGS"
SYS_GL_LIBS="$X_LIBS -lGL"
else
SYS_GL_LIBS="-lGL"
fi
;;
esac
# Check for OpenGL
AC_MSG_CHECKING(for OpenGL support)
have_opengl=no
AC_TRY_COMPILE([
#if defined(__APPLE__) && defined(__MACH__)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
],[
],[
have_opengl=yes
])
AC_MSG_RESULT($have_opengl)
GL_LIBS=$SYS_GL_LIBS
AC_SUBST(GL_LIBS)
# Figure out which math library to use
case "$target" in
*-*-linux-gnu*)
MATHLIB=""
;;
*-*-cygwin* | *-*-mingw32*)
MATHLIB=""
;;
*-*-beos*)
MATHLIB=""
;;
*-*-darwin*)
MATHLIB=""
;;
*)
MATHLIB="-lm"
AC_PATH_X
AC_PATH_XTRA
if test x$have_x = xyes; then
CFLAGS="$CFLAGS $X_CFLAGS"
fi
;;
esac
AC_SUBST(MATHLIB)
# --------------------------------------------------------------------------
# This section is optional but contains suggested features such as libtool
# and gettext support.
# Libtool support
AM_DISABLE_SHARED
AM_PROG_LIBTOOL
# Use this if we going to use dlopen (dynamic modules)
# LIBADD_DL=-dlopen
# Internationalization support
# AM_GNU_GETTEXT
# supported languages:
# ALL_LINGUAS=""
# Set PACKAGE_LOCALE_DIR in config.h.
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale$", "Locale files")
else
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale", "Locale files")
fi
# --------------------------------------------------------------------------
# Output configuration
AM_CONFIG_HEADER(config.h)
# "intl/Makefile po/Makefile.in m4/Makefile" is added when
# autogen.sh runs.
AC_CONFIG_FILES([
Makefile
src/Makefile
src/sc2code/Makefile
src/sc2code/libs/Makefile
src/sc2code/libs/decomp/Makefile
src/sc2code/libs/memory/Makefile
src/sc2code/libs/strings/Makefile
src/sc2code/libs/resource/Makefile
src/sc2code/libs/math/Makefile
src/sc2code/libs/input/Makefile
src/sc2code/libs/sound/Makefile
src/sc2code/libs/graphics/Makefile
src/sc2code/libs/video/Makefile
src/sc2code/planets/Makefile
src/sc2code/ships/Makefile
src/sc2code/comm/Makefile
])
AC_OUTPUT
+20
View File
@@ -0,0 +1,20 @@
# Automake template file.
# Written by Mudry <mudry@user.sf.net>, protected by GNU GPL.
# CVS $ Id: $
SUBDIRS = sc2code
CFLAGS = -Wall
INCLUDES = @SDL_CFLAGS@ @SMPEG_CFLAGS@ \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/sc2code \
-I$(top_srcdir)/src/sc2code/libs
bin_PROGRAMS = sc2
sc2_SOURCES = SDL_wrapper.c port.c starcon2.c trackplayer.c
sc2_LDADD = sc2code/libsc2.la @SDL_LIBS@ @GL_LIBS@ @SMPEG_LIBS@
noinst_HEADERS = SDL_wrapper.h
File diff suppressed because it is too large Load Diff
+304
View File
@@ -0,0 +1,304 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
/****************************************
Star Control II: 3DO => SDL Port
Copyright Toys for Bob, 2002
3DO_wrapper.h programmer: Chris Nelson
*****************************************/
//This file will supply every function that Starcon2 expects of the 3DO, via SDL.
#ifndef THREEDO_WRAPPER_H
#define THREEDO_WRAPPER_H
#include "./gl.h"
#include "SDL.h"
#include "smpeg.h"
#include "SDL_mixer.h"
#include "SDL_thread.h"
#include "SDL_image.h"
#include <stdio.h>
#include <stdlib.h>
#include "starcon.h"
#include "libs/gfxlib.h"
#include "libs/vidlib.h"
#include <math.h>
//#defines
#define Stream FILE
#define MEMTYPE_ANY 1
//SDL Stuff
void InitSDL();
int Starcon2Main (void *);
//Graphics Stuff
void LoadIntoExtraScreen (PRECT r);
void DrawFromExtraScreen (PRECT r);
void SetGraphicStrength (int numer, int denom);
void SetGraphicGrabOther (int grab_other);
void SetGraphicScale (int scale);
void SetGraphicUseOtherExtra (int other);
void *GetScreenBitmap ();
void ScreenTransition (int transition, PRECT pRect);
void ScreenOrigin (FRAME Display, COORD sx, COORD sy);
extern float FrameRate;
extern int FrameRateTickBase;
//Image + Drawing Stuff
typedef struct tfb_image
{
SDL_Surface *SurfaceSDL;
Uint32 glTexture;
float glTextureW;
float glTextureH;
} TFB_Image;
TFB_Image *TFB_LoadImage (SDL_Surface *img);
void TFB_FreeImage (TFB_Image *img);
enum
{
TFB_DRAWCOMMANDTYPE_LINE,
TFB_DRAWCOMMANDTYPE_RECTANGLE,
TFB_DRAWCOMMANDTYPE_IMAGE,
TFB_DRAWCOMMANDTYPE_COPYFROMOTHERBUFFER,
TFB_DRAWCOMMANDTYPE_SCISSORENABLE,
TFB_DRAWCOMMANDTYPE_SCISSORDISABLE,
TFB_DRAWCOMMANDTYPE_COPYBACKBUFFERTOOTHERBUFFER,
TFB_DRAWCOMMANDTYPE_DELETEIMAGE,
};
typedef struct tfb_drawcommand
{
int Type;
int x;
int y;
int w;
int h;
TFB_Image *image; // only used for image draw type
int r; // RGB only used for rect draw types
int g;
int b;
int Qualifier;
} TFB_DrawCommand;
// Queue Stuff
typedef struct tfb_drawcommandnode
{
TFB_DrawCommand *Command;
void *Ahead;
void *Behind;
} TFB_DrawCommandNode;
typedef struct tfb_drawcommandqueue
{
TFB_DrawCommandNode *Front;
TFB_DrawCommandNode *Back;
int Size;
} TFB_DrawCommandQueue;
TFB_DrawCommandQueue *TFB_DrawCommandQueue_Create ();
void TFB_DrawCommandQueue_Push (TFB_DrawCommandQueue* myQueue,
TFB_DrawCommand* Command);
TFB_DrawCommand *TFB_DrawCommandQueue_Pop (TFB_DrawCommandQueue* myQueue);
void TFB_DeallocateDrawCommand (TFB_DrawCommand* Command);
// End Queue Stuff
extern TFB_DrawCommandQueue *DrawCommandQueue;
// The TFB_Enqueue* functions are necessary, because only the main thread can
// draw to the OpenGL window.
void TFB_EnqueueDrawCommand (TFB_DrawCommand* DrawCommand);
void TFB_FlushGraphics (); //Only call from main thread!!
//Sound Stuff
//Track player Stuff
void ResumeTrack();
void PauseTrack();
COUNT PlayingTrack();
void JumpTrack(int abort);
void FastForward();
void FastReverse();
void StopTrack();
void SpliceTrack(UNICODE *filespec, UNICODE *textspec);
int GetSoundData(char *data);
int GetSoundInfo (int *len, int *offs);
extern SEMAPHORE _MemorySem;
// Non-Volitile RAM Stuff
// CD Stuff
int CD_get_drive(); // Returns 0
unsigned int CD_get_volsize(); // Returns 0
// IO Stuff
// Multi-tasking Stuff
// CCB Stuff
typedef struct
{
int ccb_Flags;
int ccb_HDX;
int ccb_HDY;
int ccb_HDDX;
int ccb_HDDY;
int ccb_VDX;
int ccb_VDY;
int ccb_PIXC;
void* ccb_SourcePtr;
unsigned int* ccb_PLUTPtr;
int ccb_Width;
int ccb_Height;
int ccb_PRE0;
int ccb_PRE1;
void* ccb_NextPtr;
int ccb_XPos;
int ccb_YPos;
} CCB;
// Geez, I hope these #defines work out...
#define CCB_SPABS (1 << 0)
#define CCB_PPABS (1 << 1)
#define CCB_YOXY (1 << 2)
#define CCB_ACW (1 << 3)
#define CCB_ACCW (1 << 4)
#define CCB_LDSIZE (1 << 5)
#define CCB_CCBPRE (1 << 6)
#define CCB_LDPRS (1 << 7)
#define CCB_LDPPMP (1 << 8)
#define CCB_ACE (1 << 9)
#define CCB_LCE (1 << 10)
#define CCB_PLUTPOS (1 << 11)
#define CCB_BGND (1 << 12)
#define CCB_NPABS (1 << 13)
#define CCB_PACKED (1 << 14)
#define CCB_LDPLUT (1 << 15)
#define CCB_LAST (1 << 16)
#define CCB_USEAV (1 << 17)
#define PPMP_0_SHIFT 0 // ?
#define PPMP_1_SHIFT 1 // ?
#define PPMPC_MS_PIN (1 << 0)
#define PPMPC_MS_CCB (1 << 1)
#define PPMPC_SF_8 (1 << 2)
#define PPMPC_MF_8 (1 << 3)
#define PPMPC_MF_SHIFT 3
#define PPMPC_1S_PDC (1 << 4)
#define PPMPC_2S_CFBD (1 << 5)
#define PPMPC_2D_1 (1 << 6)
#define PPMPC_MF_6 (1 << 7)
#define PPMPC_2S_0 (1 << 8)
#define PPMPC_1S_CFBD (1 << 9)
#define PPMPC_MF_2 (1 << 10)
#define PPMPC_SF_2 (1 << 11)
#define PPMPC_2S_PDC (1 << 12)
#define PPMPC_MF_1 (1 << 13)
#define PPMPC_SF_16 (1 << 14)
#define PRE0_LITERAL (1 << 0)
#define PRE0_VCNT_PREFETCH (1 << 1)
#define PRE0_VCNT_SHIFT 1
#define PRE0_VCNT_MASK (1 << 1)
#define PRE0_BPP_8 (1 << 2)
#define PRE0_BPP_SHIFT 2
#define PRE0_BPP_16 (1 << 3)
#define PRE0_BGND (1 << 4)
#define PRE0_LINEAR (1 << 5)
#define PRE0_SKIPX_MASK 0
#define PRE0_SKIPX_SHIFT 0
#define PRE0_BPP_1 (1 << 6)
#define PRE1_TLLSB_PDC0 (1 << 7)
#define PRE1_TLHPCNT_PREFETCH (1 << 7)
#define PRE1_TLHPCNT_SHIFT 7
#define PRE1_TLHPCNT_MASK (1 << 7)
#define PRE1_WOFFSET_PREFETCH (1 << 8)
#define PRE1_WOFFSET10_SHIFT (1 << 9)
#define PRE1_WOFFSET8_SHIFT (1 << 10)
// Cel Stuff
void add_cel(CCB* cel);
void add_cels(CCB* first, CCB* last);
void myMapCel(CCB* myCCB, POINT Points[4]);
int _ThreeDO_batch_cels(int unknown);
CCB *ParseCel(CCB*,unsigned int);
// Misc Stuff
#define SqrtF16 sqrt
#define Atan2F16 atan2
#define CosF16 cos
#define SinF16 sin
#define CelData void
// Unknown Stuff
void OpenMathFolio();
extern int ScreenWidth;
extern int ScreenHeight;
extern int ScreenWidthActual;
extern int ScreenHeightActual;
extern Uint8 KeyboardDown[512];
extern UBYTE ControlA;
extern UBYTE ControlB;
extern UBYTE ControlC;
extern UBYTE ControlX;
extern UBYTE ControlStart;
extern UBYTE ControlLeftShift;
extern UBYTE ControlRightShift;
extern void *HMalloc (Uint32 size);
extern void HFree (void *p);
extern void *HCalloc (Uint32 size);
extern void *HRealloc (void *p, Uint32 size);
extern int TFB_DEBUG_HALT;
#endif // THREEDO_WRAPPER_H
+45
View File
@@ -0,0 +1,45 @@
#ifdef WIN32
/* To avoid including windows.h,
Win32's <GL/gl.h> needs APIENTRY and WINGDIAPI defined properly. */
#pragma warning (disable:4244) /* Disable bogus conversion warnings. */
#ifndef APIENTRY
#define GLUT_APIENTRY_DEFINED
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
#define APIENTRY __stdcall
#else
#define APIENTRY
#endif
#endif
/* This is from Win32's <winnt.h> */
#ifndef CALLBACK
#if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
#define CALLBACK __stdcall
#else
#define CALLBACK
#endif
#endif
/* This is from Win32's <wingdi.h> and <winnt.h> */
#ifndef WINGDIAPI
#define GLUT_WINGDIAPI_DEFINED
#define WINGDIAPI __declspec(dllimport)
#endif
/* This is from Win32's <ctype.h> */
#ifndef _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif
#include "GL/glu.h"
#else /* !defined(WIN32) */
#include "GL/glu.h"
#endif
File diff suppressed because it is too large Load Diff
+29
View File
@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Starcon2"=".\Starcon2.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
+41
View File
@@ -0,0 +1,41 @@
/*
* 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.
*/
/*
* This file contains definitions that might be included in one system, but
* omited in another.
*
* Created by Serge van den Boom
*/
#include <ctype.h>
#include <stdlib.h>
#ifndef HAVE_STRUPR
char *
strupr(char *str)
{
char *ptr;
ptr = str;
while (*ptr)
{
*ptr = toupper (*ptr);
ptr++;
}
return str;
}
#endif
+13
View File
@@ -0,0 +1,13 @@
#ifdef WIN32
#define HAVE_STRICMP
#define HAVE_STRUPR
#endif
#ifndef HAVE_STRICMP
#define stricmp strcasecmp
#endif
#ifndef HAVE_STRUPR
char *strupr(char *str);
#endif
+49
View File
@@ -0,0 +1,49 @@
# Automake template file.
# Written by Mudry <mudry@user.sf.net>, protected by GNU GPL.
# CVS $ Id: $
SUBDIRS = ships libs planets comm
# We build the core SC2 code as a static library.
CFLAGS = -W -Wall
INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/sc2code \
-I$(top_srcdir)/src/sc2code/libs \
@SDL_CFLAGS@ @SMPEG_CFLAGS@
noinst_LTLIBRARIES = libsc2.la
libsc2_la_SOURCES = \
battle.c border.c build.c cleanup.c clock.c collide.c comm.c \
commglue.c confirm.c credits.c cyborg.c demo.c displist.c \
dummy.c encount.c fmv.c galaxy.c gameinp.c gameopt.c gendef.c \
getchar.c globdata.c gravity.c gravwell.c grpinfo.c hyper.c \
init.c intel.c intro.c ipdisp.c load.c loadship.c master.c \
melee.c misc.c oscill.c outfit.c pickmele.c pickship.c \
plandata.c process.c restart.c save.c settings.c setup.c \
ship.c shipstat.c shipyard.c sis.c starbase.c starcon.c \
starmap.c state.c status.c tactrans.c trans.c utils.c \
velocity.c weapon.c
libsc2_la_LIBADD = \
ships/libships.la planets/libplanets.la \
comm/libcomm.la \
libs/liblibs.la
noinst_HEADERS = \
appglue.h build.h clock.h coderes.h collide.h commglue.h demo.h \
displist.h element.h encount.h globdata.h hyper.h ifontres.h \
igfxres.h ikey_con.h imusicre.h intel.h ires_ind.h isndres.h \
istrtab.h melee.h nameref.h races.h resinst.h respkg.h \
restypes.h sis.h sounds.h starbase.h starcon.h state.h \
units.h velocity.h weapon.h
#noinst_PROGRAMS = sndtest
#sndtest_SOURCES = test.c
#sndtest_LDADD = libsc2.a
+27
View File
@@ -0,0 +1,27 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#ifndef _APPGLUE_H
#define _APPGLUE_H
#include "vargs.h"
extern DWORD race_glue (COUNT selector, vararg_dcl args, ...);
#endif /* _APPGLUE_H */
+249
View File
@@ -0,0 +1,249 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "SDL_wrapper.h"
//#include "starcon.h"
QUEUE disp_q;
SIZE battle_counter;
static void
ProcessInput (void)
{
BOOLEAN CanRunAway;
CanRunAway = (BOOLEAN)(
(LOBYTE (GLOBAL (CurrentActivity)) == IN_ENCOUNTER
|| LOBYTE (GLOBAL (CurrentActivity)) == IN_LAST_BATTLE)
&& GET_GAME_STATE (STARBASE_AVAILABLE)
&& !GET_GAME_STATE (BOMB_CARRIER)
);
for (cur_player = NUM_SIDES - 1; cur_player >= 0; --cur_player)
{
HSTARSHIP hBattleShip, hNextShip;
for (hBattleShip = GetHeadLink (&race_q[cur_player]);
hBattleShip != 0; hBattleShip = hNextShip)
{
INPUT_STATE InputState;
STARSHIPPTR StarShipPtr;
StarShipPtr = LockStarShip (&race_q[cur_player], hBattleShip);
hNextShip = _GetSuccLink (StarShipPtr);
if (StarShipPtr->hShip)
{
CyborgDescPtr = StarShipPtr;
InputState = GetInputState (PlayerInput[cur_player]);
#if CREATE_JOURNAL
JournalInput (InputState);
#endif /* CREATE_JOURNAL */
if (InputState & DEVICE_EXIT)
InputState = ConfirmExit ();
#ifdef TESTING
if ((InputState & DEVICE_BUTTON3)
&& LOBYTE (GLOBAL (CurrentActivity)) == IN_HYPERSPACE)
{
COUNT i;
for (i = ARILOU_SHIP; i <= BLACK_URQUAN_SHIP; ++i)
ActivateStarShip (i, SPHERE_TRACKING);
while (GLOBAL (GameClock.tick_count) > 1)
ClockTick ();
}
#endif /* TESTING */
CyborgDescPtr->ship_input_state = 0;
if (CyborgDescPtr->RaceDescPtr->ship_info.crew_level)
{
if (GetInputXComponent (InputState) < 0)
CyborgDescPtr->ship_input_state |= LEFT;
else if (GetInputXComponent (InputState) > 0)
CyborgDescPtr->ship_input_state |= RIGHT;
if (GetInputYComponent (InputState) < 0
|| (InputState & DEVICE_BUTTON1))
CyborgDescPtr->ship_input_state |= THRUST;
if (InputState & (DEVICE_BUTTON2 | DEVICE_RIGHTSHIFT))
CyborgDescPtr->ship_input_state |= WEAPON;
if (InputState & (DEVICE_BUTTON3 | DEVICE_LEFTSHIFT))
CyborgDescPtr->ship_input_state |= SPECIAL;
if (CanRunAway
&& cur_player == 0
&& ((PlayerControl[cur_player] & HUMAN_CONTROL)
|| (InputState = GetInputState (NormalInput)))
&& (InputState & (DEVICE_BUTTON2 | DEVICE_RIGHTSHIFT))
== (DEVICE_BUTTON2 | DEVICE_RIGHTSHIFT))
{
ELEMENTPTR ElementPtr;
LockElement (StarShipPtr->hShip, &ElementPtr);
if (GetPrimType (&DisplayArray[ElementPtr->PrimIndex]) == STAMP_PRIM
&& ElementPtr->life_span == NORMAL_LIFE
&& !(ElementPtr->state_flags & FINITE_LIFE)
&& ElementPtr->mass_points != MAX_SHIP_MASS * 10)
{
extern void flee_preprocess (PELEMENT
ElementPtr);
battle_counter -= MAKE_WORD (1, 0);
ElementPtr->turn_wait = 3;
ElementPtr->thrust_wait = MAKE_BYTE (4, 0);
ElementPtr->preprocess_func = flee_preprocess;
ElementPtr->mass_points = MAX_SHIP_MASS * 10;
ZeroVelocityComponents (&ElementPtr->velocity);
StarShipPtr->cur_status_flags &=
~(SHIP_AT_MAX_SPEED | SHIP_BEYOND_MAX_SPEED);
SetPrimColor (&DisplayArray[ElementPtr->PrimIndex],
BUILD_COLOR (MAKE_RGB15 (0xB, 0x00, 0x00), 0x2E));
SetPrimType (&DisplayArray[ElementPtr->PrimIndex], STAMPFILL_PRIM);
CyborgDescPtr->ship_input_state = 0;
}
UnlockElement (StarShipPtr->hShip);
}
}
}
UnlockStarShip (&race_q[cur_player], hBattleShip);
}
}
if (GLOBAL (CurrentActivity) & (CHECK_LOAD | CHECK_ABORT))
GLOBAL (CurrentActivity) &= ~IN_BATTLE;
}
#if DEMO_MODE || CREATE_JOURNAL
DWORD BattleSeed;
#endif /* DEMO_MODE */
static MUSIC_REF BattleRef;
void
BattleSong (BOOLEAN DoPlay)
{
if (BattleRef == 0)
{
if (LOBYTE (GLOBAL (CurrentActivity)) != IN_HYPERSPACE)
BattleRef = LoadMusicInstance (BATTLE_MUSIC);
else if (GET_GAME_STATE (ARILOU_SPACE_SIDE) <= 1)
BattleRef = LoadMusicInstance (HYPERSPACE_MUSIC);
else
BattleRef = LoadMusicInstance (QUASISPACE_MUSIC);
}
if (DoPlay)
PlayMusic (BattleRef, TRUE, 1);
}
void
FreeBattleSong (void)
{
DestroyMusic (BattleRef);
BattleRef = 0;
}
BOOLEAN
Battle (void)
{
SIZE num_ships;
extern SIZE InitShips (void);
void UninitShips (void);
SetSemaphore (&GraphicsSem);
SetResourceIndex (hResIndex);
#if !(DEMO_MODE || CREATE_JOURNAL)
SeedRandom (GetTimeCounter ());
#else /* DEMO_MODE */
if (BattleSeed == 0)
BattleSeed = Random ();
SeedRandom (BattleSeed);
BattleSeed = Random (); /* get next battle seed */
#endif /* DEMO_MODE */
BattleSong (FALSE);
num_ships = InitShips ();
if (num_ships)
{
DWORD NextTime;
BOOLEAN first_time;
GLOBAL (CurrentActivity) |= IN_BATTLE;
battle_counter = MAKE_WORD (
CountLinks (&race_q[0]),
CountLinks (&race_q[1])
);
while (num_ships--)
{
if (!GetNextStarShip (NULL_PTR, num_ships))
goto AbortBattle;
}
BattleSong (TRUE);
NextTime = 0;
first_time = (BOOLEAN)(LOBYTE (GLOBAL (CurrentActivity)) == IN_HYPERSPACE);
do
{
extern UWORD nth_frame;
BatchGraphics ();
if (LOBYTE (GLOBAL (CurrentActivity)) == IN_HYPERSPACE)
SeedUniverse ();
RedrawQueue (TRUE);
if (first_time)
{
RECT r;
first_time = FALSE;
r.corner.x = SIS_ORG_X;
r.corner.y = SIS_ORG_Y;
r.extent.width = SIS_SCREEN_WIDTH;
r.extent.height = SIS_SCREEN_HEIGHT;
ScreenTransition (3, &r);
}
UnbatchGraphics ();
ClearSemaphore (&GraphicsSem);
if (nth_frame)
TaskSwitch ();
else
NextTime = SleepTask (NextTime + BATTLE_FRAME_RATE);
ProcessInput ();
SetSemaphore (&GraphicsSem);
} while (GLOBAL (CurrentActivity) & IN_BATTLE);
AbortBattle:
StopMusic ();
StopSound ();
}
UninitShips ();
FreeBattleSong ();
ClearSemaphore (&GraphicsSem);
return (num_ships < 0);
}
+194
View File
@@ -0,0 +1,194 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "starcon.h"
void
InitSISContexts (void)
{
RECT r;
SetContext (StatusContext);
SetContextDrawState (DEST_PIXMAP | DRAW_REPLACE);
SetContext (SpaceContext);
SetContextFGFrame (Screen);
SetContextDrawState (DEST_PIXMAP | DRAW_REPLACE);
r.corner.x = SIS_ORG_X;
r.corner.y = SIS_ORG_Y;
r.extent.width = SIS_SCREEN_WIDTH;
r.extent.height = SIS_SCREEN_HEIGHT;
SetContextClipRect (&r);
}
void
DrawSISFrame (void)
{
RECT r;
SetSemaphore (&GraphicsSem);
SetContext (ScreenContext);
SetContextDrawState (DEST_PIXMAP | DRAW_REPLACE);
BatchGraphics ();
{
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0xA), 0x08));
r.corner.x = 0;
r.corner.y = 0;
r.extent.width = SIS_ORG_X + SIS_SCREEN_WIDTH + 1;
r.extent.height = SIS_ORG_Y - 1;
DrawFilledRectangle (&r);
r.corner.x = 0;
r.corner.y = 0;
r.extent.width = SIS_ORG_X - 1;
r.extent.height = SIS_ORG_Y + SIS_SCREEN_HEIGHT + 1;
DrawFilledRectangle (&r);
r.corner.x = 0;
r.corner.y = r.extent.height;
r.extent.width = SIS_ORG_X + SIS_SCREEN_WIDTH + 1;
r.extent.height = SCREEN_HEIGHT - SIS_ORG_Y + SIS_SCREEN_HEIGHT;
DrawFilledRectangle (&r);
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH + 1;
r.corner.y = 0;
r.extent.width = SCREEN_WIDTH - r.corner.x;
r.extent.height = SCREEN_HEIGHT;
DrawFilledRectangle (&r);
r.corner.x = SIS_ORG_X - 1;
r.corner.y = SIS_ORG_Y - 1;
r.extent.width = SIS_SCREEN_WIDTH + 2;
r.extent.height = SIS_SCREEN_HEIGHT + 2;
DrawStarConBox (&r, 1,
BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19),
BUILD_COLOR (MAKE_RGB15 (0x8, 0x8, 0x8), 0x1F),
TRUE, BLACK_COLOR);
r.corner.y = 0;
r.extent.height = SIS_ORG_Y;
r.corner.x = SIS_ORG_X;
r.extent.width = SIS_SCREEN_WIDTH - 69;
DrawStarConBox (&r, 1,
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0xE), 0x54),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x1, 0x1C), 0x4E),
TRUE, BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01));
r.extent.width = 57;
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH - 57;
DrawStarConBox (&r, 1,
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0xE), 0x54),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x1, 0x1C), 0x4E),
TRUE, BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01));
SetContextForeGroundColor (BLACK_COLOR);
r.corner.x = SAFE_X + SPACE_WIDTH - 1;
r.corner.y = 0;
r.extent.width = 1;
r.extent.height = SCREEN_HEIGHT;
DrawFilledRectangle (&r);
r.corner.x = SAFE_X + SPACE_WIDTH;
r.corner.y = SAFE_Y + 139;
DrawPoint (&r.corner);
r.corner.x = SCREEN_WIDTH - 1;
DrawPoint (&r.corner);
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19));
r.corner.y = 1;
r.extent.width = 1;
r.extent.height = SAFE_Y + 7;
r.corner.x = SIS_ORG_X - 1;
DrawFilledRectangle (&r);
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH - 57 - 1;
DrawFilledRectangle (&r);
r.corner.x = 0;
r.corner.y = SCREEN_HEIGHT - 1;
r.extent.width = SAFE_X + SPACE_WIDTH - 1;
r.extent.height = 1;
DrawFilledRectangle (&r);
r.corner.x = SAFE_X + SPACE_WIDTH - 2;
r.corner.y = 0;
r.extent.width = 1;
r.extent.height = SCREEN_HEIGHT - 1;
DrawFilledRectangle (&r);
r.corner.x = SCREEN_WIDTH - 1;
r.corner.y = 0;
r.extent.width = 1;
r.extent.height = SAFE_Y + 139;
DrawFilledRectangle (&r);
r.corner.x = SAFE_X + SPACE_WIDTH;
r.corner.y = SCREEN_HEIGHT - 1;
r.extent.width = SCREEN_WIDTH - r.corner.x;
r.extent.height = 1;
DrawFilledRectangle (&r);
r.corner.x = SCREEN_WIDTH - 1;
r.corner.y = SAFE_Y + 140;
r.extent.width = 1;
r.extent.height = (SCREEN_HEIGHT - 1) - r.corner.y;
DrawFilledRectangle (&r);
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x8, 0x8, 0x8), 0x1F));
r.corner.y = 1;
r.extent.width = 1;
r.extent.height = SAFE_Y + 7;
r.corner.x = SIS_ORG_X + (SIS_SCREEN_WIDTH - 69);
DrawFilledRectangle (&r);
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH;
++r.extent.height;
DrawFilledRectangle (&r);
r.corner.y = 0;
r.extent.width = (SAFE_X + SPACE_WIDTH - 2) - r.corner.x;
r.extent.height = 1;
DrawFilledRectangle (&r);
r.corner.x = 0;
r.extent.width = SIS_ORG_X - r.corner.x;
DrawFilledRectangle (&r);
r.corner.x = SIS_ORG_X + (SIS_SCREEN_WIDTH - 69);
r.extent.width = (SIS_ORG_X + SIS_SCREEN_WIDTH - 57) - r.corner.x;
DrawFilledRectangle (&r);
r.corner.x = 0;
r.corner.y = 1;
r.extent.width = 1;
r.extent.height = (SCREEN_HEIGHT - 1) - r.corner.y;
DrawFilledRectangle (&r);
r.corner.x = SAFE_X + SPACE_WIDTH;
r.corner.y = 0;
r.extent.width = 1;
r.extent.height = SAFE_Y + 139;
DrawFilledRectangle (&r);
r.corner.x = SAFE_X + SPACE_WIDTH + 1;
r.corner.y = SAFE_Y + 139;
r.extent.width = STATUS_WIDTH - 2;
r.extent.height = 1;
DrawFilledRectangle (&r);
r.corner.x = SAFE_X + SPACE_WIDTH;
r.corner.y = SAFE_Y + 140;
r.extent.width = 1;
r.extent.height = SCREEN_HEIGHT - r.corner.y;
DrawFilledRectangle (&r);
}
InitSISContexts ();
ClearSISRect (DRAW_SIS_DISPLAY);
UnbatchGraphics ();
ClearSemaphore (&GraphicsSem);
}
+416
View File
@@ -0,0 +1,416 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "starcon.h"
HSTARSHIP
Build (PQUEUE pQueue, DWORD RaceResIndex, COUNT which_player, BYTE
captains_name_index)
{
HSTARSHIP hNewShip;
if ((hNewShip = AllocStarShip (pQueue)) != 0)
{
STARSHIPPTR StarShipPtr;
StarShipPtr = LockStarShip (pQueue, hNewShip);
memset (StarShipPtr, 0, GetLinkSize (pQueue));
StarShipPtr->RaceResIndex = RaceResIndex;
OwnStarShip (StarShipPtr, which_player, captains_name_index);
UnlockStarShip (pQueue, hNewShip);
PutQueue (pQueue, hNewShip);
}
return (hNewShip);
}
HSTARSHIP
GetStarShipFromIndex (PQUEUE pShipQ, COUNT Index)
{
HSTARSHIP hStarShip, hNextShip;
for (hStarShip = GetHeadLink (pShipQ);
Index > 0 && hStarShip; hStarShip = hNextShip, --Index)
{
STARSHIPPTR StarShipPtr;
StarShipPtr = LockStarShip (pShipQ, hStarShip);
hNextShip = _GetSuccLink (StarShipPtr);
UnlockStarShip (pShipQ, hStarShip);
}
return (hStarShip);
}
COUNT
ActivateStarShip (COUNT which_ship, SIZE state)
{
HSTARSHIP hStarShip, hNextShip;
hStarShip = GetStarShipFromIndex (
&GLOBAL (avail_race_q), which_ship
);
if (hStarShip)
{
switch (state)
{
case SPHERE_TRACKING:
case SPHERE_KNOWN:
{
EXTENDED_SHIP_FRAGMENTPTR StarShipPtr;
StarShipPtr = (EXTENDED_SHIP_FRAGMENTPTR)LockStarShip (
&GLOBAL (avail_race_q), hStarShip
);
if (state == SPHERE_KNOWN)
which_ship = StarShipPtr->ShipInfo.known_strength;
else if (StarShipPtr->ShipInfo.actual_strength == 0)
{
if (!(StarShipPtr->ShipInfo.ship_flags
& (GOOD_GUY | BAD_GUY)))
which_ship = 0;
}
else if (StarShipPtr->ShipInfo.known_strength == 0
&& StarShipPtr->ShipInfo.actual_strength != (COUNT)~0)
{
StarShipPtr->ShipInfo.known_strength = 1;
StarShipPtr->ShipInfo.known_loc =
StarShipPtr->ShipInfo.loc;
}
UnlockStarShip (
&GLOBAL (avail_race_q), hStarShip
);
return (which_ship);
}
case ESCORT_WORTH:
which_ship = 0;
case ESCORTING_FLAGSHIP:
{
COUNT ShipCost[] =
{
RACE_SHIP_COST
};
for (hStarShip = GetHeadLink (&GLOBAL (built_ship_q));
hStarShip; hStarShip = hNextShip)
{
BYTE ship_type;
SHIP_FRAGMENTPTR StarShipPtr;
StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (
&GLOBAL (built_ship_q), hStarShip
);
hNextShip = _GetSuccLink (StarShipPtr);
if (state == ESCORT_WORTH)
which_ship += ShipCost[GET_RACE_ID (StarShipPtr)];
else
ship_type = GET_RACE_ID (StarShipPtr);
UnlockStarShip (
&GLOBAL (built_ship_q), hStarShip
);
if (state != ESCORT_WORTH
&& (COUNT)ship_type == which_ship)
return (1);
}
return (state == ESCORTING_FLAGSHIP ? 0 : which_ship);
}
case FEASIBILITY_STUDY:
return (MAX_BUILT_SHIPS
- CountLinks (&GLOBAL (built_ship_q)));
default:
{
SHIP_FRAGMENTPTR StarShipPtr;
if (state <= 0)
{
StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (
&GLOBAL (avail_race_q), hStarShip
);
if (state == CHECK_ALLIANCE)
{
state = StarShipPtr->ShipInfo.ship_flags
& (GOOD_GUY | BAD_GUY);
UnlockStarShip (
&GLOBAL (avail_race_q), hStarShip
);
return ((COUNT)state);
}
else if (StarShipPtr->ShipInfo.ship_flags
& (GOOD_GUY | BAD_GUY))
{
StarShipPtr->ShipInfo.ship_flags &= ~(GOOD_GUY | BAD_GUY);
if (state == 0)
StarShipPtr->ShipInfo.ship_flags |= GOOD_GUY;
else
{
StarShipPtr->ShipInfo.ship_flags |= BAD_GUY;
if (which_ship == ORZ_SHIP)
{
BOOLEAN ShipRemoved;
ShipRemoved = FALSE;
for (hStarShip = GetHeadLink (
&GLOBAL (built_ship_q
)); hStarShip; hStarShip = hNextShip)
{
BOOLEAN RemoveShip;
SHIP_FRAGMENTPTR StarShipPtr;
StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (
&GLOBAL (built_ship_q),
hStarShip
);
hNextShip = _GetSuccLink (StarShipPtr);
RemoveShip = (BOOLEAN)(
GET_RACE_ID (StarShipPtr) == ORZ_SHIP
);
UnlockStarShip (
&GLOBAL (built_ship_q),
hStarShip
);
if (RemoveShip)
{
ShipRemoved = TRUE;
RemoveQueue (
&GLOBAL (built_ship_q),
hStarShip
);
FreeStarShip (
&GLOBAL (built_ship_q),
hStarShip
);
}
}
if (ShipRemoved)
{
SetSemaphore (&GraphicsSem);
DeltaSISGauges (UNDEFINED_DELTA,
UNDEFINED_DELTA, UNDEFINED_DELTA);
ClearSemaphore (&GraphicsSem);
}
}
}
}
UnlockStarShip (
&GLOBAL (avail_race_q), hStarShip
);
}
else
{
BYTE which_window;
COUNT i;
which_window = 0;
for
(
i = 0;
i < (COUNT)state
&&
(
hStarShip = CloneShipFragment
(
(COUNT)which_ship,
(PQUEUE)(&GLOBAL (built_ship_q)),
(BYTE)
(
(
which_ship == SPATHI_SHIP &&
GET_GAME_STATE (FOUND_PLUTO_SPATHI)
) == 1 ? 1 : 0
)
)
);
i++
)
{
HSTARSHIP hOldShip;
RemoveQueue (
&GLOBAL (built_ship_q),
hStarShip
);
while ((hOldShip = GetStarShipFromIndex (
&GLOBAL (built_ship_q),
which_window++
)))
{
BYTE win_loc;
StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (
&GLOBAL (built_ship_q), hOldShip
);
win_loc = GET_GROUP_LOC (StarShipPtr);
UnlockStarShip (
&GLOBAL (built_ship_q), hOldShip
);
if (which_window <= win_loc)
break;
}
StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (
&GLOBAL (built_ship_q), hStarShip
);
SET_GROUP_LOC (StarShipPtr, which_window - 1);
if (which_ship == SPATHI_SHIP
&& GET_GAME_STATE (FOUND_PLUTO_SPATHI) == 1)
{
OwnStarShip (StarShipPtr,
GOOD_GUY,
NAME_OFFSET + NUM_CAPTAINS_NAMES);
}
UnlockStarShip (
&GLOBAL (built_ship_q), hStarShip
);
InsertQueue (
&GLOBAL (built_ship_q),
hStarShip, hOldShip
);
}
SetSemaphore (&GraphicsSem);
DeltaSISGauges (UNDEFINED_DELTA,
UNDEFINED_DELTA, UNDEFINED_DELTA);
ClearSemaphore (&GraphicsSem);
return (i);
}
break;
}
}
return (1);
}
return (0);
}
COUNT
GetIndexFromStarShip (PQUEUE pShipQ, HSTARSHIP hStarShip)
{
COUNT Index;
Index = 0;
while (hStarShip != GetHeadLink (pShipQ))
{
HSTARSHIP hNextShip;
STARSHIPPTR StarShipPtr;
StarShipPtr = LockStarShip (pShipQ, hStarShip);
hNextShip = _GetPredLink (StarShipPtr);
UnlockStarShip (pShipQ, hStarShip);
hStarShip = hNextShip;
++Index;
}
return (Index);
}
BYTE
NameCaptain (PQUEUE pQueue, STARSHIPPTR StarShipPtr)
{
BYTE name_index;
HSTARSHIP hStarShip;
do
{
HSTARSHIP hNextShip;
name_index = PickCaptainName ();
for (hStarShip = GetHeadLink (pQueue); hStarShip; hStarShip = hNextShip)
{
STARSHIPPTR TestShipPtr;
TestShipPtr = LockStarShip (pQueue, hStarShip);
hNextShip = _GetSuccLink (TestShipPtr);
if (TestShipPtr->RaceResIndex == StarShipPtr->RaceResIndex)
{
BOOLEAN SameName;
if (LOBYTE (GLOBAL (CurrentActivity)) == SUPER_MELEE)
SameName = (BOOLEAN)(
name_index == TestShipPtr->captains_name_index
);
else
SameName = (BOOLEAN)(
name_index == StarShipCaptain (TestShipPtr)
);
if (SameName)
{
UnlockStarShip (pQueue, hStarShip);
break;
}
}
UnlockStarShip (pQueue, hStarShip);
}
} while (hStarShip);
return (name_index);
}
HSTARSHIP
CloneShipFragment (COUNT index, PQUEUE pDstQueue, BYTE crew_level)
{
HSTARSHIP hStarShip, hBuiltShip;
SHIP_FRAGMENTPTR TemplatePtr;
if ((hStarShip = GetStarShipFromIndex (&GLOBAL (avail_race_q), index)) == 0)
return (0);
TemplatePtr = (SHIP_FRAGMENTPTR)LockStarShip (
&GLOBAL (avail_race_q), hStarShip
);
hBuiltShip =
Build (pDstQueue,
TemplatePtr->RaceResIndex,
TemplatePtr->ShipInfo.ship_flags & (GOOD_GUY | BAD_GUY),
(BYTE)(index == SAMATRA_SHIP ?
0 : NameCaptain (pDstQueue, (STARSHIPPTR)TemplatePtr)));
if (hBuiltShip)
{
SHIP_FRAGMENTPTR ShipFragPtr;
ShipFragPtr = (SHIP_FRAGMENTPTR)LockStarShip (pDstQueue, hBuiltShip);
ShipFragPtr->ShipInfo = TemplatePtr->ShipInfo;
if (crew_level)
ShipFragPtr->ShipInfo.crew_level = crew_level;
ShipFragPtr->ShipInfo.energy_level = 0;
ShipFragPtr->ShipInfo.ship_flags = 0;
ShipFragPtr->ShipInfo.var1 = ShipFragPtr->ShipInfo.var2 = 0;
ShipFragPtr->ShipInfo.loc.x = ShipFragPtr->ShipInfo.loc.y = 0;
SET_RACE_ID (ShipFragPtr, (BYTE)index);
UnlockStarShip (pDstQueue, hBuiltShip);
}
UnlockStarShip (
&GLOBAL (avail_race_q), hStarShip
);
return (hBuiltShip);
}
+72
View File
@@ -0,0 +1,72 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#ifndef _BUILD_H
#define _BUILD_H
#define CREW_XOFFS 4
#define ENERGY_XOFFS 52
#define GAUGE_YOFFS (SHIP_INFO_HEIGHT - 10)
#define UNIT_WIDTH 2
#define UNIT_HEIGHT 1
#define STAT_WIDTH (1 + UNIT_WIDTH + 1 + UNIT_WIDTH + 1)
#define NAME_OFFSET 5
#define NUM_CAPTAINS_NAMES 16
#define OwnStarShip(S,p,n) \
(S)->RaceDescPtr = (RACE_DESCPTR)MAKE_DWORD(p, n)
#define StarShipCaptain(S) \
(BYTE)HIWORD ((S)->RaceDescPtr)
#define StarShipPlayer(S) \
(COUNT)LOWORD ((S)->RaceDescPtr)
#define PickCaptainName() (((COUNT)Random () \
& (NUM_CAPTAINS_NAMES - 1)) \
+ NAME_OFFSET)
extern HSTARSHIP Build (PQUEUE pQueue, DWORD RaceResIndex, COUNT
which_player, BYTE captains_name_index);
extern HSTARSHIP CloneShipFragment (COUNT index, PQUEUE pDstQueue, BYTE
crew_level);
extern HSTARSHIP GetStarShipFromIndex (PQUEUE pShipQ, COUNT Index);
extern BYTE NameCaptain (PQUEUE pQueue, STARSHIPPTR StarShipPtr);
#define CHECK_ALLIANCE -2
#define ESCORT_WORTH 9995
#define SPHERE_KNOWN 9996
#define SPHERE_TRACKING 9997
#define ESCORTING_FLAGSHIP 9998
#define FEASIBILITY_STUDY 9999
extern COUNT ActivateStarShip (COUNT which_ship, SIZE state);
extern COUNT GetIndexFromStarShip (PQUEUE pShipQ, HSTARSHIP hStarShip);
extern MEM_HANDLE load_ship (STARSHIPPTR StarShipPtr, BOOLEAN
LoadBattleData);
extern void free_ship (STARSHIPPTR StarShipPtr, BOOLEAN FreeBattleData);
extern void DrawCrewFuelString (COORD y, SIZE state);
extern void ClearShipStatus (COORD y);
extern void OutlineShipStatus (COORD y);
extern void InitShipStatus (STARSHIPPTR StarShipPtr, PRECT pClipRect);
extern void DeltaStatistics (STARSHIPPTR StarShipPtr, SIZE crew_delta,
SIZE energy_delta);
extern void DrawBattleCrewAmount (BOOLEAN CountPlayer);
#endif /* _BUILD_H */
+106
View File
@@ -0,0 +1,106 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "starcon.h"
#include "libs/vidlib.h"
//Added by Chris
void FreeSC2Data (void);
void FreeLanderData (void);
void FreeIPData (void);
void FreeMasterShipList (void);
void UninitSpace (void);
void FreeHyperData (void);
//End Added by Chris
void
FreeKernel (void)
{
extern void UninitPlayerInput (void);
UninitKernel (TRUE);
UninitContexts ();
UNINIT_INSTANCES ();
UninitResourceSystem ();
UninitPlayerInput ();
DestroyDrawable (ReleaseDrawable (Screen));
DestroyContext (ReleaseContext (ScreenContext));
UninitVideo ();
UninitSound ();
UninitGraphics ();
}
void
UninitContexts (void)
{
UninitQueue (&disp_q);
DestroyContext (ReleaseContext (OffScreenContext));
DestroyContext (ReleaseContext (SpaceContext));
DestroyContext (ReleaseContext (StatusContext));
}
void
UninitKernel (BOOLEAN ships)
{
extern FRAME status;
UninitSpace ();
DestroySound (ReleaseSound (MenuSounds));
DestroyFont (ReleaseFont (MicroFont));
DestroyStringTable (ReleaseStringTable (GameStrings));
DestroyDrawable (ReleaseDrawable (status));
DestroyDrawable (ReleaseDrawable (ActivityFrame));
DestroyFont (ReleaseFont (TinyFont));
DestroyFont (ReleaseFont (StarConFont));
UninitQueue (&race_q[0]);
UninitQueue (&race_q[1]);
if (ships)
FreeMasterShipList ();
ActivityFrame = 0;
}
void UninitGameKernel ()
{
if (ActivityFrame)
{
FreeSC2Data ();
FreeLanderData ();
FreeIPData ();
FreeHyperData ();
UninitKernel (FALSE);
UninitContexts ();
}
}
+341
View File
@@ -0,0 +1,341 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "starcon.h"
#define IsLeapYear(yi) (!((yi) & 3) && (((yi) % 100) || ((yi) % 400)))
int clock_task_func(void* blah)
{
BOOLEAN LastPilot;
DWORD LastTime;
BYTE days_in_month[12] =
{
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
};
COUNT cycle_index, delay_count;
COLOR cycle_tab[] =
{
BUILD_COLOR (MAKE_RGB15 (0xA, 0x14, 0x18), 0x5B),
BUILD_COLOR (MAKE_RGB15 (0x6, 0x10, 0x16), 0x5C),
BUILD_COLOR (MAKE_RGB15 (0x3, 0xE, 0x14), 0x5D),
BUILD_COLOR (MAKE_RGB15 (0x2, 0xC, 0x11), 0x5E),
BUILD_COLOR (MAKE_RGB15 (0x1, 0xB, 0xF), 0x5F),
BUILD_COLOR (MAKE_RGB15 (0x1, 0x9, 0xD), 0x60),
BUILD_COLOR (MAKE_RGB15 (0x0, 0x7, 0xB), 0x61),
};
#define NUM_CYCLES (sizeof (cycle_tab) / sizeof (cycle_tab[0]))
#define NUM_DELAYS 9
LastPilot = FALSE;
LastTime = 0;
cycle_index = delay_count = 0;
while (GLOBAL (GameClock).day_in_ticks == 0)
TaskSwitch ();
for (;;)
{
BOOLEAN OnAutoPilot;
DWORD TimeIn;
/* use semaphore so that time passage
* can be halted. (e.g. during battle
* or communications)
*/
TimeIn = SetSemaphore (&GLOBAL (GameClock).clock_sem);
if (GLOBAL (GameClock).tick_count <= 0
&& (GLOBAL (GameClock).tick_count = GLOBAL (GameClock).day_in_ticks) > 0)
{
if (GLOBAL (GameClock).month_index == 2)
{
if (IsLeapYear (GLOBAL (GameClock).year_index))
days_in_month[1] = 29; /* leap year */
else
days_in_month[1] = 28;
}
if (++GLOBAL (GameClock).day_index > days_in_month[GLOBAL (GameClock).month_index - 1])
{
GLOBAL (GameClock).day_index = 1;
if (++GLOBAL (GameClock).month_index > 12)
{
GLOBAL (GameClock).month_index = 1;
++GLOBAL (GameClock).year_index;
}
}
SetSemaphore (&GraphicsSem);
DrawStatusMessage (NULL_PTR);
{
HEVENT hEvent;
while ((hEvent = GetHeadEvent ()))
{
EVENTPTR EventPtr;
LockEvent (hEvent, &EventPtr);
if (GLOBAL (GameClock).day_index != EventPtr->day_index
|| GLOBAL (GameClock).month_index != EventPtr->month_index
|| GLOBAL (GameClock).year_index != EventPtr->year_index)
{
UnlockEvent (hEvent);
break;
}
RemoveEvent (hEvent);
EventHandler (EventPtr->func_index);
UnlockEvent (hEvent);
FreeEvent (hEvent);
}
}
ClearSemaphore (&GraphicsSem);
}
OnAutoPilot = (BOOLEAN)(
(GLOBAL (autopilot.x) != ~0
&& GLOBAL (autopilot.y) != ~0)
|| GLOBAL_SIS (FuelOnBoard) == 0
);
if (OnAutoPilot || OnAutoPilot != LastPilot)
{
COUNT num_ticks;
num_ticks = (COUNT)(SetSemaphore (&GraphicsSem) - LastTime);
if (!OnAutoPilot)
{
DrawSISMessage (NULL_PTR);
cycle_index = delay_count = 0;
}
else if (delay_count > num_ticks)
{
delay_count -= num_ticks;
}
else
{
if (!(GLOBAL (CurrentActivity) & CHECK_ABORT)
&& GLOBAL_SIS (CrewEnlisted) != (COUNT)~0)
{
CONTEXT OldContext;
OldContext = SetContext (OffScreenContext);
SetContextForeGroundColor (cycle_tab[cycle_index]);
DrawSISMessage ((UNICODE *)~0L);
SetContext (OldContext);
}
cycle_index = (cycle_index + 1) % NUM_CYCLES;
delay_count = NUM_DELAYS;
}
ClearSemaphore (&GraphicsSem);
LastPilot = OnAutoPilot;
LastTime += num_ticks;
}
ClearSemaphore (&GLOBAL (GameClock).clock_sem);
SleepTask (TimeIn + 1);
}
(void) blah; /* Satisfying compiler (unused parameter) */
return(0);
}
BOOLEAN
InitGameClock (void)
{
if (!InitQueue (&GLOBAL (GameClock.event_q), NUM_EVENTS, sizeof (EVENT)))
return (FALSE);
GLOBAL (GameClock.month_index) = 2;
GLOBAL (GameClock.day_index) = 17;
GLOBAL (GameClock.year_index) = START_YEAR; /* Feb 17, START_YEAR */
GLOBAL (GameClock).tick_count = GLOBAL (GameClock).day_in_ticks = 0;
SuspendGameClock ();
if ((GLOBAL (GameClock.clock_task) =
AddTask (clock_task_func, 2048)) == 0)
return (FALSE);
return (TRUE);
}
BOOLEAN
UninitGameClock (void)
{
if (GLOBAL (GameClock.clock_task))
{
if (!GameClockRunning ())
ResumeGameClock ();
SetSemaphore (&GLOBAL (GameClock.clock_sem));
DeleteTask (GLOBAL (GameClock.clock_task));
ClearSemaphore (&GLOBAL (GameClock.clock_sem));
GLOBAL (GameClock.clock_task) = 0;
}
UninitQueue (&GLOBAL (GameClock.event_q));
return (TRUE);
}
void
SuspendGameClock (void)
{
SetSemaphore (&GLOBAL (GameClock.clock_sem));
GLOBAL (GameClock.TimeCounter) = 0;
}
void
ResumeGameClock (void)
{
GLOBAL (GameClock.TimeCounter) = GetTimeCounter ();
ClearSemaphore (&GLOBAL (GameClock.clock_sem));
}
BOOLEAN
GameClockRunning (void)
{
return ((BOOLEAN)(GLOBAL (GameClock.TimeCounter) != 0));
}
void
SetGameClockRate (COUNT seconds_per_day)
{
SIZE new_day_in_ticks, new_tick_count;
//if (GLOBAL (GameClock.clock_sem)) printf ("%u\n", GLOBAL (GameClock.clock_sem));
SetSemaphore (&GLOBAL (GameClock.clock_sem));
new_day_in_ticks = (SIZE)(seconds_per_day * (ONE_SECOND / 5));
if (GLOBAL (GameClock.day_in_ticks) == 0)
new_tick_count = new_day_in_ticks;
else if (GLOBAL (GameClock.tick_count) <= 0)
new_tick_count = 0;
else if ((new_tick_count = (SIZE)((DWORD)GLOBAL (GameClock.tick_count)
* new_day_in_ticks / GLOBAL (GameClock.day_in_ticks))) == 0)
new_tick_count = 1;
GLOBAL (GameClock.day_in_ticks) = new_day_in_ticks;
GLOBAL (GameClock.tick_count) = new_tick_count;
ClearSemaphore (&GLOBAL (GameClock.clock_sem));
}
BOOLEAN
ValidateEvent (EVENT_TYPE type, PCOUNT pmonth_index, PCOUNT pday_index,
PCOUNT pyear_index)
{
COUNT month_index, day_index, year_index;
month_index = *pmonth_index;
day_index = *pday_index;
year_index = *pyear_index;
if (type == RELATIVE_EVENT)
{
BYTE days_in_month[12] =
{
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
};
month_index += GLOBAL (GameClock.month_index) - 1;
year_index += GLOBAL (GameClock.year_index) + (month_index / 12);
month_index = (month_index % 12) + 1;
if (IsLeapYear (year_index))
days_in_month[1] = 29; /* leap year */
day_index += GLOBAL (GameClock.day_index);
while (day_index > days_in_month[month_index - 1])
{
day_index -= days_in_month[month_index - 1];
if (++month_index > 12)
{
month_index = 1;
++year_index;
if (IsLeapYear (year_index))
days_in_month[1] = 29; /* leap year */
else
days_in_month[1] = 28;
}
}
*pmonth_index = month_index;
*pday_index = day_index;
*pyear_index = year_index;
}
return (!(year_index < GLOBAL (GameClock.year_index)
|| (year_index == GLOBAL (GameClock.year_index)
&& (month_index < GLOBAL (GameClock.month_index)
|| (month_index == GLOBAL (GameClock.month_index)
&& day_index < GLOBAL (GameClock.day_index))))));
}
HEVENT
AddEvent (EVENT_TYPE type, COUNT month_index, COUNT day_index, COUNT
year_index, BYTE func_index)
{
HEVENT hNewEvent;
if (type == RELATIVE_EVENT
&& month_index == 0
&& day_index == 0
&& year_index == 0)
EventHandler (func_index);
else if (ValidateEvent (type, &month_index, &day_index, &year_index)
&& (hNewEvent = AllocEvent ()))
{
EVENTPTR EventPtr;
LockEvent (hNewEvent, &EventPtr);
EventPtr->day_index = (BYTE)day_index;
EventPtr->month_index = (BYTE)month_index;
EventPtr->year_index = year_index;
EventPtr->func_index = func_index;
UnlockEvent (hNewEvent);
{
HEVENT hEvent, hSuccEvent;
for (hEvent = GetHeadEvent (); hEvent != 0; hEvent = hSuccEvent)
{
LockEvent (hEvent, &EventPtr);
if (year_index < EventPtr->year_index
|| (year_index == EventPtr->year_index
&& (month_index < EventPtr->month_index
|| (month_index == EventPtr->month_index
&& day_index < EventPtr->day_index))))
{
UnlockEvent (hEvent);
break;
}
hSuccEvent = GetSuccEvent (EventPtr);
UnlockEvent (hEvent);
}
InsertEvent (hNewEvent, hEvent);
}
return (hNewEvent);
}
return (0);
}
SIZE
ClockTick (void)
{
return (--GLOBAL (GameClock.tick_count));
}
+115
View File
@@ -0,0 +1,115 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#ifndef _CLOCK_H
#define _CLOCK_H
#define START_YEAR 2155
enum
{
ARILOU_ENTRANCE_EVENT = 0,
ARILOU_EXIT_EVENT,
HYPERSPACE_ENCOUNTER_EVENT,
KOHR_AH_VICTORIOUS_EVENT,
ADVANCE_PKUNK_MISSION,
ADVANCE_THRADD_MISSION,
ZOQFOT_DISTRESS_EVENT,
ZOQFOT_DEATH_EVENT,
SHOFIXTI_RETURN_EVENT,
ADVANCE_UTWIG_SUPOX_MISSION,
KOHR_AH_GENOCIDE_EVENT,
SPATHI_SHIELD_EVENT,
ADVANCE_ILWRATH_MISSION,
ADVANCE_MYCON_MISSION,
ARILOU_UMGAH_CHECK,
YEHAT_REBEL_EVENT,
SLYLANDRO_RAMP_UP,
SLYLANDRO_RAMP_DOWN,
NUM_EVENTS
};
#define UPDATE_DAY (1 << 0)
#define UPDATE_MONTH (1 << 1)
#define UPDATE_YEAR (1 << 2)
typedef struct
{
BYTE day_index, month_index;
COUNT year_index;
SIZE tick_count, day_in_ticks;
void *clock_sem;
TASK clock_task;
DWORD TimeCounter;
QUEUE event_q;
} CLOCK_STATE;
typedef CLOCK_STATE *PCLOCK_STATE;
typedef QUEUE_HANDLE HEVENT;
typedef struct event
{
HEVENT pred, succ;
BYTE day_index, month_index;
COUNT year_index;
BYTE func_index;
} EVENT;
typedef EVENT *PEVENT;
typedef enum
{
ABSOLUTE_EVENT = 0,
RELATIVE_EVENT
} EVENT_TYPE;
#define EVENTPTR PEVENT
#define AllocEvent() AllocLink (&GLOBAL (GameClock.event_q))
#define PutEvent(h) PutQueue (&GLOBAL (GameClock.event_q), h)
#define InsertEvent(h,i) InsertQueue (&GLOBAL (GameClock.event_q), h, i)
#define GetHeadEvent() GetHeadLink (&GLOBAL (GameClock.event_q))
#define GetTailEvent() GetTailLink (&GLOBAL (GameClock.event_q))
#define LockEvent(h,eptr) *(eptr) = (EVENTPTR)LockLink (&GLOBAL (GameClock.event_q), h)
#define UnlockEvent(h) UnlockLink (&GLOBAL (GameClock.event_q), h)
#define RemoveEvent(h) RemoveQueue (&GLOBAL (GameClock.event_q), h)
#define FreeEvent(h) FreeLink (&GLOBAL (GameClock.event_q), h)
#define GetPredEvent(l) _GetPredLink (l)
#define GetSuccEvent(l) _GetSuccLink (l)
/* rates are in seconds per game day */
#define HYPERSPACE_CLOCK_RATE 5
#define INTERPLANETARY_CLOCK_RATE 30
extern BOOLEAN InitGameClock (void);
extern BOOLEAN UninitGameClock (void);
extern void SuspendGameClock (void);
extern void ResumeGameClock (void);
extern BOOLEAN GameClockRunning (void);
extern void SetGameClockRate (COUNT seconds_per_day);
extern BOOLEAN ValidateEvent (EVENT_TYPE type, PCOUNT pmonth_index,
PCOUNT pday_index, PCOUNT pyear_index);
extern HEVENT AddEvent (EVENT_TYPE type, COUNT month_index, COUNT
day_index, COUNT year_index, BYTE func_index);
extern void EventHandler (BYTE selector);
extern SIZE ClockTick (void);
#endif /* _CLOCK_H */
+46
View File
@@ -0,0 +1,46 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#ifndef _CODERES_H
#define _CODERES_H
#include "reslib.h"
#include "vargs.h"
typedef DWORD (*GLUEFUNC) (COUNT selector, vararg_dcl args, ...);
extern MEM_HANDLE LoadCodeResFile (PSTR pStr);
extern BOOLEAN InstallCodeResType (COUNT code_type);
extern MEM_HANDLE LoadCodeResInstance (RESOURCE res);
extern PVOID CaptureCodeRes (MEM_HANDLE hCode, PVOID pData, PVOID
*ppLocData, GLUEFUNC glue_func);
extern MEM_HANDLE ReleaseCodeRes (PVOID CodeRef);
extern BOOLEAN DestroyCodeRes (MEM_HANDLE hCode);
typedef struct
{
MEM_HANDLE hCode;
UWORD size;
} CODE_REF;
typedef CODE_REF *PCODE_REF;
#define ORG_OFFSET (((sizeof (CODE_REF) + (PARAGRAPH_SIZE - 1)) \
/ PARAGRAPH_SIZE) * PARAGRAPH_SIZE)
#endif /* _CODERES_H */
+175
View File
@@ -0,0 +1,175 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "starcon.h"
/* #define DEBUG */
void
collide (ELEMENTPTR ElementPtr0, ELEMENTPTR ElementPtr1)
{
SIZE speed;
SIZE dx0, dy0, dx1, dy1, dx_rel, dy_rel;
SIZE TravelAngle0, TravelAngle1, ImpactAngle0, ImpactAngle1;
SIZE RelTravelAngle, Directness;
dx_rel = ElementPtr0->next.location.x
- ElementPtr1->next.location.x;
dy_rel = ElementPtr0->next.location.y
- ElementPtr1->next.location.y;
ImpactAngle0 = ARCTAN (dx_rel, dy_rel);
ImpactAngle1 = NORMALIZE_ANGLE (ImpactAngle0 + HALF_CIRCLE);
GetCurrentVelocityComponents (&ElementPtr0->velocity, &dx0, &dy0);
TravelAngle0 = GetVelocityTravelAngle (&ElementPtr0->velocity);
GetCurrentVelocityComponents (&ElementPtr1->velocity, &dx1, &dy1);
TravelAngle1 = GetVelocityTravelAngle (&ElementPtr1->velocity);
dx_rel = dx0 - dx1;
dy_rel = dy0 - dy1;
RelTravelAngle = ARCTAN (dx_rel, dy_rel);
speed = square_root ((long)dx_rel * dx_rel + (long)dy_rel * dy_rel);
Directness = NORMALIZE_ANGLE (RelTravelAngle - ImpactAngle0);
if (Directness <= QUADRANT || Directness >= HALF_CIRCLE + QUADRANT)
/* shapes just scraped each other but still collided,
* they will collide again unless we fudge it.
*/
{
Directness = HALF_CIRCLE;
ImpactAngle0 = TravelAngle0 + HALF_CIRCLE;
ImpactAngle1 = TravelAngle1 + HALF_CIRCLE;
}
#ifdef DEBUG
printf ("Centers: <%d, %d> <%d, %d>\n",
ElementPtr0->next.location.x, ElementPtr0->next.location.y,
ElementPtr1->next.location.x, ElementPtr1->next.location.y);
printf ("RelTravelAngle : %d, ImpactAngles <%d, %d>\n",
RelTravelAngle, ImpactAngle0, ImpactAngle1);
#endif /* DEBUG */
if (ElementPtr0->next.location.x == ElementPtr0->current.location.x
&& ElementPtr0->next.location.y == ElementPtr0->current.location.y
&& ElementPtr1->next.location.x == ElementPtr1->current.location.x
&& ElementPtr1->next.location.y == ElementPtr1->current.location.y)
{
if (ElementPtr0->state_flags & ElementPtr1->state_flags & DEFY_PHYSICS)
{
ImpactAngle0 = TravelAngle0 + (HALF_CIRCLE - OCTANT);
ImpactAngle1 = TravelAngle1 + (HALF_CIRCLE - OCTANT);
ZeroVelocityComponents (&ElementPtr0->velocity);
ZeroVelocityComponents (&ElementPtr1->velocity);
}
ElementPtr0->state_flags |= (DEFY_PHYSICS | COLLISION);
ElementPtr1->state_flags |= (DEFY_PHYSICS | COLLISION);
#ifdef DEBUG
printf ("No movement before collision -- <(%d, %d) = %d, (%d, %d) = %d>\n",
dx0, dy0, ImpactAngle0 - OCTANT, dx1, dy1, ImpactAngle1 - OCTANT);
#endif /* DEBUG */
}
{
SIZE mass0, mass1;
long scalar;
mass0 = ElementPtr0->mass_points /* << 2 */;
mass1 = ElementPtr1->mass_points /* << 2 */;
scalar = (long)SINE (Directness, speed << 1) * (mass0 * mass1);
if (!GRAVITY_MASS (ElementPtr0->mass_points + 1))
{
if (ElementPtr0->state_flags & PLAYER_SHIP)
{
STARSHIPPTR StarShipPtr;
GetElementStarShip (ElementPtr0, &StarShipPtr);
StarShipPtr->cur_status_flags &=
~(SHIP_AT_MAX_SPEED | SHIP_BEYOND_MAX_SPEED);
if (!(ElementPtr0->state_flags & DEFY_PHYSICS))
{
if (ElementPtr0->turn_wait < COLLISION_TURN_WAIT)
ElementPtr0->turn_wait += COLLISION_TURN_WAIT;
if (ElementPtr0->thrust_wait < COLLISION_THRUST_WAIT)
ElementPtr0->thrust_wait += COLLISION_THRUST_WAIT;
}
}
speed = (SIZE)(scalar / ((long)mass0 * (mass0 + mass1)));
DeltaVelocityComponents (&ElementPtr0->velocity,
COSINE (ImpactAngle0, speed),
SINE (ImpactAngle0, speed));
GetCurrentVelocityComponents (&ElementPtr0->velocity, &dx0, &dy0);
if (dx0 < 0)
dx0 = -dx0;
if (dy0 < 0)
dy0 = -dy0;
if (VELOCITY_TO_WORLD (dx0 + dy0) < SCALED_ONE)
SetVelocityComponents (&ElementPtr0->velocity,
COSINE (ImpactAngle0,
WORLD_TO_VELOCITY (SCALED_ONE) - 1),
SINE (ImpactAngle0,
WORLD_TO_VELOCITY (SCALED_ONE) - 1));
}
if (!GRAVITY_MASS (ElementPtr1->mass_points + 1))
{
if (ElementPtr1->state_flags & PLAYER_SHIP)
{
STARSHIPPTR StarShipPtr;
GetElementStarShip (ElementPtr1, &StarShipPtr);
StarShipPtr->cur_status_flags &=
~(SHIP_AT_MAX_SPEED | SHIP_BEYOND_MAX_SPEED);
if (!(ElementPtr1->state_flags & DEFY_PHYSICS))
{
if (ElementPtr1->turn_wait < COLLISION_TURN_WAIT)
ElementPtr1->turn_wait += COLLISION_TURN_WAIT;
if (ElementPtr1->thrust_wait < COLLISION_THRUST_WAIT)
ElementPtr1->thrust_wait += COLLISION_THRUST_WAIT;
}
}
speed = (SIZE)(scalar / ((long)mass1 * (mass0 + mass1)));
DeltaVelocityComponents (&ElementPtr1->velocity,
COSINE (ImpactAngle1, speed),
SINE (ImpactAngle1, speed));
GetCurrentVelocityComponents (&ElementPtr1->velocity, &dx1, &dy1);
if (dx1 < 0)
dx1 = -dx1;
if (dy1 < 0)
dy1 = -dy1;
if (VELOCITY_TO_WORLD (dx1 + dy1) < SCALED_ONE)
SetVelocityComponents (&ElementPtr1->velocity,
COSINE (ImpactAngle1,
WORLD_TO_VELOCITY (SCALED_ONE) - 1),
SINE (ImpactAngle1,
WORLD_TO_VELOCITY (SCALED_ONE) - 1));
}
#ifdef DEBUG
GetCurrentVelocityComponents (&ElementPtr0->velocity, &dx0, &dy0);
GetCurrentVelocityComponents (&ElementPtr1->velocity, &dx1, &dy1);
printf ("After: <%d, %d> <%d, %d>\n\n",
dx0, dy0, dx1, dy1);
#endif /* DEBUG */
}
}
+61
View File
@@ -0,0 +1,61 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#ifndef _COLLIDE_H
#define _COLLIDE_H
#define COLLISION_TURN_WAIT 1
#define COLLISION_THRUST_WAIT 3
#define SKIP_COLLISION (NONSOLID | DISAPPEARING)
#define CollidingElement(e) \
(!((e)->state_flags & SKIP_COLLISION))
#define CollisionPossible(e0,e1) \
(CollidingElement (e0) \
&& (!(((e1)->state_flags & (e0)->state_flags) & COLLISION) \
&& ((!(((e1)->state_flags & (e0)->state_flags) & IGNORE_SIMILAR) \
|| (e1)->pParent != (e0)->pParent)) \
&& ((e1)->mass_points || (e0)->mass_points)))
#define InitIntersectStartPoint(eptr) \
{ \
(eptr)->IntersectControl.IntersectStamp.origin.x = \
WORLD_TO_DISPLAY ((eptr)->current.location.x); \
(eptr)->IntersectControl.IntersectStamp.origin.y = \
WORLD_TO_DISPLAY ((eptr)->current.location.y); \
}
#define InitIntersectEndPoint(eptr) \
{ \
(eptr)->IntersectControl.EndPoint.x = \
WORLD_TO_DISPLAY ((eptr)->next.location.x); \
(eptr)->IntersectControl.EndPoint.y = \
WORLD_TO_DISPLAY ((eptr)->next.location.y); \
}
#define InitIntersectFrame(eptr) \
{ \
(eptr)->IntersectControl.IntersectStamp.frame = \
SetEquFrameIndex ((eptr)->next.image.farray[0], \
(eptr)->next.image.frame); \
}
extern void collide (ELEMENTPTR ElementPtr0, ELEMENTPTR ElementPtr1);
#endif /* _COLLIDE_H */
File diff suppressed because it is too large Load Diff
+30
View File
@@ -0,0 +1,30 @@
# Automake template file.
# Written by Mudry <mudry@user.sf.net>, protected by GNU GPL.
# CVS $ Id: $
RACES = \
arilou blackur chmmr comandr druuge ilwrath melnorm mycon orz pkunk \
rebel shofixt slyhome slyland spahome spathi starbas supox syreen \
talkpet thradd umgah urquan utwig vux yehat zoqfot
EXTRA_DIRS = $(RACES)
INCLUDES = @SDL_CFLAGS@ @SMPEG_CFLAGS@ \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/sc2code \
-I$(top_srcdir)/src/sc2code/libs
noinst_LTLIBRARIES = libcomm.la
libcomm_la_LIBADD = $(patsubst %.c, %.lo, $(wildcard */*.c))
libcomm_la_SOURCES = dummy.c
%.lo: %.c
$(COMPILE) -c $< -o $@
clean: clean-am
rm -f */*.{o,lo}
distclean: distclean-am
rm -f */*.{o,lo}
+10
View File
@@ -0,0 +1,10 @@
INCLUDE ../../star3do.typ
PATH comm/arilou
PACKAGE ARILOU_PACKAGE arilou.con
GFXRES ARILOU_PMAP_ANIM arilou.ani
FONTRES ARILOU_FONT arilou.fon
MUSICRES ARILOU_MUSIC arilou.mod
STRTAB ARILOU_CONVERSATION_PHRASES arilou.txt
+833
View File
@@ -0,0 +1,833 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "reslib.h"
#include "comm/arilou/resinst.h"
#include "starcon.h"
#include "commglue.h"
#include "comm/arilou/strings.h"
static LOCDATA arilou_desc =
{
NULL_PTR, /* init_encounter_func */
NULL_PTR, /* uninit_encounter_func */
(FRAME)ARILOU_PMAP_ANIM, /* AlienFrame */
(FONT)ARILOU_FONT, /* AlienFont */
WHITE_COLOR, /* AlienTextFColor */
BLACK_COLOR, /* AlienTextBColor */
0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */
0, /* AlienColorMap */
ARILOU_MUSIC, /* AlienSong */
ARILOU_CONVERSATION_PHRASES, /* PlayerPhrases */
20, /* NumAnimations */
{
{
4, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 1) | (1L << 16)
},
{
13, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 0) | (1L << 16)
},
{
22, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1L << 16)
},
{
31, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 4)
},
{
40, /* StartIndex */
10, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 3)
},
{
50, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 7)
},
{
59, /* StartIndex */
8, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
67, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 5)
},
{
76, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 9)
},
{
85, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 8)
},
{
94, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
103, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 13)
},
{
112, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
121, /* StartIndex */
8, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 11)
},
{
129, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1L << 15)
},
{
138, /* StartIndex */
8, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 14)
},
{
146, /* StartIndex */
9, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
4, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
(1 << 0) | (1 << 1) | (1 << 2)
},
{
155, /* StartIndex */
2, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
8, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
157, /* StartIndex */
2, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
8, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
159, /* StartIndex */
4, /* NumFrames */
CIRCULAR_ANIM | WAIT_TALKING,/* AnimFlags */
10, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
},
{
0, /* StartIndex */
0, /* NumFrames */
0, /* AnimFlags */
0, 0, /* FrameRate */
0, 0, /* RestartRate */
},
{
1, /* StartIndex */
3, /* NumFrames */
0, /* AnimFlags */
8, 0, /* FrameRate */
10, 0, /* RestartRate */
},
};
static void
ExitConversation (RESPONSE_REF R)
{
SET_GAME_STATE (BATTLE_SEGUE, 0);
if (PLAYER_SAID (R, bye_angry_space))
NPCPhrase (GOODBYE_ANGRY_SPACE);
else if (PLAYER_SAID (R, bye_friendly_space))
NPCPhrase (GOODBYE_FRIENDLY_SPACE);
else if (PLAYER_SAID (R, bye_friendly_homeworld))
NPCPhrase (GOODBYE_FRDLY_HOMEWORLD);
else if (PLAYER_SAID (R, lets_fight))
NPCPhrase (NO_FIGHT);
else if (PLAYER_SAID (R, bug_eyed_fruitcakes))
{
NPCPhrase (WE_NEVER_FRIENDS);
SET_GAME_STATE (ARILOU_MANNER, 2);
}
else if (PLAYER_SAID (R, best_if_i_killed_you))
{
NPCPhrase (WICKED_HUMAN);
SET_GAME_STATE (ARILOU_MANNER, 2);
}
}
static void
ArilouHome (RESPONSE_REF R)
{
BYTE i, LastStack;
RESPONSE_REF pStr[4];
LastStack = 0;
pStr[0] = pStr[1] = pStr[2] = pStr[3] = 0;
if (PLAYER_SAID (R, confused_by_hello))
NPCPhrase (CONFUSED_RESPONSE);
else if (PLAYER_SAID (R, happy_by_hello))
NPCPhrase (HAPPY_RESPONSE);
else if (PLAYER_SAID (R, miffed_by_hello))
NPCPhrase (MIFFED_RESPONSE);
else if (PLAYER_SAID (R, ok_lets_be_friends))
NPCPhrase (NO_ALLY_BUT_MUCH_GIVE);
else if (PLAYER_SAID (R, what_about_war))
{
NPCPhrase (ABOUT_WAR);
SET_GAME_STATE (ARILOU_STACK_1, 1);
}
else if (PLAYER_SAID (R, what_about_urquan))
{
NPCPhrase (ABOUT_URQUAN);
SET_GAME_STATE (ARILOU_STACK_1, 2);
}
else if (PLAYER_SAID (R, tell_arilou_about_tpet))
{
NPCPhrase (BAD_NEWS_ABOUT_TPET);
LastStack = 1;
SET_GAME_STATE (ARILOU_STACK_2, 1);
}
else if (PLAYER_SAID (R, what_do_about_tpet))
{
NPCPhrase (DANGEROUS_BUT_USEFUL);
LastStack = 1;
SET_GAME_STATE (ARILOU_STACK_2, 2);
}
else if (PLAYER_SAID (R, learned_about_umgah))
{
if (GET_GAME_STATE (ARILOU_CHECKED_UMGAH) != 2)
NPCPhrase (NO_NEWS_YET);
else
{
NPCPhrase (UMGAH_UNDER_COMPULSION);
LastStack = 1;
}
DISABLE_PHRASE (learned_about_umgah);
}
else if (PLAYER_SAID (R, umgah_acting_weird))
{
NPCPhrase (WELL_GO_CHECK);
SET_GAME_STATE (ARILOU_CHECKED_UMGAH, 1);
AddEvent (RELATIVE_EVENT, 0, 10, 0, ARILOU_UMGAH_CHECK);
DISABLE_PHRASE (umgah_acting_weird);
}
else if (PLAYER_SAID (R, what_do_now))
{
NPCPhrase (GO_FIND_OUT);
SET_GAME_STATE (ARILOU_CHECKED_UMGAH, 3);
}
else if (PLAYER_SAID (R, what_did_on_earth))
{
NPCPhrase (DID_THIS);
LastStack = 2;
SET_GAME_STATE (ARILOU_STACK_3, 1);
}
else if (PLAYER_SAID (R, why_did_this))
{
NPCPhrase (IDF_PARASITES);
LastStack = 2;
SET_GAME_STATE (ARILOU_STACK_3, 2);
}
else if (PLAYER_SAID (R, tell_more))
{
NPCPhrase (NOT_NOW);
LastStack = 2;
SET_GAME_STATE (ARILOU_STACK_3, 3);
}
else if (PLAYER_SAID (R, what_give_me))
{
NPCPhrase (ABOUT_PORTAL);
LastStack = 3;
SET_GAME_STATE (KNOW_ARILOU_WANT_WRECK, 1);
R = about_portal_again;
DISABLE_PHRASE (what_give_me);
}
else if (PLAYER_SAID (R, what_about_tpet))
{
NPCPhrase (ABOUT_TPET);
SET_GAME_STATE (ARILOU_STACK_4, 1);
}
else if (PLAYER_SAID (R, about_portal_again))
{
NPCPhrase (PORTAL_AGAIN);
DISABLE_PHRASE (about_portal_again);
}
else if (PLAYER_SAID (R, got_it))
{
if (GET_GAME_STATE (ARILOU_HOME_VISITS) == 1)
NPCPhrase (CLEVER_HUMAN);
NPCPhrase (GIVE_PORTAL);
SET_GAME_STATE (PORTAL_KEY_ON_SHIP, 0);
SET_GAME_STATE (PORTAL_SPAWNER, 1);
SET_GAME_STATE (PORTAL_SPAWNER_ON_SHIP, 1);
}
#ifdef NEVER
else if (PLAYER_SAID (R, got_tpet))
{
NPCPhrase (OK_GOT_TPET);
SET_GAME_STATE (ARILOU_STACK_2, 1);
}
#endif /* NEVER */
switch (GET_GAME_STATE (ARILOU_STACK_1))
{
case 0:
pStr[0] = what_about_war;
break;
case 1:
pStr[0] = what_about_urquan;
break;
}
if (GET_GAME_STATE (TALKING_PET))
{
#ifdef NEVER
if (GET_GAME_STATE (ARILOU_STACK_2) == 0)
pStr[1] = got_tpet;
#endif /* NEVER */
}
else
{
if (GET_GAME_STATE (TALKING_PET_VISITS))
{
switch (GET_GAME_STATE (ARILOU_STACK_2))
{
case 0:
pStr[1] = tell_arilou_about_tpet;
break;
case 1:
pStr[1] = what_do_about_tpet;
break;
}
}
else if (GET_GAME_STATE (KNOW_UMGAH_ZOMBIES))
{
if (!GET_GAME_STATE (ARILOU_CHECKED_UMGAH))
pStr[1] = umgah_acting_weird;
else if (PHRASE_ENABLED (learned_about_umgah) && PHRASE_ENABLED (umgah_acting_weird))
pStr[1] = learned_about_umgah;
else if (GET_GAME_STATE (ARILOU_CHECKED_UMGAH) == 2)
pStr[1] = what_do_now;
}
}
switch (GET_GAME_STATE (ARILOU_STACK_3))
{
case 0:
pStr[2] = what_did_on_earth;
break;
case 1:
pStr[2] = why_did_this;
break;
case 2:
pStr[2] = tell_more;
break;
}
if (!GET_GAME_STATE (KNOW_ARILOU_WANT_WRECK))
pStr[3] = what_give_me;
else if (!GET_GAME_STATE (ARILOU_STACK_4))
pStr[3] = what_about_tpet;
if (pStr[LastStack])
Response (pStr[LastStack], ArilouHome);
for (i = 0; i < 4; ++i)
{
if (i != LastStack && pStr[i])
Response (pStr[i], ArilouHome);
}
if (GET_GAME_STATE (KNOW_ARILOU_WANT_WRECK))
{
if (GET_GAME_STATE (PORTAL_KEY_ON_SHIP))
Response (got_it, ArilouHome);
else if (PHRASE_ENABLED (about_portal_again) && !GET_GAME_STATE (PORTAL_SPAWNER))
Response (about_portal_again, ArilouHome);
}
if (GET_GAME_STATE (ARILOU_MANNER) != 3)
Response (best_if_i_killed_you, ExitConversation);
Response (bye_friendly_homeworld, ExitConversation);
}
static void
AngryHomeArilou (RESPONSE_REF R)
{
if (PLAYER_SAID (R, invaders_from_mars))
{
NPCPhrase (HAD_OUR_REASONS);
DISABLE_PHRASE (invaders_from_mars);
}
else if (PLAYER_SAID (R, why_should_i_trust))
{
NPCPhrase (TRUST_BECAUSE);
DISABLE_PHRASE (why_should_i_trust);
}
else if (PLAYER_SAID (R, what_about_interference))
{
NPCPhrase (INTERFERENCE_NECESSARY);
DISABLE_PHRASE (what_about_interference);
}
else if (PLAYER_SAID (R, i_just_like_to_leave))
{
NPCPhrase (SORRY_NO_LEAVE);
DISABLE_PHRASE (i_just_like_to_leave);
}
if (PHRASE_ENABLED (invaders_from_mars))
Response (invaders_from_mars, AngryHomeArilou);
else
{
Response (bug_eyed_fruitcakes, ExitConversation);
}
if (PHRASE_ENABLED (why_should_i_trust))
Response (why_should_i_trust, AngryHomeArilou);
else if (PHRASE_ENABLED (what_about_interference))
Response (what_about_interference, AngryHomeArilou);
Response (ok_lets_be_friends, ArilouHome);
Response (i_just_like_to_leave, AngryHomeArilou);
}
static void
AngrySpaceArilou (RESPONSE_REF R)
{
if (PLAYER_SAID (R, im_sorry))
{
NPCPhrase (APOLOGIZE_AT_HOMEWORLD);
DISABLE_PHRASE (im_sorry);
}
Response (lets_fight, ExitConversation);
if (PHRASE_ENABLED (im_sorry))
{
Response (im_sorry, AngrySpaceArilou);
}
Response (bye_angry_space, ExitConversation);
}
static void
FriendlySpaceArilou (RESPONSE_REF R)
{
BYTE NumVisits;
if (PLAYER_SAID (R, confused_by_hello))
NPCPhrase (CONFUSED_RESPONSE);
else if (PLAYER_SAID (R, happy_by_hello))
NPCPhrase (HAPPY_RESPONSE);
else if (PLAYER_SAID (R, miffed_by_hello))
NPCPhrase (MIFFED_RESPONSE);
else if (PLAYER_SAID (R, whats_up_1)
|| PLAYER_SAID (R, whats_up_2))
{
NumVisits = GET_GAME_STATE (ARILOU_INFO);
switch (NumVisits++)
{
case 0:
NPCPhrase (GENERAL_INFO_1);
break;
case 1:
NPCPhrase (GENERAL_INFO_2);
break;
case 2:
NPCPhrase (GENERAL_INFO_3);
break;
case 3:
NPCPhrase (GENERAL_INFO_4);
--NumVisits;
break;
}
SET_GAME_STATE (ARILOU_INFO, NumVisits);
DISABLE_PHRASE (whats_up_2);
}
else if (PLAYER_SAID (R, why_you_here))
{
NPCPhrase (LEARN_THINGS);
SET_GAME_STATE (ARILOU_STACK_5, 1);
}
else if (PLAYER_SAID (R, what_things))
{
NPCPhrase (THESE_THINGS);
SET_GAME_STATE (ARILOU_STACK_5, 2);
}
else if (PLAYER_SAID (R, why_do_it))
{
NPCPhrase (DO_IT_BECAUSE);
SET_GAME_STATE (ARILOU_STACK_5, 3);
}
else if (PLAYER_SAID (R, give_me_info_1)
|| PLAYER_SAID (R, give_me_info_2))
{
NumVisits = GET_GAME_STATE (ARILOU_HINTS);
switch (NumVisits++)
{
case 0:
NPCPhrase (ARILOU_HINTS_1);
break;
case 1:
NPCPhrase (ARILOU_HINTS_2);
if (GET_GAME_STATE (KNOW_ABOUT_SHATTERED) < 2)
{
SET_GAME_STATE (KNOW_ABOUT_SHATTERED, 2);
}
break;
case 2:
NPCPhrase (ARILOU_HINTS_3);
SET_GAME_STATE (KNOW_URQUAN_STORY, 1);
SET_GAME_STATE (KNOW_KOHR_AH_STORY, 1)
break;
case 3:
NPCPhrase (ARILOU_HINTS_4);
--NumVisits;
break;
}
SET_GAME_STATE (ARILOU_HINTS, NumVisits);
DISABLE_PHRASE (give_me_info_2);
}
switch (GET_GAME_STATE (ARILOU_STACK_5))
{
case 0:
Response (why_you_here, FriendlySpaceArilou);
break;
case 1:
Response (what_things, FriendlySpaceArilou);
break;
case 2:
Response (why_do_it, FriendlySpaceArilou);
break;
}
if (PHRASE_ENABLED (whats_up_2))
{
if (GET_GAME_STATE (ARILOU_INFO) == 0)
Response (whats_up_1, FriendlySpaceArilou);
else
Response (whats_up_2, FriendlySpaceArilou);
}
if (PHRASE_ENABLED (give_me_info_2))
{
if (GET_GAME_STATE (ARILOU_HINTS) == 0)
Response (give_me_info_1, FriendlySpaceArilou);
else
Response (give_me_info_2, FriendlySpaceArilou);
}
Response (bye_friendly_space, ExitConversation);
}
static void
Intro (void)
{
BYTE NumVisits, Manner;
if (LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
{
// NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro;
}
else if (!GET_GAME_STATE (MET_ARILOU))
{
RESPONSE_FUNC RespFunc;
NPCPhrase (INIT_HELLO);
if (GET_GAME_STATE (ARILOU_SPACE_SIDE) <= 1)
{
RespFunc = (RESPONSE_FUNC)FriendlySpaceArilou;
}
else
{
RespFunc = (RESPONSE_FUNC)ArilouHome;
SET_GAME_STATE (ARILOU_HOME_VISITS, 1);
}
Response (confused_by_hello, RespFunc);
Response (happy_by_hello, RespFunc);
Response (miffed_by_hello, RespFunc);
SET_GAME_STATE (MET_ARILOU, 1);
goto ExitIntro;
}
Manner = GET_GAME_STATE (ARILOU_MANNER);
if (Manner == 2)
{
NumVisits = GET_GAME_STATE (ARILOU_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (HOSTILE_GOODBYE_1);
break;
case 1:
NPCPhrase (HOSTILE_GOODBYE_2);
break;
case 2:
NPCPhrase (HOSTILE_GOODBYE_3);
break;
case 3:
NPCPhrase (HOSTILE_GOODBYE_4);
--NumVisits;
break;
}
SET_GAME_STATE (ARILOU_VISITS, NumVisits);
SET_GAME_STATE (BATTLE_SEGUE, 0);
}
else if (Manner == 1)
{
if (GET_GAME_STATE (ARILOU_SPACE_SIDE) > 1)
{
NPCPhrase (INIT_ANGRY_HWLD_HELLO);
SET_GAME_STATE (ARILOU_HOME_VISITS, 1);
AngryHomeArilou ((RESPONSE_REF)0);
}
else
{
NumVisits = GET_GAME_STATE (ARILOU_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (ANGRY_SPACE_HELLO_1);
break;
case 1:
NPCPhrase (ANGRY_SPACE_HELLO_2);
--NumVisits;
break;
}
SET_GAME_STATE (ARILOU_VISITS, NumVisits);
AngrySpaceArilou ((RESPONSE_REF)0);
}
}
else
{
if (GET_GAME_STATE (ARILOU_SPACE_SIDE) <= 1)
{
NumVisits = GET_GAME_STATE (ARILOU_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (FRIENDLY_SPACE_HELLO_1);
break;
case 1:
NPCPhrase (FRIENDLY_SPACE_HELLO_2);
break;
case 2:
NPCPhrase (FRIENDLY_SPACE_HELLO_3);
break;
case 3:
NPCPhrase (FRIENDLY_SPACE_HELLO_4);
--NumVisits;
break;
}
SET_GAME_STATE (ARILOU_VISITS, NumVisits);
FriendlySpaceArilou ((RESPONSE_REF)0);
}
else
{
if (!GET_GAME_STATE (PORTAL_SPAWNER)
&& GET_GAME_STATE (KNOW_ARILOU_WANT_WRECK))
{
NumVisits = GET_GAME_STATE (NO_PORTAL_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (GOT_PART_YET_1);
break;
case 1:
NPCPhrase (GOT_PART_YET_1);
--NumVisits;
break;
}
SET_GAME_STATE (NO_PORTAL_VISITS, NumVisits);
}
else
{
NumVisits = GET_GAME_STATE (ARILOU_HOME_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (FRDLY_HOMEWORLD_HELLO_1);
break;
case 1:
NPCPhrase (FRDLY_HOMEWORLD_HELLO_2);
break;
case 2:
NPCPhrase (FRDLY_HOMEWORLD_HELLO_3);
break;
case 3:
NPCPhrase (FRDLY_HOMEWORLD_HELLO_4);
--NumVisits;
break;
}
SET_GAME_STATE (ARILOU_HOME_VISITS, NumVisits);
}
ArilouHome ((RESPONSE_REF)0);
}
}
ExitIntro:
;
}
static COUNT
uninit_arilou (void)
{
BYTE Manner;
if (GET_GAME_STATE (BATTLE_SEGUE) == 1
&& (Manner = GET_GAME_STATE (ARILOU_MANNER)) != 2)
{
SET_GAME_STATE (ARILOU_MANNER, 1);
if (Manner != 1)
{
SET_GAME_STATE (ARILOU_VISITS, 0);
SET_GAME_STATE (ARILOU_HOME_VISITS, 0);
}
}
if (GET_GAME_STATE (ARILOU_SPACE_SIDE) > 1
&& GET_GAME_STATE (ARILOU_HOME_VISITS) <= 1)
{
SET_GAME_STATE (UMGAH_ZOMBIE_BLOBBIES, 1);
SET_GAME_STATE (UMGAH_VISITS, 0);
SET_GAME_STATE (UMGAH_HOME_VISITS, 0);
if (GET_GAME_STATE (ARILOU_MANNER) < 2)
{
SET_GAME_STATE (ARILOU_MANNER, 3);
}
}
return (0);
}
LOCDATAPTR
init_arilou_comm (void)
{
LOCDATAPTR retval;
arilou_desc.init_encounter_func = Intro;
arilou_desc.uninit_encounter_func = uninit_arilou;
arilou_desc.AlienTextTemplate.baseline.x =
TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
arilou_desc.AlienTextTemplate.baseline.y = 0;
arilou_desc.AlienTextTemplate.align = ALIGN_CENTER;
arilou_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;
if (GET_GAME_STATE (ARILOU_SPACE_SIDE) > 1
|| GET_GAME_STATE (ARILOU_MANNER) == 3
|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
{
SET_GAME_STATE (BATTLE_SEGUE, 0);
}
else
{
SET_GAME_STATE (BATTLE_SEGUE, 1);
}
retval = &arilou_desc;
return (retval);
}
+3
View File
@@ -0,0 +1,3 @@
#define ARILOU_FONT 0x00200003L
+3
View File
@@ -0,0 +1,3 @@
#define ARILOU_PMAP_ANIM 0x00200002L
+3
View File
@@ -0,0 +1,3 @@
#define ARILOU_MUSIC 0x00200006L
+3
View File
@@ -0,0 +1,3 @@
#define ARILOU_CONVERSATION_PHRASES 0x00200004L
+4
View File
@@ -0,0 +1,4 @@
#include "igfxres.h"
#include "ifontres.h"
#include "istrtab.h"
#include "imusicre.h"
+5
View File
@@ -0,0 +1,5 @@
enum
{
ARILOU_PACKAGE = 1
};
+17
View File
@@ -0,0 +1,17 @@
#ifndef _RESTYPES_H
#define _RESTYPES_H
enum
{
KEY_CONFIG = 1,
GFXRES,
FONTRES,
STRTAB,
SNDRES,
MUSICRES,
RES_INDEX,
CODE
};
#endif /* _RESTYPES_H */
+123
View File
@@ -0,0 +1,123 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#ifndef _STRINGS_H
#define _STRINGS_H
enum
{
NULL_PHRASE,
INIT_HELLO,
confused_by_hello,
CONFUSED_RESPONSE,
happy_by_hello,
HAPPY_RESPONSE,
miffed_by_hello,
MIFFED_RESPONSE,
FRIENDLY_SPACE_HELLO_1,
FRIENDLY_SPACE_HELLO_2,
FRIENDLY_SPACE_HELLO_3,
FRIENDLY_SPACE_HELLO_4,
FRDLY_HOMEWORLD_HELLO_1,
FRDLY_HOMEWORLD_HELLO_2,
FRDLY_HOMEWORLD_HELLO_3,
FRDLY_HOMEWORLD_HELLO_4,
whats_up_1,
whats_up_2,
GENERAL_INFO_1,
GENERAL_INFO_2,
GENERAL_INFO_3,
GENERAL_INFO_4,
why_you_here,
LEARN_THINGS,
what_things,
THESE_THINGS,
why_do_it,
DO_IT_BECAUSE,
give_me_info_1,
ARILOU_HINTS_1,
give_me_info_2,
ARILOU_HINTS_2,
ARILOU_HINTS_3,
ARILOU_HINTS_4,
bye_friendly_space,
GOODBYE_FRIENDLY_SPACE,
GOT_PART_YET_1,
GOT_PART_YET_2,
INIT_ANGRY_HWLD_HELLO,
invaders_from_mars,
HAD_OUR_REASONS,
bug_eyed_fruitcakes,
WE_NEVER_FRIENDS,
ok_lets_be_friends,
NO_ALLY_BUT_MUCH_GIVE,
why_should_i_trust,
TRUST_BECAUSE,
what_about_interference,
INTERFERENCE_NECESSARY,
i_just_like_to_leave,
SORRY_NO_LEAVE,
what_about_war,
ABOUT_WAR,
what_about_urquan,
ABOUT_URQUAN,
best_if_i_killed_you,
WICKED_HUMAN,
what_did_on_earth,
DID_THIS,
why_did_this,
IDF_PARASITES,
tell_more,
NOT_NOW,
umgah_acting_weird,
learned_about_umgah,
WELL_GO_CHECK,
NO_NEWS_YET,
UMGAH_UNDER_COMPULSION,
what_do_now,
GO_FIND_OUT,
tell_arilou_about_tpet,
BAD_NEWS_ABOUT_TPET,
what_do_about_tpet,
DANGEROUS_BUT_USEFUL,
what_give_me,
ABOUT_PORTAL,
what_about_tpet,
ABOUT_TPET,
about_portal_again,
PORTAL_AGAIN,
got_it,
CLEVER_HUMAN,
GIVE_PORTAL,
bye_friendly_homeworld,
GOODBYE_FRDLY_HOMEWORLD,
HOSTILE_GOODBYE_1,
HOSTILE_GOODBYE_2,
HOSTILE_GOODBYE_3,
HOSTILE_GOODBYE_4,
ANGRY_SPACE_HELLO_1,
ANGRY_SPACE_HELLO_2,
lets_fight,
NO_FIGHT,
im_sorry,
APOLOGIZE_AT_HOMEWORLD,
bye_angry_space,
GOODBYE_ANGRY_SPACE,
};
#endif /* _STRINGS_H */
+10
View File
@@ -0,0 +1,10 @@
INCLUDE ../../star3do.typ
PATH comm/blackur
PACKAGE BLACKURQ_PACKAGE blackur.con
GFXRES BLACKURQ_PMAP_ANIM blackur.ani
FONTRES BLACKURQ_FONT blackur.fon
MUSICRES BLACKURQ_MUSIC blackur.mod
STRTAB BLACKURQ_CONVERSATION_PHRASES blackur.txt
+547
View File
@@ -0,0 +1,547 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "reslib.h"
#include "comm/blackur/resinst.h"
#include "starcon.h"
#include "commglue.h"
#include "comm/blackur/strings.h"
static LOCDATA blackurq_desc =
{
NULL_PTR, /* init_encounter_func */
NULL_PTR, /* uninit_encounter_func */
(FRAME)BLACKURQ_PMAP_ANIM, /* AlienFrame */
(FONT)BLACKURQ_FONT, /* AlienFont */
WHITE_COLOR, /* AlienTextFColor */
BLACK_COLOR, /* AlienTextBColor */
0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */
0, /* AlienColorMap */
BLACKURQ_MUSIC, /* AlienSong */
BLACKURQ_CONVERSATION_PHRASES, /* PlayerPhrases */
8, /* NumAnimations */
{
{
7, /* StartIndex */
6, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
8, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
13, /* StartIndex */
7, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
8, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
20, /* StartIndex */
3, /* NumFrames */
YOYO_ANIM, /* AnimFlags */
8, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
23, /* StartIndex */
3, /* NumFrames */
YOYO_ANIM, /* AnimFlags */
8, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
26, /* StartIndex */
3, /* NumFrames */
YOYO_ANIM, /* AnimFlags */
8, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
29, /* StartIndex */
4, /* NumFrames */
RANDOM_ANIM, /* AnimFlags */
12, 0, /* FrameRate */
12, 0, /* RestartRate */
},
{
33, /* StartIndex */
5, /* NumFrames */
CIRCULAR_ANIM
| WAIT_TALKING, /* AnimFlags */
12, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
38, /* StartIndex */
4, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
12, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
},
{
1, /* StartIndex */
2, /* NumFrames */
0, /* AnimFlags */
20, 0, /* FrameRate */
0, 0, /* RestartRate */
},
{
2, /* StartIndex */
5, /* NumFrames */
0, /* AnimFlags */
8, 0, /* FrameRate */
10, 0, /* RestartRate */
},
};
static void
CombatIsInevitable (RESPONSE_REF R)
{
BYTE NumVisits;
SET_GAME_STATE (BATTLE_SEGUE, 1);
if (PLAYER_SAID (R, bye))
{
if (GET_GAME_STATE (KOHR_AH_BYES) == 0)
NPCPhrase (GOODBYE_AND_DIE);
else
NPCPhrase (DIE_HUMAN /* GOODBYE_AND_DIE_2 */);
SET_GAME_STATE (KOHR_AH_BYES, 1);
}
else if (PLAYER_SAID (R, guess_thats_all))
NPCPhrase (THEN_DIE);
else if (PLAYER_SAID (R, what_are_you_hovering_over))
{
NPCPhrase (BONE_PILE);
SET_GAME_STATE (KOHR_AH_INFO, 1);
}
else if (PLAYER_SAID (R, you_sure_are_creepy))
{
NPCPhrase (YES_CREEPY);
SET_GAME_STATE (KOHR_AH_INFO, 2);
}
else if (PLAYER_SAID (R, stop_that_gross_blinking))
{
NPCPhrase (DIE_HUMAN);
SET_GAME_STATE (KOHR_AH_INFO, 3);
}
else if (PLAYER_SAID (R, threat_1)
|| PLAYER_SAID (R, threat_2)
|| PLAYER_SAID (R, threat_3)
|| PLAYER_SAID (R, threat_4))
{
NumVisits = GET_GAME_STATE (KOHR_AH_REASONS);
switch (NumVisits++)
{
case 0:
NPCPhrase (RESISTANCE_IS_USELESS_1);
break;
case 1:
NPCPhrase (RESISTANCE_IS_USELESS_2);
break;
case 2:
NPCPhrase (RESISTANCE_IS_USELESS_3);
break;
case 3:
NPCPhrase (RESISTANCE_IS_USELESS_4);
--NumVisits;
break;
}
SET_GAME_STATE (KOHR_AH_REASONS, NumVisits);
}
else if (PLAYER_SAID (R, plead_1)
|| PLAYER_SAID (R, plead_2)
|| PLAYER_SAID (R, plead_3)
|| PLAYER_SAID (R, plead_4))
{
NumVisits = GET_GAME_STATE (KOHR_AH_PLEAD);
switch (NumVisits++)
{
case 0:
NPCPhrase (PLEADING_IS_USELESS_1);
break;
case 1:
NPCPhrase (PLEADING_IS_USELESS_2);
break;
case 2:
NPCPhrase (PLEADING_IS_USELESS_3);
break;
case 3:
NPCPhrase (PLEADING_IS_USELESS_4);
--NumVisits;
break;
}
SET_GAME_STATE (KOHR_AH_PLEAD, NumVisits);
}
else if (PLAYER_SAID (R, why_kill_all_1)
|| PLAYER_SAID (R, why_kill_all_2)
|| PLAYER_SAID (R, why_kill_all_3)
|| PLAYER_SAID (R, why_kill_all_4))
{
NumVisits = GET_GAME_STATE (KOHR_AH_REASONS);
switch (NumVisits++)
{
case 0:
NPCPhrase (KILL_BECAUSE_1);
break;
case 1:
NPCPhrase (KILL_BECAUSE_2);
break;
case 2:
NPCPhrase (KILL_BECAUSE_3);
break;
case 3:
NPCPhrase (KILL_BECAUSE_4);
--NumVisits;
break;
}
SET_GAME_STATE (KOHR_AH_REASONS, NumVisits);
}
else if (PLAYER_SAID (R, please_dont_kill_1)
|| PLAYER_SAID (R, please_dont_kill_2)
|| PLAYER_SAID (R, please_dont_kill_3)
|| PLAYER_SAID (R, please_dont_kill_4))
{
NumVisits = GET_GAME_STATE (KOHR_AH_PLEAD);
switch (NumVisits++)
{
case 0:
NPCPhrase (WILL_KILL_1);
break;
case 1:
NPCPhrase (WILL_KILL_2);
break;
case 2:
NPCPhrase (WILL_KILL_3);
break;
case 3:
NPCPhrase (WILL_KILL_4);
--NumVisits;
break;
}
SET_GAME_STATE (KOHR_AH_PLEAD, NumVisits);
}
else if (PLAYER_SAID (R, bye_frenzy_1)
|| PLAYER_SAID (R, bye_frenzy_2)
|| PLAYER_SAID (R, bye_frenzy_3)
|| PLAYER_SAID (R, bye_frenzy_4))
{
NumVisits = GET_GAME_STATE (KOHR_AH_INFO);
switch (NumVisits++)
{
case 0:
NPCPhrase (GOODBYE_AND_DIE_FRENZY_1);
break;
case 1:
NPCPhrase (GOODBYE_AND_DIE_FRENZY_2);
break;
case 2:
NPCPhrase (GOODBYE_AND_DIE_FRENZY_3);
break;
case 3:
NPCPhrase (GOODBYE_AND_DIE_FRENZY_4);
--NumVisits;
break;
}
SET_GAME_STATE (KOHR_AH_INFO, NumVisits);
}
}
static void
Frenzy (RESPONSE_REF R)
{
switch (GET_GAME_STATE (KOHR_AH_REASONS))
{
case 0:
Response (why_kill_all_1, CombatIsInevitable);
break;
case 1:
Response (why_kill_all_2, CombatIsInevitable);
break;
case 2:
Response (why_kill_all_3, CombatIsInevitable);
break;
case 3:
Response (why_kill_all_4, CombatIsInevitable);
break;
}
switch (GET_GAME_STATE (KOHR_AH_PLEAD))
{
case 0:
Response (please_dont_kill_1, CombatIsInevitable);
break;
case 1:
Response (please_dont_kill_2, CombatIsInevitable);
break;
case 2:
Response (please_dont_kill_3, CombatIsInevitable);
break;
case 3:
Response (please_dont_kill_4, CombatIsInevitable);
break;
}
switch (GET_GAME_STATE (KOHR_AH_INFO))
{
case 0:
Response (bye_frenzy_1, CombatIsInevitable);
break;
case 1:
Response (bye_frenzy_2, CombatIsInevitable);
break;
case 2:
Response (bye_frenzy_3, CombatIsInevitable);
break;
case 3:
Response (bye_frenzy_4, CombatIsInevitable);
break;
}
}
static void
KohrAhStory (RESPONSE_REF R)
{
//PTR_DESC PtrDesc;
if (PLAYER_SAID (R, key_phrase))
{
NPCPhrase (RESPONSE_TO_KEY_PHRASE);
SET_GAME_STATE (KNOW_KOHR_AH_STORY, 2);
}
else if (PLAYER_SAID (R, why_do_you_destroy))
{
NPCPhrase (WE_WERE_SLAVES);
DISABLE_PHRASE (why_do_you_destroy);
}
else if (PLAYER_SAID (R, relationship_with_urquan))
{
NPCPhrase (WE_ARE_URQUAN_TOO);
DISABLE_PHRASE (relationship_with_urquan);
}
else if (PLAYER_SAID (R, what_about_culture))
{
NPCPhrase (BONE_GARDENS);
DISABLE_PHRASE (what_about_culture);
}
else if (PLAYER_SAID (R, how_leave_me_alone))
{
NPCPhrase (YOU_DIE);
DISABLE_PHRASE (how_leave_me_alone);
}
if (PHRASE_ENABLED (why_do_you_destroy))
Response (why_do_you_destroy, KohrAhStory);
if (PHRASE_ENABLED (relationship_with_urquan))
Response (relationship_with_urquan, KohrAhStory);
if (PHRASE_ENABLED (what_about_culture))
Response (what_about_culture, KohrAhStory);
if (PHRASE_ENABLED (how_leave_me_alone))
Response (how_leave_me_alone, KohrAhStory);
Response (guess_thats_all, CombatIsInevitable);
}
static void
DieHuman (RESPONSE_REF R)
{
switch (GET_GAME_STATE (KOHR_AH_REASONS))
{
case 0:
Response (threat_1, CombatIsInevitable);
break;
case 1:
Response (threat_2, CombatIsInevitable);
break;
case 2:
Response (threat_3, CombatIsInevitable);
break;
case 3:
Response (threat_4, CombatIsInevitable);
break;
}
if (GET_GAME_STATE (KNOW_KOHR_AH_STORY) == 1)
{
Response (key_phrase, KohrAhStory);
}
switch (GET_GAME_STATE (KOHR_AH_INFO))
{
case 0:
Response (what_are_you_hovering_over, CombatIsInevitable);
break;
case 1:
Response (you_sure_are_creepy, CombatIsInevitable);
break;
case 2:
Response (stop_that_gross_blinking, CombatIsInevitable);
break;
}
switch (GET_GAME_STATE (KOHR_AH_PLEAD))
{
case 0:
Response (plead_1, CombatIsInevitable);
break;
case 1:
Response (plead_2, CombatIsInevitable);
break;
case 2:
Response (plead_3, CombatIsInevitable);
break;
case 3:
Response (plead_4, CombatIsInevitable);
break;
}
Response (bye, CombatIsInevitable);
}
static void
Intro (void)
{
BYTE b0, b1, b2, b3;
if (LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
{
// NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro;
}
if (GET_GAME_STATE (KOHR_AH_KILLED_ALL))
{
NPCPhrase (GAME_OVER_DUDE);
SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro;
}
if (!GET_GAME_STATE (KOHR_AH_SENSES_EVIL)
&& GET_GAME_STATE (TALKING_PET_ON_SHIP))
{
NPCPhrase (SENSE_EVIL);
SET_GAME_STATE (KOHR_AH_SENSES_EVIL, 1);
}
b0 = GET_GAME_STATE (SAMATRA_GRPOFFS0);
b1 = GET_GAME_STATE (SAMATRA_GRPOFFS1);
b2 = GET_GAME_STATE (SAMATRA_GRPOFFS2);
b3 = GET_GAME_STATE (SAMATRA_GRPOFFS3);
if (LOBYTE (GLOBAL (CurrentActivity)) == IN_INTERPLANETARY
&& GLOBAL (BattleGroupRef)
&& GLOBAL (BattleGroupRef) == MAKE_DWORD (
MAKE_WORD (b0, b1), MAKE_WORD (b2, b3)
))
{
NPCPhrase (HELLO_SAMATRA);
SET_GAME_STATE (BATTLE_SEGUE, 1);
}
else
{
BYTE NumVisits;
NumVisits = GET_GAME_STATE (KOHR_AH_VISITS);
if (GET_GAME_STATE (KOHR_AH_FRENZY))
{
switch (NumVisits++)
{
case 0:
NPCPhrase (WE_KILL_ALL_1);
break;
case 1:
NPCPhrase (WE_KILL_ALL_2);
break;
case 2:
NPCPhrase (WE_KILL_ALL_3);
break;
case 3:
NPCPhrase (WE_KILL_ALL_4);
--NumVisits;
break;
}
Frenzy ((RESPONSE_REF)0);
}
else
{
switch (NumVisits++)
{
case 0:
NPCPhrase (HELLO_AND_DIE_1);
break;
case 1:
NPCPhrase (HELLO_AND_DIE_2);
break;
case 2:
NPCPhrase (HELLO_AND_DIE_3);
break;
case 3:
NPCPhrase (HELLO_AND_DIE_4);
--NumVisits;
break;
}
DieHuman ((RESPONSE_REF)0);
}
SET_GAME_STATE (KOHR_AH_VISITS, NumVisits);
}
ExitIntro:
;
}
static COUNT
uninit_blackurq (void)
{
return (0);
}
LOCDATAPTR
init_blackurq_comm (void)
{
LOCDATAPTR retval;
blackurq_desc.init_encounter_func = Intro;
blackurq_desc.uninit_encounter_func = uninit_blackurq;
blackurq_desc.AlienTextTemplate.baseline.x =
TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
blackurq_desc.AlienTextTemplate.baseline.y = 0;
blackurq_desc.AlienTextTemplate.align = ALIGN_CENTER;
blackurq_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;
if (!GET_GAME_STATE (KOHR_AH_KILLED_ALL)
&& LOBYTE (GLOBAL (CurrentActivity)) != WON_LAST_BATTLE)
{
SET_GAME_STATE (BATTLE_SEGUE, 1);
}
else
{
SET_GAME_STATE (BATTLE_SEGUE, 0);
}
retval = &blackurq_desc;
return (retval);
}
+3
View File
@@ -0,0 +1,3 @@
#define BLACKURQ_FONT 0x00200003L
+3
View File
@@ -0,0 +1,3 @@
#define BLACKURQ_PMAP_ANIM 0x00200002L
+3
View File
@@ -0,0 +1,3 @@
#define BLACKURQ_MUSIC 0x00200006L
+3
View File
@@ -0,0 +1,3 @@
#define BLACKURQ_CONVERSATION_PHRASES 0x00200004L
+4
View File
@@ -0,0 +1,4 @@
#include "igfxres.h"
#include "ifontres.h"
#include "istrtab.h"
#include "imusicre.h"
+5
View File
@@ -0,0 +1,5 @@
enum
{
BLACKURQ_PACKAGE = 1
};
+17
View File
@@ -0,0 +1,17 @@
#ifndef _RESTYPES_H
#define _RESTYPES_H
enum
{
KEY_CONFIG = 1,
GFXRES,
FONTRES,
STRTAB,
SNDRES,
MUSICRES,
RES_INDEX,
CODE
};
#endif /* _RESTYPES_H */
+102
View File
@@ -0,0 +1,102 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#ifndef _STRINGS_H
#define _STRINGS_H
enum
{
NULL_PHRASE,
SENSE_EVIL,
HELLO_AND_DIE_1,
HELLO_AND_DIE_2,
HELLO_AND_DIE_3,
HELLO_AND_DIE_4,
HELLO_AND_DIE_5,
HELLO_AND_DIE_6,
HELLO_AND_DIE_7,
HELLO_AND_DIE_8,
HELLO_SAMATRA,
WE_KILL_ALL_1,
WE_KILL_ALL_2,
WE_KILL_ALL_3,
WE_KILL_ALL_4,
why_kill_all_1,
why_kill_all_2,
why_kill_all_3,
why_kill_all_4,
KILL_BECAUSE_1,
KILL_BECAUSE_2,
KILL_BECAUSE_3,
KILL_BECAUSE_4,
please_dont_kill_1,
WILL_KILL_1,
please_dont_kill_2,
WILL_KILL_2,
please_dont_kill_3,
WILL_KILL_3,
please_dont_kill_4,
WILL_KILL_4,
bye_frenzy_1,
bye_frenzy_2,
bye_frenzy_3,
bye_frenzy_4,
GOODBYE_AND_DIE_FRENZY_1,
GOODBYE_AND_DIE_FRENZY_2,
GOODBYE_AND_DIE_FRENZY_3,
GOODBYE_AND_DIE_FRENZY_4,
threat_1,
RESISTANCE_IS_USELESS_1,
threat_2,
RESISTANCE_IS_USELESS_2,
threat_3,
RESISTANCE_IS_USELESS_3,
threat_4,
RESISTANCE_IS_USELESS_4,
key_phrase,
RESPONSE_TO_KEY_PHRASE,
why_do_you_destroy,
WE_WERE_SLAVES,
relationship_with_urquan,
WE_ARE_URQUAN_TOO,
what_about_culture,
BONE_GARDENS,
how_leave_me_alone,
YOU_DIE,
guess_thats_all,
THEN_DIE,
what_are_you_hovering_over,
BONE_PILE,
you_sure_are_creepy,
YES_CREEPY,
stop_that_gross_blinking,
DIE_HUMAN,
plead_1,
PLEADING_IS_USELESS_1,
plead_2,
PLEADING_IS_USELESS_2,
plead_3,
PLEADING_IS_USELESS_3,
plead_4,
PLEADING_IS_USELESS_4,
bye,
GOODBYE_AND_DIE,
GAME_OVER_DUDE,
};
#endif /* _STRINGS_H */
+10
View File
@@ -0,0 +1,10 @@
INCLUDE ../../star3do.typ
PATH comm/chmmr
PACKAGE CHMMR_PACKAGE chmmr.con
GFXRES CHMMR_PMAP_ANIM chmmr.ani
FONTRES CHMMR_FONT chmmr.fon
MUSICRES CHMMR_MUSIC chmmr.mod
STRTAB CHMMR_CONVERSATION_PHRASES chmmr.txt
STRTAB CHMMR_COLOR_MAP chmmr.ct
+558
View File
@@ -0,0 +1,558 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "reslib.h"
#include "comm/chmmr/resinst.h"
#include "starcon.h"
#include "commglue.h"
#include "comm/chmmr/strings.h"
static LOCDATA chmmr_desc =
{
NULL_PTR, /* init_encounter_func */
NULL_PTR, /* uninit_encounter_func */
(FRAME)CHMMR_PMAP_ANIM, /* AlienFrame */
(FONT)CHMMR_FONT, /* AlienFont */
WHITE_COLOR, /* AlienTextFColor */
BLACK_COLOR, /* AlienTextBColor */
0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */
(COLORMAP)CHMMR_COLOR_MAP, /* AlienColorMap */
CHMMR_MUSIC, /* AlienSong */
CHMMR_CONVERSATION_PHRASES, /* PlayerPhrases */
6, /* NumAnimations */
{
{
12, /* StartIndex */
5, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
6, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
17, /* StartIndex */
5, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
6, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
22, /* StartIndex */
5, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
6, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
27, /* StartIndex */
20, /* NumFrames */
YOYO_ANIM, /* AnimFlags */
6, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
47, /* StartIndex */
14, /* NumFrames */
YOYO_ANIM, /* AnimFlags */
6, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
61, /* StartIndex */
24, /* NumFrames */
YOYO_ANIM, /* AnimFlags */
6, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
},
{
0, /* StartIndex */
0, /* NumFrames */
0, /* AnimFlags */
0, 0, /* FrameRate */
0, 0, /* RestartRate */
},
{
1, /* StartIndex */
11, /* NumFrames */
0, /* AnimFlags */
1, 0, /* FrameRate */
1, 0, /* RestartRate */
},
};
static void
ExitConversation (RESPONSE_REF R)
{
SET_GAME_STATE (BATTLE_SEGUE, 0);
if (PLAYER_SAID (R, bye))
NPCPhrase (GOODBYE);
else if (PLAYER_SAID (R, bye_shielded))
NPCPhrase (GOODBYE_SHIELDED);
else if (PLAYER_SAID (R, bye_after_bomb))
NPCPhrase (GOODBYE_AFTER_BOMB);
else if (PLAYER_SAID (R, proceed))
{
BYTE i;
NPCPhrase (TAKE_2_WEEKS);
ActivateStarShip (CHMMR_SHIP, 0);
SET_GAME_STATE (CHMMR_HOME_VISITS, 0);
SET_GAME_STATE (CHMMR_STACK, 0);
SET_GAME_STATE (CHMMR_BOMB_STATE, 2);
SET_GAME_STATE (UTWIG_BOMB_ON_SHIP, 0);
GLOBAL_SIS (ResUnits) = 1000000L;
GLOBAL_SIS (FuelOnBoard) = FUEL_RESERVE;
GLOBAL_SIS (CrewEnlisted) = 0;
GLOBAL_SIS (NumLanders) = 0;
GLOBAL (ModuleCost[PLANET_LANDER]) = 0;
GLOBAL (ModuleCost[STORAGE_BAY]) = 0;
GLOBAL_SIS (TotalElementMass) = 0;
for (i = 0; i < NUM_ELEMENT_CATEGORIES; ++i)
GLOBAL_SIS (ElementAmounts[i]) = 0;
for (i = 0; i < NUM_DRIVE_SLOTS; ++i)
GLOBAL_SIS (DriveSlots[i]) = FUSION_THRUSTER;
for (i = 0; i < NUM_JET_SLOTS; ++i)
GLOBAL_SIS (JetSlots[i]) = TURNING_JETS;
for (i = NUM_BOMB_MODULES; i < NUM_MODULE_SLOTS; ++i)
GLOBAL_SIS (ModuleSlots[i]) = EMPTY_SLOT + 2;
GLOBAL_SIS (ModuleSlots[0]) = BOMB_MODULE_4;
GLOBAL_SIS (ModuleSlots[1]) = BOMB_MODULE_5;
GLOBAL_SIS (ModuleSlots[2]) = BOMB_MODULE_3;
GLOBAL_SIS (ModuleSlots[3]) = BOMB_MODULE_1;
GLOBAL_SIS (ModuleSlots[4]) = BOMB_MODULE_0;
GLOBAL_SIS (ModuleSlots[5]) = BOMB_MODULE_1;
GLOBAL_SIS (ModuleSlots[6]) = BOMB_MODULE_3;
GLOBAL_SIS (ModuleSlots[7]) = BOMB_MODULE_4;
GLOBAL_SIS (ModuleSlots[8]) = BOMB_MODULE_5;
GLOBAL_SIS (ModuleSlots[9]) = BOMB_MODULE_2;
#define EARTH_INDEX 2 /* earth is 3rd planet --> 3 - 1 = 2 */
GLOBAL_SIS (log_x) = UNIVERSE_TO_LOGX (SOL_X);
GLOBAL_SIS (log_y) = UNIVERSE_TO_LOGY (SOL_Y);
GLOBAL (ShipStamp.frame) =
(FRAME)MAKE_DWORD (1, EARTH_INDEX + 1);
/* Magic numbers for Earth */
GLOBAL (ip_location.x) = -725;
GLOBAL (ip_location.y) = 597;
GLOBAL (ShipStamp.origin.x) = 71;
GLOBAL (ShipStamp.origin.y) = 97;
}
}
static void
NotReady (RESPONSE_REF R)
{
if (R == 0)
NPCPhrase (RETURN_WHEN_READY);
else if (PLAYER_SAID (R, further_assistance))
{
NPCPhrase (NO_FURTHER_ASSISTANCE);
DISABLE_PHRASE (further_assistance);
}
else if (PLAYER_SAID (R, tech_help))
{
NPCPhrase (USE_OUR_SHIPS_BEFORE);
ActivateStarShip (CHMMR_SHIP, 0);
}
else if (PLAYER_SAID (R, where_weapon))
{
NPCPhrase (PRECURSOR_WEAPON);
DISABLE_PHRASE (where_weapon);
}
else if (PLAYER_SAID (R, where_distraction))
{
NPCPhrase (PSYCHIC_WEAPONRY);
DISABLE_PHRASE (where_distraction);
}
if (!(ActivateStarShip (CHMMR_SHIP, CHECK_ALLIANCE) & GOOD_GUY))
Response (tech_help, NotReady);
else if (PHRASE_ENABLED (further_assistance))
Response (further_assistance, NotReady);
if (PHRASE_ENABLED (where_weapon) && !GET_GAME_STATE (UTWIG_BOMB_ON_SHIP))
Response (where_weapon, NotReady);
if (PHRASE_ENABLED (where_distraction) && !GET_GAME_STATE (TALKING_PET_ON_SHIP))
Response (where_distraction, NotReady);
Response (bye, ExitConversation);
}
static void
ImproveBomb (RESPONSE_REF R)
{
if (R == 0)
NPCPhrase (WE_WILL_IMPROVE_BOMB);
else if (PLAYER_SAID (R, what_now))
{
NPCPhrase (MODIFY_VESSEL);
DISABLE_PHRASE (what_now);
}
else if (PLAYER_SAID (R, wont_hurt_my_ship))
{
NPCPhrase (WILL_DESTROY_IT);
DISABLE_PHRASE (wont_hurt_my_ship);
}
else if (PLAYER_SAID (R, bummer_about_my_ship))
{
NPCPhrase (DEAD_SILENCE);
DISABLE_PHRASE (bummer_about_my_ship);
}
else if (PLAYER_SAID (R, other_assistance))
{
NPCPhrase (USE_OUR_SHIPS_AFTER);
ActivateStarShip (CHMMR_SHIP, 0);
}
if (PHRASE_ENABLED (what_now))
Response (what_now, ImproveBomb);
else if (PHRASE_ENABLED (wont_hurt_my_ship))
Response (wont_hurt_my_ship, ImproveBomb);
else if (PHRASE_ENABLED (bummer_about_my_ship))
Response (bummer_about_my_ship, ImproveBomb);
if (!(ActivateStarShip (CHMMR_SHIP, CHECK_ALLIANCE) & GOOD_GUY))
Response (other_assistance, ImproveBomb);
Response (proceed, ExitConversation);
}
static void
ChmmrFree (RESPONSE_REF R)
{
if (R == 0
|| PLAYER_SAID (R, i_am_captain0)
|| PLAYER_SAID (R, i_am_savior)
|| PLAYER_SAID (R, i_am_silly))
{
NPCPhrase (WHY_HAVE_YOU_FREED_US);
AlienTalkSegue ((COUNT)~0);
SET_GAME_STATE (CHMMR_EMERGING, 0);
Response (serious_1, ChmmrFree);
Response (serious_2, ChmmrFree);
Response (silly, ChmmrFree);
}
else
{
NPCPhrase (WILL_HELP_ANALYZE_LOGS);
if (GET_GAME_STATE (AWARE_OF_SAMATRA))
NPCPhrase (YOU_KNOW_SAMATRA);
else
{
NPCPhrase (DONT_KNOW_ABOUT_SAMATRA);
SET_GAME_STATE (AWARE_OF_SAMATRA, 1);
}
if (GET_GAME_STATE (TALKING_PET_ON_SHIP))
NPCPhrase (HAVE_TALKING_PET);
else
NPCPhrase (NEED_DISTRACTION);
if (GET_GAME_STATE (UTWIG_BOMB_ON_SHIP))
NPCPhrase (HAVE_BOMB);
else
NPCPhrase (NEED_WEAPON);
if (!GET_GAME_STATE (TALKING_PET_ON_SHIP)
|| !GET_GAME_STATE (UTWIG_BOMB_ON_SHIP))
NotReady ((RESPONSE_REF)0);
else
ImproveBomb ((RESPONSE_REF)0);
}
}
static void ChmmrShielded (RESPONSE_REF R);
static void
ChmmrAdvice (RESPONSE_REF R)
{
BYTE AdviceLeft;
if (PLAYER_SAID (R, need_advice))
NPCPhrase (WHAT_ADVICE);
else if (PLAYER_SAID (R, how_defeat_urquan))
{
NPCPhrase (DEFEAT_LIKE_SO);
SET_GAME_STATE (CHMMR_BOMB_STATE, 1);
DISABLE_PHRASE (how_defeat_urquan);
}
else if (PLAYER_SAID (R, what_about_tpet))
{
NPCPhrase (SCARY_BUT_USEFUL);
DISABLE_PHRASE (what_about_tpet);
}
else if (PLAYER_SAID (R, what_about_bomb))
{
NPCPhrase (ABOUT_BOMB);
DISABLE_PHRASE (what_about_bomb);
}
else if (PLAYER_SAID (R, what_about_sun_device))
{
NPCPhrase (ABOUT_SUN_DEVICE);
DISABLE_PHRASE (what_about_sun_device);
}
else if (PLAYER_SAID (R, what_about_samatra))
{
NPCPhrase (ABOUT_SUN_DEVICE);
DISABLE_PHRASE (what_about_samatra);
}
AdviceLeft = 0;
if (PHRASE_ENABLED (how_defeat_urquan))
{
Response (how_defeat_urquan, ChmmrAdvice);
AdviceLeft = TRUE;
}
if (PHRASE_ENABLED (what_about_tpet) && GET_GAME_STATE (TALKING_PET_ON_SHIP))
{
Response (what_about_tpet, ChmmrAdvice);
AdviceLeft = TRUE;
}
if (PHRASE_ENABLED (what_about_bomb) && GET_GAME_STATE (UTWIG_BOMB_ON_SHIP))
{
Response (what_about_bomb, ChmmrAdvice);
AdviceLeft = TRUE;
}
if (PHRASE_ENABLED (what_about_sun_device) && GET_GAME_STATE (SUN_DEVICE_ON_SHIP))
{
Response (what_about_sun_device, ChmmrAdvice);
AdviceLeft = TRUE;
}
if (PHRASE_ENABLED (what_about_samatra) && GET_GAME_STATE (AWARE_OF_SAMATRA))
{
Response (what_about_samatra, ChmmrAdvice);
AdviceLeft = TRUE;
}
Response (enough_advice, ChmmrShielded);
if (!AdviceLeft)
DISABLE_PHRASE (need_advice);
}
static void
ChmmrShielded (RESPONSE_REF R)
{
if (PLAYER_SAID (R, find_out_whats_up))
{
NPCPhrase (HYBRID_PROCESS);
DISABLE_PHRASE (find_out_whats_up);
}
else if (PLAYER_SAID (R, need_help))
{
NPCPhrase (CANT_HELP);
SET_GAME_STATE (CHMMR_STACK, 1);
}
else if (PLAYER_SAID (R, why_no_help))
{
NPCPhrase (LONG_TIME);
SET_GAME_STATE (CHMMR_STACK, 2);
}
else if (PLAYER_SAID (R, what_if_more_energy))
{
NPCPhrase (DANGER_TO_US);
SET_GAME_STATE (CHMMR_STACK, 3);
}
else if (PLAYER_SAID (R, enough_advice))
NPCPhrase (OK_ENOUGH_ADVICE);
switch (GET_GAME_STATE (CHMMR_STACK))
{
case 0:
Response (need_help, ChmmrShielded);
break;
case 1:
Response (why_no_help, ChmmrShielded);
break;
case 2:
Response (what_if_more_energy, ChmmrShielded);
break;
}
if (PHRASE_ENABLED (find_out_whats_up))
Response (find_out_whats_up, ChmmrShielded);
if (PHRASE_ENABLED (need_advice))
{
Response (need_advice, ChmmrAdvice);
}
Response (bye_shielded, ExitConversation);
}
static void
AfterBomb (RESPONSE_REF R)
{
if (PLAYER_SAID (R, whats_up_after_bomb))
{
if (GET_GAME_STATE (CHMMR_STACK))
NPCPhrase (GENERAL_INFO_AFTER_BOMB_2);
else
{
NPCPhrase (GENERAL_INFO_AFTER_BOMB_1);
SET_GAME_STATE (CHMMR_STACK, 1);
}
DISABLE_PHRASE (whats_up_after_bomb);
}
else if (PLAYER_SAID (R, what_do_after_bomb))
{
NPCPhrase (DO_AFTER_BOMB);
DISABLE_PHRASE (what_do_after_bomb);
}
if (PHRASE_ENABLED (whats_up_after_bomb))
Response (whats_up_after_bomb, AfterBomb);
if (PHRASE_ENABLED (what_do_after_bomb))
Response (what_do_after_bomb, AfterBomb);
Response (bye_after_bomb, ExitConversation);
}
static void
Intro (void)
{
BYTE NumVisits;
if (GET_GAME_STATE (CHMMR_BOMB_STATE) >= 2)
{
NumVisits = GET_GAME_STATE (CHMMR_HOME_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (HELLO_AFTER_BOMB_1);
break;
case 1:
NPCPhrase (HELLO_AFTER_BOMB_2);
break;
}
SET_GAME_STATE (CHMMR_HOME_VISITS, NumVisits);
AfterBomb ((RESPONSE_REF)0);
}
else if (GET_GAME_STATE (CHMMR_UNLEASHED))
{
if (!GET_GAME_STATE (TALKING_PET_ON_SHIP)
|| !GET_GAME_STATE (UTWIG_BOMB_ON_SHIP))
NotReady ((RESPONSE_REF)0);
else
{
NPCPhrase (YOU_ARE_READY);
ImproveBomb ((RESPONSE_REF)0);
}
}
else
{
NumVisits = GET_GAME_STATE (CHMMR_HOME_VISITS);
if (!GET_GAME_STATE (CHMMR_EMERGING))
{
CommData.AlienColorMap = SetAbsColorMapIndex (
CommData.AlienColorMap, 1
);
switch (NumVisits++)
{
case 0:
NPCPhrase (WHY_YOU_HERE_1);
break;
case 1:
NPCPhrase (WHY_YOU_HERE_2);
break;
case 2:
NPCPhrase (WHY_YOU_HERE_3);
break;
case 3:
NPCPhrase (WHY_YOU_HERE_4);
--NumVisits;
break;
}
ChmmrShielded ((RESPONSE_REF)0);
}
else
{
NPCPhrase (WE_ARE_FREE);
if (NumVisits)
{
ChmmrFree ((RESPONSE_REF)0);
NumVisits = 0;
}
else
{
NPCPhrase (WHO_ARE_YOU);
construct_response (shared_phrase_buf,
i_am_captain0,
(vararg_dcl)GLOBAL_SIS (CommanderName),
i_am_captain1,
GLOBAL_SIS (ShipName),
i_am_captain2,
0);
DoResponsePhrase (i_am_captain0, ChmmrFree, shared_phrase_buf);
Response (i_am_savior, ChmmrFree);
Response (i_am_silly, ChmmrFree);
}
SET_GAME_STATE (CHMMR_UNLEASHED, 1);
}
SET_GAME_STATE (CHMMR_HOME_VISITS, NumVisits);
}
}
static COUNT
uninit_chmmr (void)
{
return (0);
}
LOCDATAPTR
init_chmmr_comm (void)
{
LOCDATAPTR retval;
chmmr_desc.init_encounter_func = Intro;
chmmr_desc.uninit_encounter_func = uninit_chmmr;
chmmr_desc.AlienTextTemplate.baseline.x =
TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
chmmr_desc.AlienTextTemplate.baseline.y = 0;
chmmr_desc.AlienTextTemplate.align = ALIGN_CENTER;
chmmr_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;
SET_GAME_STATE (BATTLE_SEGUE, 0);
retval = &chmmr_desc;
return (retval);
}
+3
View File
@@ -0,0 +1,3 @@
#define CHMMR_FONT 0x00200003L
+3
View File
@@ -0,0 +1,3 @@
#define CHMMR_PMAP_ANIM 0x00200002L
+3
View File
@@ -0,0 +1,3 @@
#define CHMMR_MUSIC 0x00200006L
+4
View File
@@ -0,0 +1,4 @@
#define CHMMR_CONVERSATION_PHRASES 0x00200004L
#define CHMMR_COLOR_MAP 0x00200104L
+4
View File
@@ -0,0 +1,4 @@
#include "igfxres.h"
#include "ifontres.h"
#include "istrtab.h"
#include "imusicre.h"
+5
View File
@@ -0,0 +1,5 @@
enum
{
CHMMR_PACKAGE = 1
};
+17
View File
@@ -0,0 +1,17 @@
#ifndef _RESTYPES_H
#define _RESTYPES_H
enum
{
KEY_CONFIG = 1,
GFXRES,
FONTRES,
STRTAB,
SNDRES,
MUSICRES,
RES_INDEX,
CODE
};
#endif /* _RESTYPES_H */
+105
View File
@@ -0,0 +1,105 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#ifndef _STRINGS_H
#define _STRINGS_H
enum
{
NULL_PHRASE,
WHY_YOU_HERE_1,
WHY_YOU_HERE_2,
WHY_YOU_HERE_3,
WHY_YOU_HERE_4,
find_out_whats_up,
HYBRID_PROCESS,
need_help,
CANT_HELP,
why_no_help,
LONG_TIME,
what_if_more_energy,
DANGER_TO_US,
need_advice,
WHAT_ADVICE,
how_defeat_urquan,
DEFEAT_LIKE_SO,
what_about_tpet,
SCARY_BUT_USEFUL,
what_about_bomb,
ABOUT_BOMB,
what_about_sun_device,
ABOUT_SUN_DEVICE,
what_about_samatra,
ABOUT_SAMATRA,
enough_advice,
OK_ENOUGH_ADVICE,
bye_shielded,
GOODBYE_SHIELDED,
WE_ARE_FREE,
WHO_ARE_YOU,
i_am_captain0,
i_am_captain1,
i_am_captain2,
i_am_savior,
i_am_silly,
WHY_HAVE_YOU_FREED_US,
serious_1,
serious_2,
silly,
WILL_HELP_ANALYZE_LOGS,
YOU_KNOW_SAMATRA,
DONT_KNOW_ABOUT_SAMATRA,
NEED_DISTRACTION,
HAVE_TALKING_PET,
NEED_WEAPON,
HAVE_BOMB,
RETURN_WHEN_READY,
YOU_ARE_READY,
further_assistance,
NO_FURTHER_ASSISTANCE,
tech_help,
USE_OUR_SHIPS_BEFORE,
where_weapon,
PRECURSOR_WEAPON,
where_distraction,
PSYCHIC_WEAPONRY,
what_now,
WE_WILL_IMPROVE_BOMB,
MODIFY_VESSEL,
wont_hurt_my_ship,
WILL_DESTROY_IT,
bummer_about_my_ship,
DEAD_SILENCE,
other_assistance,
USE_OUR_SHIPS_AFTER,
proceed,
TAKE_2_WEEKS,
HELLO_AFTER_BOMB_1,
HELLO_AFTER_BOMB_2,
whats_up_after_bomb,
GENERAL_INFO_AFTER_BOMB_1,
GENERAL_INFO_AFTER_BOMB_2,
what_do_after_bomb,
DO_AFTER_BOMB,
bye_after_bomb,
GOODBYE_AFTER_BOMB,
bye,
GOODBYE,
};
#endif /* _STRINGS_H */
+670
View File
@@ -0,0 +1,670 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "reslib.h"
#include "comm/comandr/resinst.h"
#include "starcon.h"
#include "commglue.h"
#include "comm/comandr/strings.h"
static LOCDATA commander_desc =
{
NULL_PTR, /* init_encounter_func */
NULL_PTR, /* uninit_encounter_func */
(FRAME)COMMANDER_PMAP_ANIM, /* AlienFrame */
(FONT)COMMANDER_FONT, /* AlienFont */
WHITE_COLOR, /* AlienTextFColor */
BLACK_COLOR, /* AlienTextBColor */
0, /* SIS_TEXT_WIDTH, */ /* AlienTextWidth */
COMMANDER_COLOR_MAP, /* AlienColorMap */
COMMANDER_MUSIC, /* AlienSong */
COMMANDER_CONVERSATION_PHRASES, /* PlayerPhrases */
3, /* NumAnimations */
{
{ /* Blink */
1, /* StartIndex */
3, /* NumFrames */
YOYO_ANIM, /* AnimFlags */
8, 0, /* FrameRate */
0, ONE_SECOND * 8, /* RestartRate */
},
{ /* Running light */
10, /* StartIndex */
30, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
3, 0, /* FrameRate */
ONE_SECOND * 2, 0, /* RestartRate */
},
{
1, /* StartIndex */
3, /* NumFrames */
RANDOM_ANIM | COLORXFORM_ANIM,/* AnimFlags */
0, 4, /* FrameRate */
0, 8, /* RestartRate */
},
},
{
0, /* StartIndex */
0, /* NumFrames */
0, /* AnimFlags */
0, 0, /* FrameRate */
0, 0, /* RestartRate */
},
{
4, /* StartIndex */
6, /* NumFrames */
0, /* AnimFlags */
12, 8, /* FrameRate */
14, 10, /* RestartRate */
},
};
static void
ByeBye (RESPONSE_REF R)
{
if (PLAYER_SAID (R, ok_i_will_get_radios))
NPCPhrase (THANKS_FOR_HELPING);
else if (PLAYER_SAID (R, well_go_get_them_now))
NPCPhrase (GLAD_WHEN_YOU_COME_BACK);
else if (PLAYER_SAID (R, we_will_take_care_of_base))
{
NPCPhrase (GOOD_LUCK_WITH_BASE);
SET_GAME_STATE (WILL_DESTROY_BASE, 1);
}
else if (PLAYER_SAID (R, take_care_of_base_again))
NPCPhrase (GOOD_LUCK_AGAIN);
else if (PLAYER_SAID (R, base_was_abandoned)
|| PLAYER_SAID (R, i_lied_it_was_abandoned))
{
NPCPhrase (IT_WAS_ABANDONED);
NPCPhrase (HERE_COMES_ILWRATH);
SET_GAME_STATE (PROBE_ILWRATH_ENCOUNTER, 1);
}
else if (PLAYER_SAID (R, oh_yes_big_fight))
{
NPCPhrase (IM_GLAD_YOU_WON);
NPCPhrase (HERE_COMES_ILWRATH);
SET_GAME_STATE (PROBE_ILWRATH_ENCOUNTER, 1);
}
else if (PLAYER_SAID (R, i_cant_talk_about_it))
{
NPCPhrase (IM_SURE_IT_WAS_DIFFICULT);
NPCPhrase (HERE_COMES_ILWRATH);
SET_GAME_STATE (PROBE_ILWRATH_ENCOUNTER, 1);
}
else if (PLAYER_SAID (R, cook_their_butts)
|| PLAYER_SAID (R, overthrow_evil_aliens)
|| PLAYER_SAID (R, annihilate_those_monsters))
{
//PTR_DESC PtrDesc;
SET_GAME_STATE (PROBE_ILWRATH_ENCOUNTER, 0);
if (PLAYER_SAID (R, cook_their_butts))
NPCPhrase (COOK_BUTTS);
else if (PLAYER_SAID (R, overthrow_evil_aliens))
NPCPhrase (OVERTHROW_ALIENS);
else /* if (R == annihilate_those_monsters) */
NPCPhrase (KILL_MONSTERS);
construct_response (shared_phrase_buf,
name_40,
(vararg_dcl)GLOBAL_SIS (CommanderName),
name_41,
0);
NPCPhrase (THIS_MAY_SEEM_SILLY);
Response (name_1, ByeBye);
Response (name_2, ByeBye);
Response (name_3, ByeBye);
DoResponsePhrase (name_40, ByeBye, shared_phrase_buf);
SET_GAME_STATE (STARBASE_AVAILABLE, 1);
}
else
{
if (PLAYER_SAID (R, name_1))
{
NPCPhrase (OK_THE_NAFS);
SET_GAME_STATE (NEW_ALLIANCE_NAME, 0);
}
else if (PLAYER_SAID (R, name_2))
{
NPCPhrase (OK_THE_CAN);
SET_GAME_STATE (NEW_ALLIANCE_NAME, 1);
}
else if (PLAYER_SAID (R, name_3))
{
NPCPhrase (OK_THE_UFW);
SET_GAME_STATE (NEW_ALLIANCE_NAME, 2);
}
else /* if (PLAYER_SAID (R, name_4)) */
{
NPCPhrase (OK_THE_NAME_IS_EMPIRE0);
NPCPhrase (GLOBAL_PLAYER_NAME);
NPCPhrase (OK_THE_NAME_IS_EMPIRE1);
SET_GAME_STATE (NEW_ALLIANCE_NAME, 3);
}
NPCPhrase (STARBASE_WILL_BE_READY);
}
}
static void
NoRadioactives (RESPONSE_REF R)
{
if (PLAYER_SAID (R, yes_this_is_supply_ship))
{
NPCPhrase (ABOUT_TIME);
Response (i_lied, NoRadioactives);
Response (plumb_out, NoRadioactives);
}
else
{
if (PLAYER_SAID (R, where_can_i_get_radios))
{
NPCPhrase (RADIOS_ON_MERCURY);
DISABLE_PHRASE (where_can_i_get_radios);
}
else if (PLAYER_SAID (R, no_but_well_help0))
NPCPhrase (THE_WHAT_FROM_WHERE);
else if (PLAYER_SAID (R, what_slave_planet)
|| PLAYER_SAID (R, i_lied))
NPCPhrase (DONT_KNOW_WHO_YOU_ARE);
else if (PLAYER_SAID (R, plumb_out))
NPCPhrase (WHAT_KIND_OF_IDIOT);
else if (PLAYER_SAID (R, i_lost_my_lander))
{
NPCPhrase (HERE_IS_A_NEW_LANDER);
++GLOBAL_SIS (NumLanders);
SetSemaphore (&GraphicsSem);
DrawLanders ();
DeltaSISGauges (4, 0, 0);
ClearSemaphore (&GraphicsSem);
SET_GAME_STATE (LANDERS_LOST, 1);
}
else if (PLAYER_SAID (R, i_lost_another_lander))
{
NPCPhrase (HERE_IS_ANOTHER_LANDER);
++GLOBAL_SIS (NumLanders);
SetSemaphore (&GraphicsSem);
DrawLanders ();
DeltaSISGauges (4, 0, 0);
ClearSemaphore (&GraphicsSem);
}
else if (PLAYER_SAID (R, need_fuel))
{
NPCPhrase (GIVE_FUEL);
SetSemaphore (&GraphicsSem);
DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
ClearSemaphore (&GraphicsSem);
SET_GAME_STATE (GIVEN_FUEL_BEFORE, 1);
}
else if (PLAYER_SAID (R, need_fuel_again))
{
NPCPhrase (GIVE_FUEL_AGAIN);
SetSemaphore (&GraphicsSem);
DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
ClearSemaphore (&GraphicsSem);
}
if (GLOBAL_SIS (NumLanders) == 0)
{
if (GET_GAME_STATE (LANDERS_LOST))
Response (i_lost_another_lander, NoRadioactives);
else
Response (i_lost_my_lander, NoRadioactives);
}
if (GLOBAL_SIS (FuelOnBoard) < 2 * FUEL_TANK_SCALE)
{
if (GET_GAME_STATE (GIVEN_FUEL_BEFORE))
Response (need_fuel_again, NoRadioactives);
else
Response (need_fuel, NoRadioactives);
}
Response (ok_i_will_get_radios, ByeBye);
if (PHRASE_ENABLED (where_can_i_get_radios))
{
Response (where_can_i_get_radios, NoRadioactives);
}
}
}
static void
AskAfterRadios (RESPONSE_REF R)
{
if (PLAYER_SAID (R, i_lost_my_lander))
{
NPCPhrase (HERE_IS_A_NEW_LANDER);
++GLOBAL_SIS (NumLanders);
SetSemaphore (&GraphicsSem);
DrawLanders ();
DeltaSISGauges (4, 0, 0);
ClearSemaphore (&GraphicsSem);
SET_GAME_STATE (LANDERS_LOST, 1);
}
else if (PLAYER_SAID (R, i_lost_another_lander))
{
NPCPhrase (HERE_IS_ANOTHER_LANDER);
++GLOBAL_SIS (NumLanders);
SetSemaphore (&GraphicsSem);
DrawLanders ();
DeltaSISGauges (4, 0, 0);
ClearSemaphore (&GraphicsSem);
}
else if (PLAYER_SAID (R, need_fuel))
{
NPCPhrase (GIVE_FUEL);
SetSemaphore (&GraphicsSem);
DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
ClearSemaphore (&GraphicsSem);
SET_GAME_STATE (GIVEN_FUEL_BEFORE, 1);
}
else if (PLAYER_SAID (R, need_fuel_again))
{
NPCPhrase (GIVE_FUEL_AGAIN);
SetSemaphore (&GraphicsSem);
DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
ClearSemaphore (&GraphicsSem);
}
else if (PLAYER_SAID (R, where_get_radios))
{
NPCPhrase (RADIOS_ON_MERCURY);
DISABLE_PHRASE (where_get_radios);
}
{
if (GLOBAL_SIS (NumLanders) == 0)
{
if (GET_GAME_STATE (LANDERS_LOST))
Response (i_lost_another_lander, AskAfterRadios);
else
Response (i_lost_my_lander, AskAfterRadios);
}
if (GLOBAL_SIS (FuelOnBoard) < 2 * FUEL_TANK_SCALE)
{
if (GET_GAME_STATE (GIVEN_FUEL_BEFORE))
Response (need_fuel_again, AskAfterRadios);
else
Response (need_fuel, AskAfterRadios);
}
Response (well_go_get_them_now, ByeBye);
if (PHRASE_ENABLED (where_get_radios))
{
Response (where_get_radios, AskAfterRadios);
}
}
}
static void
BaseDestroyed (RESPONSE_REF R)
{
if (PLAYER_SAID (R, we_fought_them))
{
NPCPhrase (YOU_REALLY_FOUGHT_BASE);
Response (oh_yes_big_fight, ByeBye);
Response (i_lied_it_was_abandoned, ByeBye);
Response (i_cant_talk_about_it, ByeBye);
}
else
{
if (PLAYER_SAID (R, we_are_here_to_help))
{
NPCPhrase (BASE_ON_MOON);
}
else
{
NPCPhrase (DEALT_WITH_BASE_YET);
}
Response (base_was_abandoned, ByeBye);
Response (we_fought_them, BaseDestroyed);
}
}
static void
TellMoonBase (RESPONSE_REF R)
{
if (R == 0)
{
NPCPhrase (DEALT_WITH_BASE_YET);
}
else if (PLAYER_SAID (R, i_lost_my_lander))
{
NPCPhrase (HERE_IS_A_NEW_LANDER);
++GLOBAL_SIS (NumLanders);
SetSemaphore (&GraphicsSem);
DrawLanders ();
DeltaSISGauges (4, 0, 0);
ClearSemaphore (&GraphicsSem);
SET_GAME_STATE (LANDERS_LOST, 1);
}
else if (PLAYER_SAID (R, i_lost_another_lander))
{
NPCPhrase (HERE_IS_ANOTHER_LANDER);
++GLOBAL_SIS (NumLanders);
SetSemaphore (&GraphicsSem);
DrawLanders ();
DeltaSISGauges (4, 0, 0);
ClearSemaphore (&GraphicsSem);
}
else if (PLAYER_SAID (R, need_fuel))
{
NPCPhrase (GIVE_FUEL);
SetSemaphore (&GraphicsSem);
DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
ClearSemaphore (&GraphicsSem);
SET_GAME_STATE (GIVEN_FUEL_BEFORE, 1);
}
else if (PLAYER_SAID (R, need_fuel_again))
{
NPCPhrase (GIVE_FUEL_AGAIN);
SetSemaphore (&GraphicsSem);
DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
ClearSemaphore (&GraphicsSem);
}
else if (PLAYER_SAID (R, we_are_here_to_help))
{
NPCPhrase (BASE_ON_MOON);
}
else if (GET_GAME_STATE (STARBASE_YACK_STACK1) == 0)
{
NPCPhrase (ABOUT_BASE);
SET_GAME_STATE (STARBASE_YACK_STACK1, 1);
}
else
{
NPCPhrase (ABOUT_BASE_AGAIN);
}
if (GLOBAL_SIS (NumLanders) == 0)
{
if (GET_GAME_STATE (LANDERS_LOST))
Response (i_lost_another_lander, TellMoonBase);
else
Response (i_lost_my_lander, TellMoonBase);
}
if (GLOBAL_SIS (FuelOnBoard) < 2 * FUEL_TANK_SCALE)
{
if (GET_GAME_STATE (GIVEN_FUEL_BEFORE))
Response (need_fuel_again, TellMoonBase);
else
Response (need_fuel, TellMoonBase);
}
if (GET_GAME_STATE (WILL_DESTROY_BASE) == 0)
Response (we_will_take_care_of_base, ByeBye);
else
Response (take_care_of_base_again, ByeBye);
if (GET_GAME_STATE (STARBASE_YACK_STACK1) == 0)
Response (tell_me_about_base, TellMoonBase);
else
Response (tell_me_again, TellMoonBase);
}
static void RevealSelf (RESPONSE_REF R);
static void
TellProbe (RESPONSE_REF R)
{
NPCPhrase (THAT_WAS_PROBE);
DISABLE_PHRASE (what_was_red_thing);
Response (it_went_away, RevealSelf);
Response (we_destroyed_it, RevealSelf);
Response (what_probe, RevealSelf);
}
static void
RevealSelf (RESPONSE_REF R)
{
BYTE i, stack;
stack = 0;
if (PLAYER_SAID (R, we_are_vindicator0))
{
NPCPhrase (THATS_IMPOSSIBLE);
DISABLE_PHRASE (we_are_vindicator0);
}
else if (PLAYER_SAID (R, our_mission_was_secret))
{
NPCPhrase (ACKNOWLEDGE_SECRET);
DISABLE_PHRASE (our_mission_was_secret);
}
else if (PLAYER_SAID (R, first_give_info))
{
NPCPhrase (ASK_AWAY);
stack = 1;
DISABLE_PHRASE (first_give_info);
}
else if (PLAYER_SAID (R, whats_this_starbase))
{
NPCPhrase (STARBASE_IS);
stack = 1;
DISABLE_PHRASE (whats_this_starbase);
}
else if (PLAYER_SAID (R, what_about_earth))
{
NPCPhrase (HAPPENED_TO_EARTH);
stack = 1;
DISABLE_PHRASE (what_about_earth);
}
else if (PLAYER_SAID (R, where_are_urquan))
{
NPCPhrase (URQUAN_LEFT);
stack = 1;
DISABLE_PHRASE (where_are_urquan);
}
else if (PLAYER_SAID (R, it_went_away))
NPCPhrase (DEEP_TROUBLE);
else if (PLAYER_SAID (R, we_destroyed_it))
NPCPhrase (GOOD_NEWS);
else if (PLAYER_SAID (R, what_probe))
NPCPhrase (SURE_HOPE);
for (i = 0; i < 2; ++i, stack ^= 1)
{
if (stack == 1)
{
if (PHRASE_ENABLED (first_give_info))
Response (first_give_info, RevealSelf);
else if (PHRASE_ENABLED (whats_this_starbase))
Response (whats_this_starbase, RevealSelf);
else if (PHRASE_ENABLED (what_about_earth))
Response (what_about_earth, RevealSelf);
else if (PHRASE_ENABLED (where_are_urquan))
Response (where_are_urquan, RevealSelf);
else if (PHRASE_ENABLED (what_was_red_thing))
{
Response (what_was_red_thing, TellProbe);
}
}
else
{
if (PHRASE_ENABLED (we_are_vindicator0))
{
construct_response (shared_phrase_buf,
we_are_vindicator0,
(vararg_dcl)GLOBAL_SIS (CommanderName),
we_are_vindicator1,
GLOBAL_SIS (ShipName),
we_are_vindicator2,
0);
DoResponsePhrase (we_are_vindicator0, RevealSelf, shared_phrase_buf);
}
else if (PHRASE_ENABLED (our_mission_was_secret))
Response (our_mission_was_secret, RevealSelf);
else
{
if (GET_GAME_STATE (MOONBASE_DESTROYED) == 0)
Response (we_are_here_to_help, TellMoonBase);
else
Response (we_are_here_to_help, BaseDestroyed);
}
}
}
}
static void
GiveRadios (RESPONSE_REF R)
{
if (PLAYER_SAID (R, we_will_transfer_now))
{
SET_GAME_STATE (RADIOACTIVES_PROVIDED, 1);
NPCPhrase (FUEL_UP0);
NPCPhrase (FUEL_UP1);
AlienTalkSegue (1);
SetSemaphore (&GraphicsSem);
CommData.AlienAmbientArray[2].AnimFlags |= ANIM_DISABLED;
XFormPLUT (GetColorMapAddress (
SetAbsColorMapIndex (CommData.AlienColorMap, 0)
), 0);
ClearSemaphore (&GraphicsSem);
AlienTalkSegue ((COUNT)~0);
RevealSelf (NULL_PTR);
}
else
{
if (PLAYER_SAID (R, what_will_you_give_us))
NPCPhrase (MESSAGE_GARBLED_1);
else if (PLAYER_SAID (R, before_radios_we_need_info))
NPCPhrase (MESSAGE_GARBLED_2);
Response (we_will_transfer_now, GiveRadios);
Response (what_will_you_give_us, GiveRadios);
Response (before_radios_we_need_info, GiveRadios);
}
}
static void
Intro (void)
{
if (GET_GAME_STATE (PROBE_ILWRATH_ENCOUNTER))
{
NPCPhrase (VERY_IMPRESSIVE);
Response (cook_their_butts, ByeBye);
Response (overthrow_evil_aliens, ByeBye);
Response (annihilate_those_monsters, ByeBye);
}
else if (GET_GAME_STATE (STARBASE_VISITED))
{
if (GET_GAME_STATE (RADIOACTIVES_PROVIDED))
{
if (GET_GAME_STATE (MOONBASE_DESTROYED) == 0)
{
TellMoonBase (NULL_PTR);
}
else
{
BaseDestroyed (NULL_PTR);
}
}
else
{
CommData.AlienColorMap =
SetAbsColorMapIndex (CommData.AlienColorMap, 1);
NPCPhrase (DO_YOU_HAVE_RADIO_THIS_TIME);
if (GLOBAL_SIS (ElementAmounts[RADIOACTIVE]))
GiveRadios (NULL_PTR);
else
AskAfterRadios (NULL_PTR);
}
}
else /* first visit */
{
CommData.AlienColorMap =
SetAbsColorMapIndex (CommData.AlienColorMap, 1);
SET_GAME_STATE (STARBASE_VISITED, 1);
NPCPhrase (ARE_YOU_SUPPLY_SHIP);
if (GLOBAL_SIS (ElementAmounts[RADIOACTIVE]))
GiveRadios (NULL_PTR);
else
{
construct_response (
shared_phrase_buf,
no_but_well_help0,
(vararg_dcl)GLOBAL_SIS (ShipName),
no_but_well_help1,
0
);
DoResponsePhrase (no_but_well_help0, NoRadioactives, shared_phrase_buf);
Response (yes_this_is_supply_ship, NoRadioactives);
Response (what_slave_planet, NoRadioactives);
}
}
}
static COUNT
uninit_commander (void)
{
return (0);
}
LOCDATAPTR
init_commander_comm ()
{
LOCDATAPTR retval;
commander_desc.init_encounter_func = Intro;
commander_desc.uninit_encounter_func = uninit_commander;
if (GET_GAME_STATE (RADIOACTIVES_PROVIDED))
commander_desc.AlienAmbientArray[2].AnimFlags |= ANIM_DISABLED;
commander_desc.AlienTextWidth = 143;
commander_desc.AlienTextTemplate.baseline.x = 164;
commander_desc.AlienTextTemplate.baseline.y = 20;
commander_desc.AlienTextTemplate.align = ALIGN_CENTER;
SET_GAME_STATE (BATTLE_SEGUE, 0);
retval = &commander_desc;
return (retval);
}
+15
View File
@@ -0,0 +1,15 @@
INCLUDE ../../star3do.typ
PATH comm/comandr
PACKAGE COMMANDER_PACKAGE comandr.con
GFXRES COMMANDER_PMAP_ANIM comandr.ani
FONTRES COMMANDER_FONT comandr.fon
MUSICRES COMMANDER_MUSIC comandr.mod
STRTAB COMMANDER_COLOR_MAP comandr.ct
PACKAGE COMMANDER_PHRASE_PACKAGE comandr.con
STRTAB COMMANDER_CONVERSATION_PHRASES comandr.txt
PATH comm/starbas
PACKAGE STARBASE_PHRASE_PACKAGE comandr.con
STRTAB STARBASE_CONVERSATION_PHRASES starbas.txt
+3
View File
@@ -0,0 +1,3 @@
#define COMMANDER_FONT 0x00200003L
+3
View File
@@ -0,0 +1,3 @@
#define COMMANDER_PMAP_ANIM 0x00200002L
+3
View File
@@ -0,0 +1,3 @@
#define COMMANDER_MUSIC 0x00200006L
+5
View File
@@ -0,0 +1,5 @@
#define COMMANDER_COLOR_MAP 0x00200004L
#define COMMANDER_CONVERSATION_PHRASES 0x00400104L
#define STARBASE_CONVERSATION_PHRASES 0x00600204L
+4
View File
@@ -0,0 +1,4 @@
#include "igfxres.h"
#include "ifontres.h"
#include "istrtab.h"
#include "imusicre.h"
+7
View File
@@ -0,0 +1,7 @@
enum
{
COMMANDER_PACKAGE = 1,
COMMANDER_PHRASE_PACKAGE,
STARBASE_PHRASE_PACKAGE
};
+17
View File
@@ -0,0 +1,17 @@
#ifndef _RESTYPES_H
#define _RESTYPES_H
enum
{
KEY_CONFIG = 1,
GFXRES,
FONTRES,
STRTAB,
SNDRES,
MUSICRES,
RES_INDEX,
CODE
};
#endif /* _RESTYPES_H */
+126
View File
@@ -0,0 +1,126 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#ifndef _STRINGS_H
#define _STRINGS_H
enum
{
NULL_PHRASE,
GLAD_WHEN_YOU_COME_BACK,
GIVE_FUEL,
GIVE_FUEL_AGAIN,
ARE_YOU_SUPPLY_SHIP,
DO_YOU_HAVE_RADIO_THIS_TIME,
HERE_IS_ANOTHER_LANDER,
THE_WHAT_FROM_WHERE,
ABOUT_TIME,
MESSAGE_GARBLED_1,
MESSAGE_GARBLED_2,
HERE_IS_A_NEW_LANDER,
THIS_MAY_SEEM_SILLY,
OK_THE_NAFS,
OK_THE_CAN,
OK_THE_UFW,
OK_THE_NAME_IS_EMPIRE0,
OK_THE_NAME_IS_EMPIRE1,
FUEL_UP0,
FUEL_UP1,
WHAT_KIND_OF_IDIOT,
DONT_KNOW_WHO_YOU_ARE,
THATS_IMPOSSIBLE,
ASK_AWAY,
RADIOS_ON_MERCURY,
THANKS_FOR_HELPING,
STARBASE_IS,
HAPPENED_TO_EARTH,
URQUAN_LEFT,
BASE_ON_MOON,
ACKNOWLEDGE_SECRET,
ABOUT_BASE,
GOOD_LUCK_WITH_BASE,
DEALT_WITH_BASE_YET,
HERE_COMES_ILWRATH,
VERY_IMPRESSIVE,
IT_WAS_ABANDONED,
YOU_REALLY_FOUGHT_BASE,
IM_GLAD_YOU_WON,
IM_SURE_IT_WAS_DIFFICULT,
THAT_WAS_PROBE,
DEEP_TROUBLE,
GOOD_NEWS,
SURE_HOPE,
ABOUT_BASE_AGAIN,
COOK_BUTTS,
OVERTHROW_ALIENS,
KILL_MONSTERS,
GOOD_LUCK_AGAIN,
STARBASE_WILL_BE_READY,
overthrow_evil_aliens,
annihilate_those_monsters,
cook_their_butts,
where_get_radios,
well_go_get_them_now,
we_will_transfer_now,
what_will_you_give_us,
before_radios_we_need_info,
no_but_well_help0,
no_but_well_help1,
yes_this_is_supply_ship,
what_slave_planet,
i_lied,
plumb_out,
we_are_vindicator0,
we_are_vindicator1,
we_are_vindicator2,
first_give_info,
we_must_go_now,
where_can_i_get_radios,
ok_i_will_get_radios,
whats_this_starbase,
what_about_earth,
where_are_urquan,
our_mission_was_secret,
we_are_here_to_help,
tell_me_about_base,
we_will_take_care_of_base,
tell_me_again,
base_was_abandoned,
we_fought_them,
oh_yes_big_fight,
i_lied_it_was_abandoned,
i_cant_talk_about_it,
name_1,
name_2,
name_3,
name_40,
name_41,
i_lost_my_lander,
i_lost_another_lander,
need_fuel,
need_fuel_again,
what_was_red_thing,
it_went_away,
we_destroyed_it,
what_probe,
take_care_of_base_again,
goodbye_commander,
};
#endif /* _STRINGS_H */
+10
View File
@@ -0,0 +1,10 @@
INCLUDE ../../star3do.typ
PATH comm/druuge
PACKAGE DRUUGE_PACKAGE druuge.con
GFXRES DRUUGE_PMAP_ANIM druuge.ani
FONTRES DRUUGE_FONT druuge.fon
MUSICRES DRUUGE_MUSIC druuge.mod
STRTAB DRUUGE_CONVERSATION_PHRASES druuge.txt
+903
View File
@@ -0,0 +1,903 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "reslib.h"
#include "comm/druuge/resinst.h"
#include "starcon.h"
#include "commglue.h"
#include "comm/druuge/strings.h"
static LOCDATA druuge_desc =
{
NULL_PTR, /* init_encounter_func */
NULL_PTR, /* uninit_encounter_func */
(FRAME)DRUUGE_PMAP_ANIM, /* AlienFrame */
(FONT)DRUUGE_FONT, /* AlienFont */
WHITE_COLOR, /* AlienTextFColor */
BLACK_COLOR, /* AlienTextBColor */
0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */
0, /* AlienColorMap */
DRUUGE_MUSIC, /* AlienSong */
DRUUGE_CONVERSATION_PHRASES, /* PlayerPhrases */
11,
{
{
5, /* StartIndex */
4, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
9, 0, /* FrameRate */
9, 0, /* RestartRate */
},
{
9, /* StartIndex */
4, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
9, 0, /* FrameRate */
9, 0, /* RestartRate */
},
{
13, /* StartIndex */
6, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
9, 0, /* FrameRate */
9, 0, /* RestartRate */
},
{
19, /* StartIndex */
3, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
6, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
22, /* StartIndex */
3, /* NumFrames */
RANDOM_ANIM, /* AnimFlags */
10, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
25, /* StartIndex */
3, /* NumFrames */
RANDOM_ANIM, /* AnimFlags */
10, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
28, /* StartIndex */
3, /* NumFrames */
RANDOM_ANIM, /* AnimFlags */
10, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
31, /* StartIndex */
2, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
10, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
33, /* StartIndex */
7, /* NumFrames */
CIRCULAR_ANIM
| WAIT_TALKING, /* AnimFlags */
10, 0, /* FrameRate */
ONE_SECOND * 7, ONE_SECOND * 3,/* RestartRate */
},
{
40, /* StartIndex */
4, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
36, 0, /* FrameRate */
36, 0, /* RestartRate */
},
{
44, /* StartIndex */
4, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
24, 0, /* FrameRate */
24, 0, /* RestartRate */
},
},
{
0, /* StartIndex */
0, /* NumFrames */
0, /* AnimFlags */
0, 0, /* FrameRate */
0, 0, /* RestartRate */
},
{
1, /* StartIndex */
4, /* NumFrames */
0, /* AnimFlags */
8, 8, /* FrameRate */
10, 10, /* RestartRate */
},
};
static COUNT SlaveryCount = 0;
static void
ExitConversation (Response)
RESPONSE_REF Response;
{
if (PLAYER_SAID (Response, bye))
{
SET_GAME_STATE (BATTLE_SEGUE, 0);
if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
{
if (SlaveryCount)
{
UWORD PreviousSlaves;
PreviousSlaves = MAKE_WORD (
GET_GAME_STATE (CREW_SOLD_TO_DRUUGE0),
GET_GAME_STATE (CREW_SOLD_TO_DRUUGE1)
);
SlaveryCount += PreviousSlaves;
if (SlaveryCount > 250 && PreviousSlaves <= 250)
{
if (PreviousSlaves > 100)
GLOBAL (CrewCost) += (22 - 7);
else
GLOBAL (CrewCost) += 22;
}
else if (SlaveryCount > 100 && PreviousSlaves <= 100)
GLOBAL (CrewCost) += 7;
SET_GAME_STATE (CREW_SOLD_TO_DRUUGE0, LOBYTE (SlaveryCount));
SET_GAME_STATE (CREW_SOLD_TO_DRUUGE1, HIBYTE (SlaveryCount));
}
switch (GET_GAME_STATE (DRUUGE_HOME_VISITS))
{
case 1:
NPCPhrase (BYE_FROM_TRADE_WORLD_1);
break;
default:
NPCPhrase (BYE_FROM_TRADE_WORLD_2);
break;
}
}
else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 6))
NPCPhrase (GOODBYE_FROM_BOMB_PLANET);
else
NPCPhrase (GOODBYE_FROM_SPACE);
}
else /* if (Response == then_we_take_bomb) */
{
SET_GAME_STATE (BATTLE_SEGUE, 1);
NPCPhrase (FIGHT_FOR_BOMB);
}
}
static void TradeWorld (RESPONSE_REF Response);
static void
Buy (RESPONSE_REF Response)
{
if (PLAYER_SAID (Response, want_to_buy)
|| PLAYER_SAID (Response, im_ready_to_buy))
{
NPCPhrase (READY_TO_SELL);
if (!GET_GAME_STATE (ROSY_SPHERE))
NPCPhrase (HAVE_SPHERE);
if (!GET_GAME_STATE (ARTIFACT_2_ON_SHIP))
NPCPhrase (HAVE_ART_1);
if (!GET_GAME_STATE (ARTIFACT_3_ON_SHIP))
NPCPhrase (HAVE_ART_2);
NPCPhrase (SHIPS_AND_FUEL);
SET_GAME_STATE (KNOW_DRUUGE_SLAVERS, 3);
}
else if (PLAYER_SAID (Response, buy_druuge_ship))
{
#define SHIP_CREW_COST 100
if (GLOBAL_SIS (CrewEnlisted) < SHIP_CREW_COST)
NPCPhrase (NOT_ENOUGH_CREW);
else if (ActivateStarShip (DRUUGE_SHIP, FEASIBILITY_STUDY) == 0)
NPCPhrase (NOT_ENOUGH_ROOM);
else
{
SetSemaphore (&GraphicsSem);
DeltaSISGauges (-SHIP_CREW_COST, 0, 0);
ClearSemaphore (&GraphicsSem);
SlaveryCount += SHIP_CREW_COST;
ActivateStarShip (DRUUGE_SHIP, 1);
NPCPhrase (BOUGHT_SHIP);
}
}
#define ARTIFACT_CREW_COST 100
else if (PLAYER_SAID (Response, buy_rosy_sphere))
{
if (GLOBAL_SIS (CrewEnlisted) < ARTIFACT_CREW_COST)
NPCPhrase (NOT_ENOUGH_CREW);
else
{
SetSemaphore (&GraphicsSem);
DeltaSISGauges (-ARTIFACT_CREW_COST, 0, 0);
ClearSemaphore (&GraphicsSem);
SlaveryCount += ARTIFACT_CREW_COST;
SET_GAME_STATE (ROSY_SPHERE_ON_SHIP, 1);
SET_GAME_STATE (ROSY_SPHERE, 1);
NPCPhrase (BOUGHT_SPHERE);
}
}
else if (PLAYER_SAID (Response, buy_art_1))
{
if (GLOBAL_SIS (CrewEnlisted) < ARTIFACT_CREW_COST)
NPCPhrase (NOT_ENOUGH_CREW);
else
{
SetSemaphore (&GraphicsSem);
DeltaSISGauges (-ARTIFACT_CREW_COST, 0, 0);
ClearSemaphore (&GraphicsSem);
SlaveryCount += ARTIFACT_CREW_COST;
SET_GAME_STATE (ARTIFACT_2_ON_SHIP, 1);
NPCPhrase (BOUGHT_ART_1);
}
}
else if (PLAYER_SAID (Response, buy_art_2))
{
if (GLOBAL_SIS (CrewEnlisted) < ARTIFACT_CREW_COST)
NPCPhrase (NOT_ENOUGH_CREW);
else
{
SetSemaphore (&GraphicsSem);
DeltaSISGauges (-ARTIFACT_CREW_COST, 0, 0);
ClearSemaphore (&GraphicsSem);
SlaveryCount += ARTIFACT_CREW_COST;
SET_GAME_STATE (ARTIFACT_3_ON_SHIP, 1);
NPCPhrase (BOUGHT_ART_2);
}
}
else if (PLAYER_SAID (Response, buy_fuel))
{
#define FUEL_CREW_COST 10
if (GLOBAL_SIS (CrewEnlisted) < FUEL_CREW_COST)
NPCPhrase (NOT_ENOUGH_CREW);
else
{
SetSemaphore (&GraphicsSem);
DeltaSISGauges (-FUEL_CREW_COST,
FUEL_CREW_COST * FUEL_TANK_SCALE, 0);
ClearSemaphore (&GraphicsSem);
SlaveryCount += FUEL_CREW_COST;
NPCPhrase (BOUGHT_FUEL);
}
}
Response (buy_druuge_ship, Buy);
if (!GET_GAME_STATE (ROSY_SPHERE))
Response (buy_rosy_sphere, Buy);
if (!GET_GAME_STATE (ARTIFACT_2_ON_SHIP))
Response (buy_art_1, Buy);
if (!GET_GAME_STATE (ARTIFACT_3_ON_SHIP))
Response (buy_art_2, Buy);
Response (buy_fuel, Buy);
Response (done_buying, TradeWorld);
}
static void Sell (RESPONSE_REF R);
static RESPONSE_REF LastResponse = 0;
static void
Trade (RESPONSE_REF R)
{
if (!PLAYER_SAID (R, whats_the_sphere_again))
{
NPCPhrase (TRADE_FOR_SPHERE);
LastResponse = R;
}
else
{
NPCPhrase (SPHERE_IS);
DISABLE_PHRASE (whats_the_sphere_again);
}
Response (no_way, Sell);
Response (way, Sell);
if (PHRASE_ENABLED (whats_the_sphere_again))
{
Response (whats_the_sphere_again, Trade);
}
}
static void
DoTransaction (RESPONSE_REF R)
{
if (PLAYER_SAID (R, sell_maidens))
{
SET_GAME_STATE (MAIDENS_ON_SHIP, 0);
}
else if (PLAYER_SAID (R, sell_fragments))
{
BYTE num_frags;
if (GET_GAME_STATE (EGG_CASE0_ON_SHIP))
{
SET_GAME_STATE (EGG_CASE0_ON_SHIP, 0);
}
else if (GET_GAME_STATE (EGG_CASE1_ON_SHIP))
{
SET_GAME_STATE (EGG_CASE1_ON_SHIP, 0);
}
else if (GET_GAME_STATE (EGG_CASE2_ON_SHIP))
{
SET_GAME_STATE (EGG_CASE2_ON_SHIP, 0);
}
num_frags = GET_GAME_STATE (FRAGMENTS_BOUGHT) + 1;
SET_GAME_STATE (FRAGMENTS_BOUGHT, num_frags);
}
else if (PLAYER_SAID (R, sell_caster))
{
SET_GAME_STATE (BURV_BROADCASTERS_ON_SHIP, 0);
}
else if (PLAYER_SAID (R, sell_spawner))
{
SET_GAME_STATE (PORTAL_SPAWNER_ON_SHIP, 0);
}
if (!GET_GAME_STATE (ROSY_SPHERE)
&& GET_GAME_STATE (ROSY_SPHERE_ON_SHIP))
{
SET_GAME_STATE (ROSY_SPHERE, 1);
}
else
{
BYTE trade_gas;
BYTE ship_slots, ships_to_trade;
trade_gas = 0;
ships_to_trade = 0;
ship_slots = ActivateStarShip (DRUUGE_SHIP, FEASIBILITY_STUDY);
if (PLAYER_SAID (R, sell_maidens))
{
NPCPhrase (BOUGHT_MAIDENS);
ships_to_trade = 6;
}
else if (PLAYER_SAID (R, sell_fragments))
{
NPCPhrase (BOUGHT_FRAGMENTS);
ships_to_trade = 1;
}
else if (PLAYER_SAID (R, sell_caster))
{
NPCPhrase (BOUGHT_CASTER);
ships_to_trade = 0;
trade_gas = 1;
}
else if (PLAYER_SAID (R, sell_spawner))
{
NPCPhrase (BOUGHT_SPAWNER);
ships_to_trade = 3;
trade_gas = 1;
}
NPCPhrase (YOU_GET);
if (ships_to_trade)
{
ActivateStarShip (DRUUGE_SHIP, ships_to_trade);
if (ship_slots >= ships_to_trade)
NPCPhrase (DEAL_FOR_STATED_SHIPS);
else if (ship_slots == 0)
NPCPhrase (DEAL_FOR_NO_SHIPS);
else
NPCPhrase (DEAL_FOR_LESS_SHIPS);
if (trade_gas)
NPCPhrase (YOU_ALSO_GET);
}
if (trade_gas)
{
BYTE slot;
COUNT f;
DWORD capacity;
capacity = FUEL_RESERVE;
slot = NUM_MODULE_SLOTS - 1;
do
{
if (GLOBAL_SIS (ModuleSlots[slot]) == FUEL_TANK
|| GLOBAL_SIS (ModuleSlots[slot]) == HIGHEFF_FUELSYS)
{
COUNT volume;
volume = GLOBAL_SIS (ModuleSlots[slot]) == FUEL_TANK
? FUEL_TANK_CAPACITY : HEFUEL_TANK_CAPACITY;
capacity += volume;
}
} while (slot--);
capacity -= GLOBAL_SIS (FuelOnBoard);
f = (COUNT)((capacity + (FUEL_TANK_SCALE >> 1)) / FUEL_TANK_SCALE);
SetSemaphore (&GraphicsSem);
while (capacity > 0x3FFFL)
{
DeltaSISGauges (0, 0x3FFF, 0);
capacity -= 0x3FFF;
}
DeltaSISGauges (0, (SIZE)capacity, 0);
ClearSemaphore (&GraphicsSem);
NPCPhrase (FUEL0);
NPCPhrase (-(int)f);
NPCPhrase (FUEL1);
if (f >= 250)
NPCPhrase (HIDEOUS_DEAL);
else if (f >= 100)
NPCPhrase (BAD_DEAL);
else if (f >= 50)
NPCPhrase (FAIR_DEAL);
else if (f >= 10)
NPCPhrase (GOOD_DEAL);
else
NPCPhrase (FINE_DEAL);
}
}
}
static void
Sell (RESPONSE_REF Response)
{
RESPONSE_FUNC RespFunc;
if (PLAYER_SAID (Response, want_to_sell))
NPCPhrase (READY_TO_BUY);
else if (PLAYER_SAID (Response, no_way)
|| PLAYER_SAID (Response, way))
{
if (PLAYER_SAID (Response, no_way))
NPCPhrase (OK_REGULAR_DEAL);
else
{
NPCPhrase (OK_HERES_SPHERE);
SET_GAME_STATE (ROSY_SPHERE_ON_SHIP, 1);
}
DoTransaction (LastResponse);
}
else if (PLAYER_SAID (Response, sell_maidens)
|| PLAYER_SAID (Response, sell_fragments)
|| PLAYER_SAID (Response, sell_caster)
|| PLAYER_SAID (Response, sell_spawner))
{
DoTransaction (Response);
}
if (!GET_GAME_STATE (ROSY_SPHERE))
RespFunc = (RESPONSE_FUNC)Trade;
else
RespFunc = (RESPONSE_FUNC)Sell;
if (GET_GAME_STATE (MAIDENS_ON_SHIP))
Response (sell_maidens, RespFunc);
if ((GET_GAME_STATE (EGG_CASE0_ON_SHIP)
|| GET_GAME_STATE (EGG_CASE1_ON_SHIP)
|| GET_GAME_STATE (EGG_CASE2_ON_SHIP))
&& GET_GAME_STATE (FRAGMENTS_BOUGHT) < 2)
Response (sell_fragments, RespFunc);
if (GET_GAME_STATE (BURV_BROADCASTERS_ON_SHIP))
Response (sell_caster, RespFunc);
if (GET_GAME_STATE (PORTAL_SPAWNER_ON_SHIP))
Response (sell_spawner, RespFunc);
Response (done_selling, TradeWorld);
}
static void
ExplainSlaveTrade (RESPONSE_REF R)
{
if (PLAYER_SAID (R, want_to_buy))
NPCPhrase (WE_SELL_FOR_CREW);
else if (PLAYER_SAID (R, isnt_this_slave_trading))
{
NPCPhrase (NO_SLAVE_TRADE);
SET_GAME_STATE (KNOW_DRUUGE_SLAVERS, 1);
}
else if (PLAYER_SAID (R, what_do_with_crew))
{
NPCPhrase (HAVE_FUN);
SET_GAME_STATE (KNOW_DRUUGE_SLAVERS, 2);
}
switch (GET_GAME_STATE (KNOW_DRUUGE_SLAVERS))
{
case 0:
Response (isnt_this_slave_trading, ExplainSlaveTrade);
break;
case 1:
Response (what_do_with_crew, ExplainSlaveTrade);
break;
}
Response (i_will_never_trade_crew, TradeWorld);
Response (im_ready_to_buy, Buy);
}
static void
TradeWorld (RESPONSE_REF Response)
{
if (PLAYER_SAID (Response, whats_up_at_trade_world))
{
BYTE NumVisits;
NumVisits = GET_GAME_STATE (DRUUGE_HOME_INFO);
switch (NumVisits++)
{
case 0:
NPCPhrase (GEN_INFO_AT_TRADE_WORLD_1);
break;
case 1:
NPCPhrase (GEN_INFO_AT_TRADE_WORLD_2);
break;
case 2:
NPCPhrase (GEN_INFO_AT_TRADE_WORLD_3);
if (GET_GAME_STATE (KNOW_ABOUT_SHATTERED) < 2)
{
SET_GAME_STATE (KNOW_ABOUT_SHATTERED, 2);
}
break;
case 3:
NPCPhrase (GEN_INFO_AT_TRADE_WORLD_4);
--NumVisits;
break;
}
SET_GAME_STATE (DRUUGE_HOME_INFO, NumVisits);
DISABLE_PHRASE (whats_up_at_trade_world);
}
else if (PLAYER_SAID (Response, done_selling))
NPCPhrase (OK_DONE_SELLING);
else if (PLAYER_SAID (Response, done_buying))
NPCPhrase (OK_DONE_BUYING);
else if (PLAYER_SAID (Response, i_will_never_trade_crew))
NPCPhrase (YOUR_LOSS);
if (PHRASE_ENABLED (whats_up_at_trade_world))
{
Response (whats_up_at_trade_world, TradeWorld);
}
Response (want_to_sell, Sell);
if (GET_GAME_STATE (KNOW_DRUUGE_SLAVERS) == 3)
Response (want_to_buy, Buy);
else
Response (want_to_buy, ExplainSlaveTrade);
Response (bye, ExitConversation);
}
static void
BombAmbush (RESPONSE_REF Response)
{
if (PLAYER_SAID (Response, whats_up_at_bomb_planet))
{
NPCPhrase (GEN_INFO_AT_BOMB_PLANET);
SET_GAME_STATE (BOMB_VISITS, 2);
}
else if (PLAYER_SAID (Response, we_get_bomb))
{
NPCPhrase (NOT_GET_BOMB);
SET_GAME_STATE (BOMB_VISITS, 3);
}
switch (GET_GAME_STATE (BOMB_VISITS))
{
case 1:
Response (whats_up_at_bomb_planet, BombAmbush);
break;
case 2:
Response (we_get_bomb, BombAmbush);
break;
default:
Response (then_we_take_bomb, ExitConversation);
break;
}
Response (bye, ExitConversation);
}
static void
Space (RESPONSE_REF Response)
{
if (PLAYER_SAID (Response, whats_up_in_space))
{
BYTE NumVisits;
NumVisits = GET_GAME_STATE (DRUUGE_SPACE_INFO);
switch (NumVisits++)
{
case 0:
NPCPhrase (GENERAL_INFO_IN_SPACE_1);
break;
case 1:
NPCPhrase (GENERAL_INFO_IN_SPACE_2);
break;
case 2:
NPCPhrase (GENERAL_INFO_IN_SPACE_3);
break;
case 3:
NPCPhrase (GENERAL_INFO_IN_SPACE_4);
--NumVisits;
break;
}
SET_GAME_STATE (DRUUGE_SPACE_INFO, NumVisits);
DISABLE_PHRASE (whats_up_in_space);
}
if (PHRASE_ENABLED (whats_up_in_space))
{
Response (whats_up_in_space, Space);
}
Response (bye, ExitConversation);
}
static void
Intro (void)
{
BYTE NumVisits;
if (LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
{
// NPCPhrase (OUT_TAKES);
SET_GAME_STATE (BATTLE_SEGUE, 0);
goto ExitIntro;
}
if (GET_GAME_STATE (DRUUGE_MANNER))
{
if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
{
NumVisits = GET_GAME_STATE (DRUUGE_HOME_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (HSTL_TRADE_WORLD_HELLO_1);
break;
case 1:
NPCPhrase (HSTL_TRADE_WORLD_HELLO_2);
--NumVisits;
break;
}
SET_GAME_STATE (DRUUGE_HOME_VISITS, NumVisits);
}
else
{
NumVisits = GET_GAME_STATE (DRUUGE_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (HOSTILE_SPACE_HELLO_1);
break;
case 1:
NPCPhrase (HOSTILE_SPACE_HELLO_2);
--NumVisits;
break;
}
SET_GAME_STATE (DRUUGE_VISITS, NumVisits);
}
SET_GAME_STATE (BATTLE_SEGUE, 1);
}
else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
{
{
NumVisits = GET_GAME_STATE (DRUUGE_HOME_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (INITIAL_TRADE_WORLD_HELLO);
break;
case 1:
NPCPhrase (SSQ_TRADE_WORLD_HELLO_1);
break;
case 2:
NPCPhrase (SSQ_TRADE_WORLD_HELLO_2);
break;
case 3:
NPCPhrase (SSQ_TRADE_WORLD_HELLO_3);
break;
case 4:
NPCPhrase (SSQ_TRADE_WORLD_HELLO_4);
--NumVisits;
break;
}
SET_GAME_STATE (DRUUGE_HOME_VISITS, NumVisits);
}
if (GET_GAME_STATE (ATTACKED_DRUUGE)
&& !GET_GAME_STATE (DRUUGE_DISCLAIMER))
{
// NPCPhrase (HOSTILE_TRADE);
SET_GAME_STATE (DRUUGE_DISCLAIMER, 1);
}
if (GET_GAME_STATE (MAIDENS_ON_SHIP)
&& !GET_GAME_STATE (SCANNED_MAIDENS))
{
NPCPhrase (SCAN_MAIDENS);
SET_GAME_STATE (SCANNED_MAIDENS, 1);
}
if ((GET_GAME_STATE (EGG_CASE0_ON_SHIP)
|| GET_GAME_STATE (EGG_CASE1_ON_SHIP)
|| GET_GAME_STATE (EGG_CASE2_ON_SHIP))
&& !GET_GAME_STATE (SCANNED_FRAGMENTS))
{
if (GET_GAME_STATE (FRAGMENTS_BOUGHT) < 2)
NPCPhrase (SCAN_FRAGMENTS);
else
NPCPhrase (ENOUGH_FRAGMENTS);
SET_GAME_STATE (SCANNED_FRAGMENTS, 1);
}
if (GET_GAME_STATE (BURV_BROADCASTERS_ON_SHIP)
&& !GET_GAME_STATE (SCANNED_CASTER))
{
NPCPhrase (SCAN_DRUUGE_CASTER);
SET_GAME_STATE (SCANNED_CASTER, 1);
}
if (GET_GAME_STATE (PORTAL_SPAWNER_ON_SHIP)
&& !GET_GAME_STATE (SCANNED_SPAWNER))
{
NPCPhrase (SCAN_ARILOU_SPAWNER);
SET_GAME_STATE (SCANNED_SPAWNER, 1);
}
TradeWorld ((RESPONSE_REF)0);
}
else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 6))
{
if (GET_GAME_STATE (BOMB_VISITS))
NPCPhrase (SUBSEQ_BOMB_WORLD_HELLO);
else
{
NPCPhrase (INIT_BOMB_WORLD_HELLO);
SET_GAME_STATE (BOMB_VISITS, 1);
}
BombAmbush ((RESPONSE_REF)0);
}
else if (GET_GAME_STATE (ATTACKED_DRUUGE))
{
NumVisits = GET_GAME_STATE (DRUUGE_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (HOSTILE_SPACE_HELLO_1);
break;
case 1:
NPCPhrase (HOSTILE_SPACE_HELLO_2);
--NumVisits;
break;
}
SET_GAME_STATE (DRUUGE_VISITS, NumVisits);
SET_GAME_STATE (BATTLE_SEGUE, 1);
}
else
{
NumVisits = 0;
if (GetHeadLink (&GLOBAL (built_ship_q)) == 0)
{
for (NumVisits = 0; NumVisits < NUM_MODULE_SLOTS; ++NumVisits)
{
BYTE which_module;
which_module = GLOBAL_SIS (ModuleSlots[NumVisits]);
if (which_module >= GUN_WEAPON
&& which_module <= CANNON_WEAPON)
{
NumVisits = 0;
break;
}
}
}
if (NumVisits)
{
NumVisits = GET_GAME_STATE (DRUUGE_SALVAGE);
switch (NumVisits++)
{
case 0:
NPCPhrase (SALVAGE_YOUR_SHIP_1);
break;
case 1:
NPCPhrase (SALVAGE_YOUR_SHIP_2);
--NumVisits;
break;
}
SET_GAME_STATE (DRUUGE_SALVAGE, NumVisits);
SET_GAME_STATE (BATTLE_SEGUE, 1);
}
else
{
NumVisits = GET_GAME_STATE (DRUUGE_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (INIT_SPACE_HELLO);
break;
case 1:
NPCPhrase (SUBSEQUENT_SPACE_HELLO);
--NumVisits;
break;
}
SET_GAME_STATE (DRUUGE_VISITS, NumVisits);
Space ((RESPONSE_REF)0);
}
}
ExitIntro:
;
}
static COUNT
uninit_druuge (void)
{
if (GET_GAME_STATE (BATTLE_SEGUE) == 1
&& !GET_GAME_STATE (DRUUGE_MANNER))
{
if (!GET_GAME_STATE (ATTACKED_DRUUGE))
{
SET_GAME_STATE (ATTACKED_DRUUGE, 1);
SET_GAME_STATE (DRUUGE_VISITS, 0);
}
}
return (0);
}
LOCDATAPTR
init_druuge_comm (void)
{
LOCDATAPTR retval;
druuge_desc.init_encounter_func = Intro;
druuge_desc.uninit_encounter_func = uninit_druuge;
druuge_desc.AlienTextTemplate.baseline.x =
TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
druuge_desc.AlienTextTemplate.baseline.y = 64;
druuge_desc.AlienTextTemplate.align = ALIGN_CENTER;
druuge_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;
if ((GET_GAME_STATE (DRUUGE_MANNER) == 0
&& (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7)))
|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
{
SET_GAME_STATE (BATTLE_SEGUE, 0);
}
else
{
SET_GAME_STATE (BATTLE_SEGUE, 1);
}
retval = &druuge_desc;
return (retval);
}
+3
View File
@@ -0,0 +1,3 @@
#define DRUUGE_FONT 0x00200003L
+3
View File
@@ -0,0 +1,3 @@
#define DRUUGE_PMAP_ANIM 0x00200002L
+3
View File
@@ -0,0 +1,3 @@
#define DRUUGE_MUSIC 0x00200006L
+3
View File
@@ -0,0 +1,3 @@
#define DRUUGE_CONVERSATION_PHRASES 0x00200004L
+4
View File
@@ -0,0 +1,4 @@
#include "igfxres.h"
#include "ifontres.h"
#include "istrtab.h"
#include "imusicre.h"
+5
View File
@@ -0,0 +1,5 @@
enum
{
DRUUGE_PACKAGE = 1
};
+17
View File
@@ -0,0 +1,17 @@
#ifndef _RESTYPES_H
#define _RESTYPES_H
enum
{
KEY_CONFIG = 1,
GFXRES,
FONTRES,
STRTAB,
SNDRES,
MUSICRES,
RES_INDEX,
CODE
};
#endif /* _RESTYPES_H */
+131
View File
@@ -0,0 +1,131 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#ifndef _STRINGS_H
#define _STRINGS_H
enum
{
NULL_PHRASE,
AMBUSH_IS_FIRST_HELLO,
INIT_BOMB_WORLD_HELLO,
SUBSEQ_BOMB_WORLD_HELLO,
whats_up_at_bomb_planet,
GEN_INFO_AT_BOMB_PLANET,
we_get_bomb,
NOT_GET_BOMB,
then_we_take_bomb,
FIGHT_FOR_BOMB,
GOODBYE_FROM_BOMB_PLANET,
NOT_ENOUGH_ROOM,
TRADE_FOR_SPHERE,
no_way,
OK_REGULAR_DEAL,
way,
OK_HERES_SPHERE,
whats_the_sphere_again,
SPHERE_IS,
WE_SELL_FOR_CREW,
i_will_never_trade_crew,
YOUR_LOSS,
isnt_this_slave_trading,
NO_SLAVE_TRADE,
what_do_with_crew,
HAVE_FUN,
im_ready_to_buy,
THIS_FOR_SALE,
HAVE_SPHERE,
HAVE_ART_2,
HAVE_ART_1,
SHIPS_AND_FUEL,
BOUGHT_SHIP,
BOUGHT_FUEL,
BOUGHT_ART_2,
BOUGHT_ART_1,
BOUGHT_SPHERE,
repeat_what_to_sell,
INIT_SPACE_HELLO,
SUBSEQUENT_SPACE_HELLO,
whats_up_in_space,
GENERAL_INFO_IN_SPACE_1,
GENERAL_INFO_IN_SPACE_2,
GENERAL_INFO_IN_SPACE_3,
GENERAL_INFO_IN_SPACE_4,
GOODBYE_FROM_SPACE,
HSTL_TRADE_WORLD_HELLO_1,
HSTL_TRADE_WORLD_HELLO_2,
HOSTILE_SPACE_HELLO_1,
HOSTILE_SPACE_HELLO_2,
INITIAL_TRADE_WORLD_HELLO,
SSQ_TRADE_WORLD_HELLO_1,
SSQ_TRADE_WORLD_HELLO_2,
SSQ_TRADE_WORLD_HELLO_3,
SSQ_TRADE_WORLD_HELLO_4,
whats_up_at_trade_world,
GEN_INFO_AT_TRADE_WORLD_1,
GEN_INFO_AT_TRADE_WORLD_2,
GEN_INFO_AT_TRADE_WORLD_3,
GEN_INFO_AT_TRADE_WORLD_4,
SCAN_MAIDENS,
SCAN_FRAGMENTS,
SCAN_DRUUGE_CASTER,
SCAN_ARILOU_SPAWNER,
ENOUGH_FRAGMENTS,
READY_TO_BUY,
READY_TO_SELL,
BYE_FROM_TRADE_WORLD_1,
BYE_FROM_TRADE_WORLD_2,
NOT_ENOUGH_CREW,
EXCHANGE_MADE,
OK_DONE_BUYING,
OK_DONE_SELLING,
bye,
want_to_sell,
want_to_buy,
buy_druuge_ship,
buy_fuel,
buy_art_1,
buy_art_2,
buy_rosy_sphere,
done_buying,
done_selling,
sell_maidens,
sell_caster,
sell_fragments,
sell_spawner,
BOUGHT_MAIDENS,
BOUGHT_FRAGMENTS,
BOUGHT_CASTER,
YOU_GET,
YOU_ALSO_GET,
BOUGHT_SPAWNER,
SALVAGE_YOUR_SHIP_1,
SALVAGE_YOUR_SHIP_2,
DEAL_FOR_STATED_SHIPS,
DEAL_FOR_LESS_SHIPS,
DEAL_FOR_NO_SHIPS,
FUEL0,
FUEL1,
HIDEOUS_DEAL,
BAD_DEAL,
FAIR_DEAL,
GOOD_DEAL,
FINE_DEAL,
};
#endif /* _STRINGS_H */
View File
+3
View File
@@ -0,0 +1,3 @@
#define ILWRATH_FONT 0x00200003L
+3
View File
@@ -0,0 +1,3 @@
#define ILWRATH_PMAP_ANIM 0x00200002L
+10
View File
@@ -0,0 +1,10 @@
INCLUDE ../../star3do.typ
PATH comm/ilwrath
PACKAGE ILWRATH_PACKAGE ilwrath.con
GFXRES ILWRATH_PMAP_ANIM ilwrath.ani
FONTRES ILWRATH_FONT ilwrath.fon
MUSICRES ILWRATH_MUSIC ilwrath.mod
STRTAB ILWRATH_CONVERSATION_PHRASES ilwrath.txt
+624
View File
@@ -0,0 +1,624 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#include "reslib.h"
#include "comm/ilwrath/resinst.h"
#include "starcon.h"
#include "commglue.h"
#include "comm/ilwrath/strings.h"
static LOCDATA ilwrath_desc =
{
NULL_PTR, /* init_encounter_func */
NULL_PTR, /* uninit_encounter_func */
(FRAME)ILWRATH_PMAP_ANIM, /* AlienFrame */
(FONT)ILWRATH_FONT, /* AlienFont */
WHITE_COLOR, /* AlienTextFColor */
BLACK_COLOR, /* AlienTextBColor */
0, /* SIS_TEXT_WIDTH - 16, */ /* AlienTextWidth */
0, /* AlienColorMap */
ILWRATH_MUSIC, /* AlienSong */
ILWRATH_CONVERSATION_PHRASES, /* PlayerPhrases */
4, /* NumAnimations */
{
{
6, /* StartIndex */
5, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
6, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
11, /* StartIndex */
5, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
6, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
16, /* StartIndex */
5, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
6, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
{
21, /* StartIndex */
6, /* NumFrames */
CIRCULAR_ANIM, /* AnimFlags */
6, 0, /* FrameRate */
ONE_SECOND, ONE_SECOND * 3, /* RestartRate */
},
},
{
0, /* StartIndex */
0, /* NumFrames */
0, /* AnimFlags */
0, 0, /* FrameRate */
0, 0, /* RestartRate */
},
{
1, /* StartIndex */
5, /* NumFrames */
0, /* AnimFlags */
8, 0, /* FrameRate */
10, 0, /* RestartRate */
},
};
static void
CombatIsInevitable (Response)
RESPONSE_REF Response;
{
SET_GAME_STATE (BATTLE_SEGUE, 1);
if (PLAYER_SAID (Response, you_are_weak))
NPCPhrase (STRENGTH_NOT_ALL);
else if (PLAYER_SAID (Response, slay_by_thousands))
NPCPhrase (NO_SLAY_BY_THOUSANDS);
else if (PLAYER_SAID (Response, ease_up))
NPCPhrase (NO_EASE_UP);
else if (PLAYER_SAID (Response, bye_space))
NPCPhrase (GOODBYE_AND_DIE_SPACE);
else if (PLAYER_SAID (Response, bye_homeworld))
NPCPhrase (GOODBYE_AND_DIE_HOMEWORLD);
else if (PLAYER_SAID (Response, want_peace))
NPCPhrase (NO_PEACE);
else if (PLAYER_SAID (Response, want_alliance))
NPCPhrase (NO_ALLIANCE);
else if (PLAYER_SAID (Response, but_evil_is_defined))
NPCPhrase (DONT_CONFUSE_US);
else if (PLAYER_SAID (Response, bye_gods))
{
NPCPhrase (GOODBYE_GODS);
SET_GAME_STATE (BATTLE_SEGUE, 0);
}
if (PLAYER_SAID (Response, whats_up))
{
NPCPhrase (GENERAL_INFO);
Response (bye, CombatIsInevitable);
}
else if (PLAYER_SAID (Response, whats_up_space_1)
|| PLAYER_SAID (Response, whats_up_space_2)
|| PLAYER_SAID (Response, whats_up_space_3)
|| PLAYER_SAID (Response, whats_up_space_4)
|| PLAYER_SAID (Response, whats_up_space_5))
{
BYTE NumVisits;
NumVisits = GET_GAME_STATE (ILWRATH_INFO);
switch (NumVisits++)
{
case 0:
NPCPhrase (GENERAL_INFO_SPACE_1);
break;
case 1:
NPCPhrase (GENERAL_INFO_SPACE_2);
break;
case 2:
NPCPhrase (GENERAL_INFO_SPACE_3);
break;
case 3:
NPCPhrase (GENERAL_INFO_SPACE_4);
break;
case 4:
NPCPhrase (GENERAL_INFO_SPACE_5);
--NumVisits;
break;
}
SET_GAME_STATE (ILWRATH_INFO, NumVisits);
}
else
{
if (PLAYER_SAID (Response, bye))
NPCPhrase (GOODBYE_AND_DIE);
else if (PLAYER_SAID (Response, where_you_come_from))
NPCPhrase (CAME_FROM);
if (PLAYER_SAID (Response, it_will_be_a_pleasure))
NPCPhrase (WHO_BLASTS_WHO);
if (PLAYER_SAID (Response, surrender))
NPCPhrase (NO_SURRENDER);
if (PLAYER_SAID (Response, be_reasonable))
NPCPhrase (NOT_REASONABLE);
}
}
static void IlwrathHome (RESPONSE_REF R);
static void
IlwrathGods (RESPONSE_REF R)
{
BYTE GodsLeft;
GodsLeft = FALSE;
if (PLAYER_SAID (R, want_info_on_gods))
NPCPhrase (SO_MUCH_TO_KNOW);
else if (PLAYER_SAID (R, when_start_worship))
{
NPCPhrase (LONG_AGO);
DISABLE_PHRASE (when_start_worship);
}
else if (PLAYER_SAID (R, any_good_gods))
{
NPCPhrase (KILLED_GOOD_GODS);
DISABLE_PHRASE (any_good_gods);
}
else if (PLAYER_SAID (R, how_talk_with_gods))
{
NPCPhrase (CHANNEL_44);
DISABLE_PHRASE (how_talk_with_gods);
}
else if (PLAYER_SAID (R, why_44))
{
NPCPhrase (BECAUSE_44);
DISABLE_PHRASE (why_44);
}
if (PHRASE_ENABLED (when_start_worship))
{
Response (when_start_worship, IlwrathGods);
GodsLeft = TRUE;
}
if (PHRASE_ENABLED (any_good_gods))
{
Response (any_good_gods, IlwrathGods);
GodsLeft = TRUE;
}
if (PHRASE_ENABLED (how_talk_with_gods))
{
Response (how_talk_with_gods, IlwrathGods);
GodsLeft = TRUE;
}
else if (PHRASE_ENABLED (why_44))
{
Response (why_44, IlwrathGods);
GodsLeft = TRUE;
}
Response (enough_gods, IlwrathHome);
if (!GodsLeft)
DISABLE_PHRASE (want_info_on_gods);
}
static void
IlwrathInfo (RESPONSE_REF R)
{
BYTE InfoLeft;
InfoLeft = FALSE;
if (PLAYER_SAID (R, want_info_on_ilwrath))
NPCPhrase (WHAT_ABOUT_ILWRATH);
else if (PLAYER_SAID (R, what_about_physio))
{
NPCPhrase (ABOUT_PHYSIO);
DISABLE_PHRASE (what_about_physio);
}
else if (PLAYER_SAID (R, what_about_history))
{
NPCPhrase (ABOUT_HISTORY);
DISABLE_PHRASE (what_about_history);
}
else if (PLAYER_SAID (R, what_about_culture))
{
NPCPhrase (ABOUT_CULTURE);
DISABLE_PHRASE (what_about_culture);
}
else if (PLAYER_SAID (R, what_about_urquan))
{
NPCPhrase (URQUAN_TOO_NICE);
DISABLE_PHRASE (what_about_urquan);
}
else if (PLAYER_SAID (R, are_you_evil))
{
NPCPhrase (OF_COURSE_WERE_EVIL);
DISABLE_PHRASE (are_you_evil);
}
if (PHRASE_ENABLED (what_about_physio))
{
Response (what_about_physio, IlwrathInfo);
InfoLeft = TRUE;
}
if (PHRASE_ENABLED (what_about_history))
{
Response (what_about_history, IlwrathInfo);
InfoLeft = TRUE;
}
if (PHRASE_ENABLED (what_about_culture))
{
Response (what_about_culture, IlwrathInfo);
InfoLeft = TRUE;
}
if (PHRASE_ENABLED (what_about_urquan))
{
Response (what_about_urquan, IlwrathInfo);
InfoLeft = TRUE;
}
if (PHRASE_ENABLED (are_you_evil))
{
Response (are_you_evil, IlwrathInfo);
InfoLeft = TRUE;
}
else
{
Response (but_evil_is_defined, CombatIsInevitable);
InfoLeft = TRUE;
}
Response (enough_ilwrath, IlwrathHome);
if (!InfoLeft)
DISABLE_PHRASE (want_info_on_ilwrath);
}
static void
IlwrathHome (RESPONSE_REF R)
{
if (R == 0)
{
BYTE NumVisits;
NumVisits = GET_GAME_STATE (ILWRATH_HOME_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (INIT_HOME_HELLO);
break;
case 1:
NPCPhrase (SUBSEQUENT_HOME_HELLO);
--NumVisits;
break;
}
SET_GAME_STATE (ILWRATH_HOME_VISITS, NumVisits);
}
else if (PLAYER_SAID (R, enough_gods))
NPCPhrase (OK_ENOUGH_GODS);
else if (PLAYER_SAID (R, enough_ilwrath))
NPCPhrase (OK_ENOUGH_ILWRATH);
if (PHRASE_ENABLED (want_info_on_gods))
{
Response (want_info_on_gods, IlwrathGods);
}
if (PHRASE_ENABLED (want_info_on_ilwrath))
{
Response (want_info_on_ilwrath, IlwrathInfo);
}
Response (want_peace, CombatIsInevitable);
Response (want_alliance, CombatIsInevitable);
Response (bye_homeworld, CombatIsInevitable);
}
static void GodsSpeak (RESPONSE_REF R);
static void
GodsOrder (RESPONSE_REF R)
{
BYTE OrdersLeft;
OrdersLeft = FALSE;
if (PLAYER_SAID (R, other_divine_orders))
NPCPhrase (WHAT_ORDERS);
else if (PLAYER_SAID (R, say_warship))
{
NPCPhrase (OK_WARSHIP);
DISABLE_PHRASE (say_warship);
}
else if (PLAYER_SAID (R, say_dwe))
{
NPCPhrase (OK_DWE);
DISABLE_PHRASE (say_dwe);
}
else if (PLAYER_SAID (R, say_youboo))
{
NPCPhrase (OK_YOUBOO);
DISABLE_PHRASE (say_youboo);
}
else if (PLAYER_SAID (R, say_dillrat))
{
NPCPhrase (OK_DILRAT);
DISABLE_PHRASE (say_dillrat);
}
if (PHRASE_ENABLED (say_warship))
{
Response (say_warship, GodsOrder);
OrdersLeft = TRUE;
}
if (PHRASE_ENABLED (say_dwe))
{
Response (say_dwe, GodsOrder);
OrdersLeft = TRUE;
}
if (PHRASE_ENABLED (say_youboo))
{
Response (say_youboo, GodsOrder);
OrdersLeft = TRUE;
}
if (PHRASE_ENABLED (say_dillrat))
{
Response (say_dillrat, GodsOrder);
OrdersLeft = TRUE;
}
Response (enough_orders, GodsSpeak);
if (!OrdersLeft)
DISABLE_PHRASE (other_divine_orders);
}
static void
GodsSpeak (RESPONSE_REF R)
{
BYTE NumVisits;
if (R == 0)
{
if (GET_GAME_STATE (ILWRATH_FIGHT_THRADDASH))
NPCPhrase (GLORIOUS_WORSHIP);
else if (GET_GAME_STATE (ILWRATH_DECEIVED))
NPCPhrase (ON_WAY);
else
{
NumVisits = GET_GAME_STATE (ILWRATH_GODS_SPOKEN);
switch (NumVisits++)
{
case 0:
NPCPhrase (ILWRATH_BELIEVE);
break;
case 1:
NPCPhrase (GODS_RETURN_1);
break;
case 2:
NPCPhrase (GODS_RETURN_2);
break;
case 3:
NPCPhrase (GODS_RETURN_3);
--NumVisits;
break;
}
SET_GAME_STATE (ILWRATH_GODS_SPOKEN, NumVisits);
}
}
else if (PLAYER_SAID (R, go_kill_thraddash))
{
NPCPhrase (OK_KILL_THRADDASH);
SET_GAME_STATE (ILWRATH_DECEIVED, 1);
AddEvent (RELATIVE_EVENT, 0, 0, 0, ADVANCE_ILWRATH_MISSION);
}
else if (PLAYER_SAID (R, worship_us))
{
NumVisits = GET_GAME_STATE (ILWRATH_WORSHIP);
switch (NumVisits++)
{
case 0:
NPCPhrase (WE_WORSHIP_1);
break;
case 1:
NPCPhrase (WE_WORSHIP_2);
break;
case 2:
NPCPhrase (WE_WORSHIP_3);
--NumVisits;
break;
}
SET_GAME_STATE (ILWRATH_WORSHIP, NumVisits);
DISABLE_PHRASE (worship_us);
}
else if (PLAYER_SAID (R, enough_orders))
NPCPhrase (NEVER_ENOUGH);
if (!GET_GAME_STATE (ILWRATH_DECEIVED))
Response (go_kill_thraddash, GodsSpeak);
if (PHRASE_ENABLED (worship_us))
Response (worship_us, GodsSpeak);
if (PHRASE_ENABLED (other_divine_orders))
{
Response (other_divine_orders, GodsOrder);
}
Response (bye_gods, CombatIsInevitable);
}
static void
IlwrathSpace (RESPONSE_REF R)
{
BYTE NumVisits;
if (R == 0)
{
NumVisits = GET_GAME_STATE (ILWRATH_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (INIT_HELLO_SPACE);
break;
case 1:
NPCPhrase (SUBSEQUENT_HELLO_SPACE_1);
break;
case 2:
NPCPhrase (SUBSEQUENT_HELLO_SPACE_2);
break;
case 3:
NPCPhrase (SUBSEQUENT_HELLO_SPACE_3);
break;
case 4:
NPCPhrase (SUBSEQUENT_HELLO_SPACE_4);
--NumVisits;
break;
}
SET_GAME_STATE (ILWRATH_VISITS, NumVisits);
}
NumVisits = GET_GAME_STATE (ILWRATH_INFO);
switch (NumVisits)
{
case 0:
Response (whats_up_space_1, CombatIsInevitable);
break;
case 1:
Response (whats_up_space_2, CombatIsInevitable);
break;
case 2:
Response (whats_up_space_3, CombatIsInevitable);
break;
case 3:
Response (whats_up_space_4, CombatIsInevitable);
break;
case 4:
Response (whats_up_space_5, CombatIsInevitable);
break;
}
Response (you_are_weak, CombatIsInevitable);
Response (slay_by_thousands, CombatIsInevitable);
Response (ease_up, CombatIsInevitable);
Response (bye_space, CombatIsInevitable);
}
static void
Intro (void)
{
BYTE NumVisits;
if (GET_GAME_STATE (PROBE_ILWRATH_ENCOUNTER))
{
NPCPhrase (SEND_MESSAGE);
Response (where_you_come_from, CombatIsInevitable);
Response (it_will_be_a_pleasure, CombatIsInevitable);
Response (surrender, CombatIsInevitable);
Response (be_reasonable, CombatIsInevitable);
}
else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
{
IlwrathHome ((RESPONSE_REF)0);
}
else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 6))
{
NumVisits = GET_GAME_STATE (ILWRATH_CHMMR_VISITS);
switch (NumVisits++)
{
case 0:
NPCPhrase (INIT_CHMMR_HELLO);
break;
case 1:
NPCPhrase (SUBSEQUENT_CHMMR_HELLO);
--NumVisits;
break;
}
SET_GAME_STATE (ILWRATH_CHMMR_VISITS, NumVisits);
Response (whats_up, CombatIsInevitable);
Response (bye, CombatIsInevitable);
}
else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 5))
{
if (GET_GAME_STATE (ILWRATH_FIGHT_THRADDASH))
NPCPhrase (BIG_FUN);
else if (GET_GAME_STATE (ILWRATH_DECEIVED))
NPCPhrase (FAST_AS_CAN);
else
NPCPhrase (JUST_GRUNTS);
SET_GAME_STATE (BATTLE_SEGUE, 0);
}
else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 4))
{
GodsSpeak ((RESPONSE_REF)0);
}
else
{
SET_GAME_STATE (BATTLE_SEGUE, 0);
if (GET_GAME_STATE (ILWRATH_FIGHT_THRADDASH))
NPCPhrase (HAPPY_FIGHTING_THRADDASH);
else if (GET_GAME_STATE (ILWRATH_DECEIVED))
NPCPhrase (ON_WAY_TO_THRADDASH);
else
IlwrathSpace ((RESPONSE_REF)0);
}
}
static COUNT
uninit_ilwrath (void)
{
return (0);
}
LOCDATAPTR
init_ilwrath_comm (void)
{
LOCDATAPTR retval;
ilwrath_desc.init_encounter_func = Intro;
ilwrath_desc.uninit_encounter_func = uninit_ilwrath;
ilwrath_desc.AlienTextTemplate.baseline.x =
TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
ilwrath_desc.AlienTextTemplate.baseline.y = 64;
ilwrath_desc.AlienTextTemplate.align = ALIGN_CENTER;
ilwrath_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;
if (GET_GAME_STATE (PROBE_ILWRATH_ENCOUNTER)
|| (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA)
& ((1 << 4) | (1 << 5)))
|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
{
SET_GAME_STATE (BATTLE_SEGUE, 0);
}
else
{
SET_GAME_STATE (BATTLE_SEGUE, 1);
}
retval = &ilwrath_desc;
return (retval);
}
+3
View File
@@ -0,0 +1,3 @@
#define ILWRATH_MUSIC 0x00200006L
+3
View File
@@ -0,0 +1,3 @@
#define ILWRATH_CONVERSATION_PHRASES 0x00200004L
+4
View File
@@ -0,0 +1,4 @@
#include "igfxres.h"
#include "ifontres.h"
#include "istrtab.h"
#include "imusicre.h"
+5
View File
@@ -0,0 +1,5 @@
enum
{
ILWRATH_PACKAGE = 1
};
+17
View File
@@ -0,0 +1,17 @@
#ifndef _RESTYPES_H
#define _RESTYPES_H
enum
{
KEY_CONFIG = 1,
GFXRES,
FONTRES,
STRTAB,
SNDRES,
MUSICRES,
RES_INDEX,
CODE
};
#endif /* _RESTYPES_H */
+135
View File
@@ -0,0 +1,135 @@
//Copyright Paul Reiche, Fred Ford. 1992-2002
/*
* 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.
*/
#ifndef _STRINGS_H
#define _STRINGS_H
enum
{
NULL_PHRASE,
NEVER_ENOUGH,
OK_WARSHIP,
OK_DWE,
OK_YOUBOO,
OK_DILRAT,
BIG_FUN,
FAST_AS_CAN,
GLORIOUS_WORSHIP,
ON_WAY,
GODS_RETURN_1,
GODS_RETURN_2,
GODS_RETURN_3,
JUST_GRUNTS,
GRUNTS_AGAIN,
WHAT_ORDERS,
WE_WORSHIP_1,
WE_WORSHIP_2,
WE_WORSHIP_3,
SUBSEQUENT_CHMMR_HELLO,
INIT_CHMMR_HELLO,
OK_ENOUGH_ILWRATH,
OK_ENOUGH_GODS,
SEND_MESSAGE,
CAME_FROM,
WHO_BLASTS_WHO,
NO_SURRENDER,
NOT_REASONABLE,
SUBSEQUENT_HOME_HELLO,
GENERAL_INFO,
GOODBYE_AND_DIE,
DECEIVERS,
NO_PEACE,
NO_ALLIANCE,
ILWRATH_BELIEVE,
OK_KILL_THRADDASH,
GOODBYE_GODS,
INIT_HELLO_SPACE,
SUBSEQUENT_HELLO_SPACE_1,
SUBSEQUENT_HELLO_SPACE_2,
SUBSEQUENT_HELLO_SPACE_3,
SUBSEQUENT_HELLO_SPACE_4,
GENERAL_INFO_SPACE_1,
GENERAL_INFO_SPACE_2,
GENERAL_INFO_SPACE_3,
GENERAL_INFO_SPACE_4,
GENERAL_INFO_SPACE_5,
STRENGTH_NOT_ALL,
NO_SLAY_BY_THOUSANDS,
NO_EASE_UP,
GOODBYE_AND_DIE_SPACE,
INIT_HOME_HELLO,
GOODBYE_AND_DIE_HOMEWORLD,
SO_MUCH_TO_KNOW,
LONG_AGO,
KILLED_GOOD_GODS,
CHANNEL_44,
BECAUSE_44,
WHAT_ABOUT_ILWRATH,
ABOUT_PHYSIO,
ABOUT_HISTORY,
ABOUT_CULTURE,
ABOUT_URQUAN,
URQUAN_TOO_NICE,
OF_COURSE_WERE_EVIL,
DONT_CONFUSE_US,
ON_WAY_TO_THRADDASH,
HAPPY_FIGHTING_THRADDASH,
say_warship,
say_dwe,
say_youboo,
say_dillrat,
enough_orders,
other_divine_orders,
worship_us,
bye_gods,
enough_ilwrath,
enough_gods,
where_you_come_from,
it_will_be_a_pleasure,
be_reasonable,
surrender,
whats_up,
bye,
want_peace,
want_alliance,
go_kill_thraddash,
whats_up_space_1,
whats_up_space_2,
whats_up_space_3,
whats_up_space_4,
whats_up_space_5,
you_are_weak,
slay_by_thousands,
ease_up,
bye_space,
bye_homeworld,
want_info_on_gods,
when_start_worship,
any_good_gods,
how_talk_with_gods,
why_44,
want_info_on_ilwrath,
what_about_physio,
what_about_history,
what_about_culture,
what_about_urquan,
are_you_evil,
but_evil_is_defined,
};
#endif /* _STRINGS_H */
+3
View File
@@ -0,0 +1,3 @@
#define MELNORME_FONT 0x00200003L
+3
View File
@@ -0,0 +1,3 @@
#define MELNORME_PMAP_ANIM 0x00200002L
+3
View File
@@ -0,0 +1,3 @@
#define MELNORME_MUSIC 0x00200006L
+4
View File
@@ -0,0 +1,4 @@
#define MELNORME_CONVERSATION_PHRASES 0x00200004L
#define MELNORME_COLOR_MAP 0x00200104L
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
INCLUDE ../../star3do.typ
PATH comm/melnorm
PACKAGE MELNORME_PACKAGE melnorm.con
GFXRES MELNORME_PMAP_ANIM melnorm.ani
FONTRES MELNORME_FONT melnorm.fon
MUSICRES MELNORME_MUSIC melnorm.mod
STRTAB MELNORME_CONVERSATION_PHRASES melnorm.txt
STRTAB MELNORME_COLOR_MAP melnorm.ct
+4
View File
@@ -0,0 +1,4 @@
#include "igfxres.h"
#include "ifontres.h"
#include "istrtab.h"
#include "imusicre.h"

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