Initial commit

This commit is contained in:
TakeV 2023-02-23 12:53:09 -08:00
commit 63cff6654f
Signed by: TakeV
GPG Key ID: A64F41345C7400AF
106 changed files with 11518 additions and 0 deletions

45
Makefile Executable file
View File

@ -0,0 +1,45 @@
#
# Makefile
#
# Copyright 2007, 2008 Lancer-X/ASCEAI
#
# This file is part of Meritous.
#
# Meritous is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
#
LDFLAGS = `sdl-config --libs` -lSDL_image -lSDL_mixer -lz
CCFLAGS = -O2 -Wall `sdl-config --cflags` -g
#
OBJS = src/levelblit.o \
src/mapgen.o \
src/demon.o \
src/gamemap.o \
src/tiles.o \
src/save.o \
src/help.o \
src/audio.o \
src/boss.o \
src/ending.o
#
default: meritous
%.o: %.c
gcc -c -o $@ $? ${CCFLAGS}
meritous: ${OBJS}
gcc -o $@ $+ ${LDFLAGS}
clean:
rm ${OBJS}

BIN
dat/a/circuitcharge.wav Normal file

Binary file not shown.

BIN
dat/a/circuitrecover.wav Normal file

Binary file not shown.

BIN
dat/a/circuitrelease.wav Normal file

Binary file not shown.

BIN
dat/a/crystal.wav Normal file

Binary file not shown.

BIN
dat/a/crystal2.wav Normal file

Binary file not shown.

BIN
dat/a/enemyhit.wav Normal file

Binary file not shown.

BIN
dat/a/mons0shot.wav Normal file

Binary file not shown.

BIN
dat/a/mons10shot.wav Normal file

Binary file not shown.

BIN
dat/a/mons1shot.wav Normal file

Binary file not shown.

BIN
dat/a/mons2shot.wav Normal file

Binary file not shown.

BIN
dat/a/mons3shot.wav Normal file

Binary file not shown.

BIN
dat/a/mons4shot.wav Normal file

Binary file not shown.

BIN
dat/a/mons5shot.wav Normal file

Binary file not shown.

BIN
dat/a/mons6shot.wav Normal file

Binary file not shown.

BIN
dat/a/mons7shot.wav Normal file

Binary file not shown.

BIN
dat/a/mons8shot.wav Normal file

Binary file not shown.

BIN
dat/a/mons9shot.wav Normal file

Binary file not shown.

BIN
dat/a/playerhurt.wav Normal file

Binary file not shown.

BIN
dat/a/shieldhit.wav Normal file

Binary file not shown.

BIN
dat/a/teleport.wav Normal file

Binary file not shown.

BIN
dat/a/tone.wav Normal file

Binary file not shown.

1
dat/d/bossroom.loc Normal file
View File

@ -0,0 +1 @@
7676767676767676766!!!!88888888!!!!77!"#!87676768!"#!66!$%!86767678!$%!77!!!!87676768!!!!66888886767678888877676767676767676766888886767678888877!!!!87676768!!!!66!"#!86767678!"#!77!$%!87676768!$%!66!!!!88888888!!!!7767676767676767676

BIN
dat/d/centre.loc Normal file

Binary file not shown.

BIN
dat/d/cstream.loc Normal file

Binary file not shown.

BIN
dat/d/fbossroom.loc Normal file

Binary file not shown.

BIN
dat/d/font.dat Normal file

Binary file not shown.

385
dat/d/helpfile.txt Normal file
View File

@ -0,0 +1,385 @@
'_____________________________________________________________________
:default
!---------------------------------------------------------------------
!MERITOUS HELP FILE
!---------------------------------------------------------------------
To navigate this help file, use the up and down arrow keys. Press
ENTER to activate links. Press ESC to return to the game. You can
access this help file at any time by pressing 'H'.
!Table of Contents
?intro?Introduction
?background?Background
?controls?Controls
?wuss?Wuss Mode
?dungeon?The Dome
?circuit?Your PSI Circuit and You
?cred?Credits
:intro
!---------------------------------------------------------------------
!Introduction
!---------------------------------------------------------------------
" Far below the surface of the planet is a secret.
A place of limitless power. Those that seek to
control such a utopia will soon bring an end
to themselves. "
MERITOUS is a top-view dungeon crawl action/adventure game. As MERIT,
a PSI user, your task is to investigate the Orcus Dome, an ancient
underground shrine.
In your way are the shadowy creatures that wander the shrine. Using
your PSI circuit, you must cut through any that come between you and
your goal.
?background?Background
?controls?Controls
?dungeon?The Dome
?default?Return to top
:background
!---------------------------------------------------------------------
!Background
!---------------------------------------------------------------------
!-- PSI --
PSI is a powerful, imprecise force. Often viewed as a form of modern
magic, PSI can be weilded to a limited extent by beings (see PSI
users) that have an unusual level of mental awareness. PSI exists as
a flow that can be fashioned into a single-use tool for the weilder to
use.
As PSI is very difficult to shape precisely, PSI users often
settle for crude, uneconomical solutions to problems. For example,
using PSI as an attacking weapon by draining off a large amount of it
from the surrounding area and unleashing it in one go. Or using PSI
as a protective shield by concentrating a large amount of it in one
area.
Where PSI actually comes from is unknown, however there seems to be
only a limited amount in the atmosphere at any one time. While PSI is
generally used by gathering it from the area around the PSI user, some
advanced PSI users have worked out ways of gathering and storing large
quantities of it.
Some areas are naturally much richer in PSI than others. PSI seems to
be found in greater quantities when one is underground, for example.
!-- PSI users --
PSI users are beings that have the mental capacity to consciously use
PSI. Any species is capable of producing PSI users, though by far
human PSI users are the most common.
PSI users vary wildly in ability, with the rarest and most powerful
able to accomplish great feats. It is also not uncommon for PSI users
to become more or less powerful over time. Theories exist that
continual exposure to and use of PSI increases one's competence, while
disuse can cause it to stagnate.
!-- Orcus Dome --
The Orcus Dome is a structure located deep within the planet's crust.
The internal structure seems to be both crafted and organically grown.
It is made up of a number of tightly-woven rooms. The structure is
unusual in that it seems to have been made for the precise purpose of
gathering and concentrating PSI. The walls that divide the rooms
carry PSI gathered from the planet and channel it into a single, very
strong flow of PSI.
The discovery of the Dome has been a point of contention among PSI
users, most of whom want to use the large reserves of the Dome to
enhance their own PSI usage.
Eventually, the majority of PSI users agreed to ration out use of the
Dome to both ensure the existing reserves would last as long as
possible and to make sure that each PSI user would receive a fair
allocation.
!-- Strange events --
For several years, there was no problem with the ongoing use of the
Orcus Dome to provide PSI. However, for some reason, the PSI extracted
from the Dome began to behave strangely. It worked unpredictably, and
made controlling the PSI very difficult. After one PSI user was killed
as a result of this, a decision was made to abandon using the Orcus
Dome for PSI.
Not happy with this decision, one PSI user, MERIT, decided to use his
own reserves of PSI to ethereally warp into the Dome itself to find
out what the problem was and restore the Dome to its original state.
?default?Return to top
:controls
!---------------------------------------------------------------------
!Controls
!---------------------------------------------------------------------
Arrow keys - Move around. To walk through doors, simply walk up to
them and push against them.
Space - Charge your PSI circuit.
Escape - Exit the game.
H - View the help file.
Tab - View the map (you can then use the arrow keys to scroll
around the map.
Enter - Activate a trigger tile that you are standing on.
Enter is also used for various other things, such as
for reading in-game dialogue.
P - Pause the game.
?default?Return to top
:dungeon
!---------------------------------------------------------------------
!The Dome
!---------------------------------------------------------------------
The Orcus Dome is made up of a series of rooms, connected with short
passages. The rooms are mostly uniform in design, however, there are
some points of interest to look out for.
!----------------------------------
!Trigger tiles
!----------------------------------
Trigger tiles are special tiles that cover the floor of the dungeon,
and can be activated by standing on top of them and pressing Enter.
!Checkpoint tiles
Checkpoint tiles automatically record your genetic makeup when you
enter the room that they are in, and, at the cost of some of your
natural vitality, will restore your being if you perish within the
Dome.
The process can also be used to warp yourself between tiles with no
cost, by pressing Enter while on one of them.
!PSI Enhancement tiles
These tiles will, at the cost of some of your PSI crystals, enhance
your PSI abilities in one of three different areas.
More on PSI abilities can be found in the chapter 'Your PSI Circuit
and You'
!Crystal Magnet tiles
These tiles, upon activation, pull loose PSI crystals into the room
that the tile is in.
!Compass tiles
These tiles point out useful places for you to go to. If nothing
appears when you stand on the tile, there is nothing for you to do
at the moment until more shadow creatures are destroyed.
!Save tiles
These tiles use their own supply of PSI to record your current
state, allowing you to come back to the Dome if you decide to leave
for a while. They do this upon activation with the Enter key.
?circuit?Your PSI Circuit and You
!----------------------------------
!PSI Artifacts
!----------------------------------
There are a number of artifacts constructed with PSI lying around the
Dome, and some of these will be crucial to your success. You can
locate these with the compass tile.
!Mystical Enhancement Tools
These artifacts will assist you in exploring the Dome by enhancing
your current abilities. With the right artifacts, you can move faster,
regenerate your shields in less time, see shadow creatures through
walls, increase the power of your PSI attack and several other things.
These artifacts are usually found in chests, and are often well
protected, but you can find them with the compass tiles.
!PSI Keys
In the shape of famous weapons, the Keys are responsible for filtering
and controlling the flow of PSI throughout the Dome. They are placed
at the points where ley-lines intersect, and it is unknown what will
happen if they are moved. You can find them, even if they have been
moved, with the compass tiles, but you will not be able to touch them
if they have been corrupted with darkness.
!Ancient Seal
One of the artifacts, in the shape of a pendant, must be kept at the
centre of the Dome at all times to keep the PSI free of malign
influences. The Ancient Seal can also be found with the compass tiles,
but will only be visible while the PSI Keys are in place.
?default?Return to top
:circuit
!---------------------------------------------------------------------
!Your PSI Circuit and You
!---------------------------------------------------------------------
Your PSI ability has two main purposes in the game--offence and
defence.
!Offence
By holding down the spacebar, you can charge your offensive PSI
circuit and unleash it on surrounding foes. Creatures made up of PSI
that are hit by this force will crystallise and break down into PSI
crystals that can be collected.
There are two different targeting reticles used while the PSI circuit
is charging. The circle will appear over enemies that are in range
of your attack. The cross will appear over enemies that your PSI
circuit is charged enough to destroy. Both of these should appear over
your intended enemies before you release the charge. Only then can you
ensure that they will be hit.
Beware, however--some enemies can take more than one hit from the PSI
circuit before they are destroyed. Some more powerful creatures may
not show a targeting reticle at all. In those cases you will have to
experiment to find out how much power you need to destroy them.
The further you charge your PSI circuit, the longer it will take for
your circuit to recover enough to use it again. For this reason it is
rarely a good idea to keep your circuit fully charged.
Most enemy attacks can be stopped prematurely using the PSI circuit,
and enemy bullets can be knocked out of the air.
Your 'Circuit charge' and 'Circuit refill' skills affect how quickly
your offensive PSI circuit charges and recovers respectively. In
addition, upgrading these values also increases the maximum charge
possible for your circuit, necessary for destroying the most powerful
enemies. These can be upgraded by standing on the necessary enhance
tiles and pressing Enter when you have sufficient PSI crystals.
!Defence
If your 'Reflect shield' skill is 1 or higher, you will automatically
use your PSI to form a physical shield around yourself, which can
block out attacks to a limited extent. For every point of skill you
have, your shield will be able to block out one enemy bullet before
it recharges. The higher your skill, the faster the shield will
recharge. Note that particularly powerful attacks, such as lasers,
are able to blast through multiple levels of shield in one go.
A shield is absolutely necessary for facing the more powerful enemies
in the Dome, so it is advised that you upgrade your shield when you
can.
!Further notes on enhancing skills
Because it costs more crystals to enhance a skill when you have more
ability in that skill, it is more efficient to keep your three skills
balanced rather than trying to maximise one of them.
On skill display at the top of the screen, the name of the skill will
glow when you have enough crystals to upgrade that skill on an enhance
tile.
!PSI recollection
Your PSI also enhances your ability to recall facts and visualise them
accurately. As a result of this, you will remember the layout of the
portions of the Dome you have explored so far, and can visualise this
information by pressing Tab. This will show a map that you can scroll
around, and can be very useful for finding your way around the Dome.
!PSI vitality
Last, but not least, your PSI also maintains your body vitality.
In the top-right corner, the three hearts represent this. If you lose
all three you will die and be regenerated at the last checkpoint.
Unless you are playing on Wuss mode, you will also have a limited
number of lives. This represents your physical vitality, and it will
be damaged each time you die. When you run out, your body will be
permanently destroyed and you won't be regenerated.
You can improve your vitality by collecting PSI crystals that have
formed into a heart shape. One of these will restore one of your
three hearts. If you already have three hearts, they will go towards
improving your physical vitality. Collect enough and your number of
lives will increase.
?default?Return to top
:wuss
!---------------------------------------------------------------------
!Wuss Mode
!---------------------------------------------------------------------
Available from the title menu, Wuss mode is a reduced-difficulty
gameplay mode. When playing Wuss mode, you will be able to attack
faster, enemy bullets will be slower and you will never permanently
die. However, a victory in Wuss mode is not considered to be an
actual completion of the game, and as a result the game will not end
the same way that it would normally.
?default?Return to top
:cred
!---------------------------------------------------------------------
!Credits
!---------------------------------------------------------------------
Concept: Lancer-X/Asceai
Game design: Lancer-X/Asceai
Graphics: Lancer-X/Asceai
Programming: Lancer-X/Asceai
Sound Effects: Various sources
Beta testing: Quasar
Beta testing: Terryn
Beta testing: Wervyn
Music:
"Ambient Light" Vogue of Triton
"Battle of Ragnarok" Frostbite
"Dragon Cave" TICAZ
cavern.xm Unknown
"Caverns Boss" Alexis Janson
"Forest Boss" Alexis Janson
"Catacombs Boss" Alexis Janson
"Fear 2" Mick Rippon
"The Final Battle" Goose/CéDA & iNVASiON
"Ice Frontier" Skaven/FC
"KnarkLoader 1.0" Rapacious
"RPG-Battle" Cyn
"Metallic Forest" Joseph Fox
?default?Return to top

BIN
dat/d/icon_bitmask.dat Normal file

Binary file not shown.

BIN
dat/d/weapon.loc Normal file

Binary file not shown.

BIN
dat/i/agate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

BIN
dat/i/artifacts.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
dat/i/asceai.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
dat/i/automap.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
dat/i/boss1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

BIN
dat/i/boss2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

BIN
dat/i/boss3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
dat/i/boss4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

BIN
dat/i/boss_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

BIN
dat/i/circuits_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

BIN
dat/i/fin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
dat/i/gem.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

BIN
dat/i/glitter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

BIN
dat/i/hidden_monster.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

BIN
dat/i/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
dat/i/inrange.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
dat/i/linetest.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

BIN
dat/i/meter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 B

BIN
dat/i/mons1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
dat/i/mons10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
dat/i/mons2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
dat/i/mons3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
dat/i/mons4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
dat/i/mons5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
dat/i/mons6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
dat/i/mons7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
dat/i/mons8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
dat/i/mons9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
dat/i/overview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

BIN
dat/i/player.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
dat/i/reticle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
dat/i/star1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
dat/i/star2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
dat/i/star3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
dat/i/stream.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
dat/i/teleflash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
dat/i/theend.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
dat/i/tileset.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
dat/i/title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
dat/i/true_end.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
dat/i/wuss_ending.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
dat/m/CT_BOSS.MOD Normal file

Binary file not shown.

BIN
dat/m/Cv_boss.mod Normal file

Binary file not shown.

BIN
dat/m/FINALBAT.s3m Normal file

Binary file not shown.

BIN
dat/m/Fr_boss.mod Normal file

Binary file not shown.

BIN
dat/m/ICEFRONT.S3M Normal file

Binary file not shown.

BIN
dat/m/Wood.s3m Normal file

Binary file not shown.

BIN
dat/m/amblight.xm Normal file

Binary file not shown.

BIN
dat/m/cave.xm Normal file

Binary file not shown.

BIN
dat/m/cave06.s3m Normal file

Binary file not shown.

BIN
dat/m/cavern.xm Normal file

Binary file not shown.

BIN
dat/m/fear2.mod Normal file

Binary file not shown.

Binary file not shown.

BIN
dat/m/rpg_bat1.xm Normal file

Binary file not shown.

674
gpl.txt Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

53
readme.txt Normal file
View File

@ -0,0 +1,53 @@
MERITOUS v 1.2
for Windows 98/2K/XP/other operating systems
by Lancer-X/ASCEAI
Far below the surface of the planet is a secret.
A place of limitless power. Those that seek to
control such a utopia will soon bring an end
to themselves.
Seeking an end to the troubles that plague him,
PSI user MERIT journeys into the hallowed Orcus
Dome in search of answers.
INSTALLATION:
Run Meritous.exe after extraction and everything should work correctly.
If the game is too difficult for you, you can play in 'Wuss mode' for
a far more sombre gaming experience.
BASIC CONTROLS:
Arrow keys - Move around. To walk through doors, simply walk up to
them and push against them.
Space - Charge your PSI circuit for attacking.
Escape - Exit the game.
H - View the help file.
Tab - View the map (you can then use the arrow keys to scroll
around the map.
Enter - Activate a trigger tile that you are standing on.
Enter is also used for various other things, such as
for reading in-game dialogue.
P - Pause the game.
COMMENTS:
You can send comments/questions/whatever to my email address, which is
given on the website.
ACKNOWLEDGEMENTS:
Thanks to my beta testers: Quasar, Terryn and Wervyn, for their hard work
in assisting me in keeping Meritous fairly stable.

240
src/audio.c Executable file
View File

@ -0,0 +1,240 @@
//
// audio.c
//
// Copyright 2007, 2008 Lancer-X/ASCEAI
//
// This file is part of Meritous.
//
// Meritous is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
//
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
#include <string.h>
#include "levelblit.h"
#include "mapgen.h"
#include "boss.h"
char *tracks[13] = {"dat/m/ICEFRONT.S3M",
"dat/m/cavern.xm",
"dat/m/cave.xm",
"dat/m/cave06.s3m",
"dat/m/Wood.s3m",
"dat/m/iller_knarkloader_final.xm",
"dat/m/fear2.mod",
"dat/m/Cv_boss.mod",
"dat/m/Fr_boss.mod",
"dat/m/CT_BOSS.MOD",
"dat/m/rpg_bat1.xm",
"dat/m/amblight.xm",
"dat/m/FINALBAT.s3m"};
Mix_Music *bgm_music = NULL;
int bgm_track = -1;
Mix_Chunk *c_sample[16] = {NULL};
void InitAudio()
{
Mix_OpenAudio(44100, AUDIO_S16, 2, 4096);
Mix_VolumeMusic(112);
Mix_AllocateChannels(16);
}
void BackgroundMusic();
void CircuitHum();
void MusicUpdate()
{
BackgroundMusic();
CircuitHum();
}
void CircuitHum()
{
int hum_vol = 0;
static int hum_play = 0;
if (magic_circuit == 0) {
hum_vol = 0;
if (hum_play != 0) {
Mix_HaltChannel(0);
hum_play = 0;
}
}
if (magic_circuit > 0) {
hum_vol = (circuit_size * 24 / 3000)+12;
hum_vol = (magic_circuit * 96 / circuit_size) * hum_vol / 36 + 32;
if (hum_play != 1) {
if (hum_play == 2) {
Mix_HaltChannel(0);
Mix_FreeChunk(c_sample[0]);
}
c_sample[0] = Mix_LoadWAV("dat/a/circuitcharge.wav");
Mix_PlayChannel(0, c_sample[0], -1);
hum_play = 1;
}
}
if (magic_circuit < 0) {
hum_vol = (circuit_size - (magic_circuit + circuit_size)) * 80 / 3000;
if (hum_play != 2) {
if (hum_play == 1) {
Mix_HaltChannel(0);
Mix_FreeChunk(c_sample[0]);
}
c_sample[0] = Mix_LoadWAV("dat/a/circuitrecover.wav");
Mix_PlayChannel(0, c_sample[0], -1);
hum_play = 2;
}
}
Mix_Volume(0, hum_vol);
}
void TitleScreenMusic()
{
int new_track = 5;
if (bgm_track != -1) {
Mix_HaltMusic();
Mix_FreeMusic(bgm_music);
bgm_music = NULL;
}
bgm_music = Mix_LoadMUS(tracks[new_track]);
Mix_PlayMusic(bgm_music, -1);
bgm_track = new_track;
}
void BackgroundMusic()
{
int new_track = -1;
Mix_VolumeMusic(96);
if (rooms[player_room].s_dist <= 15) {
new_track = 0;
}
if (bgm_track == 1) {
if ((rooms[player_room].s_dist <= 30) && (rooms[player_room].s_dist >= 10)) {
new_track = 1;
}
}
if (bgm_track == 2) {
if ((rooms[player_room].s_dist <= 45) && (rooms[player_room].s_dist >= 25)) {
new_track = 2;
}
}
if (new_track == -1) {
if ((rooms[player_room].s_dist <= 30) && (rooms[player_room].s_dist >= 16)) {
new_track = 1;
}
if ((rooms[player_room].s_dist <= 39) && (rooms[player_room].s_dist >= 31)) {
new_track = 2;
}
if (rooms[player_room].s_dist >= 40) {
new_track = 3;
}
}
if (rooms[player_room].room_type == 3) {
new_track = 4;
}
if (artifacts[11]) {
new_track = 6;
}
if (rooms[player_room].room_type == 2) {
if (boss_fight_mode == 2) {
if ( (current_boss == 3) && (player_shield == 30) ) {
if (boss_lives <= 1) {
new_track = 7;
} else {
new_track = 12;
}
} else {
new_track = 7 + current_boss;
}
Mix_VolumeMusic(128);
} else {
new_track = -1;
}
}
if ( (player_room == 0) && (current_boss == 3) && (boss_fight_mode >= 3) ) {
new_track = 11;
}
if (new_track == bgm_track) return;
if (bgm_track != -1) {
Mix_HaltMusic();
Mix_FreeMusic(bgm_music);
bgm_music = NULL;
}
if (new_track != -1) {
bgm_music = Mix_LoadMUS(tracks[new_track]);
Mix_PlayMusic(bgm_music, -1);
}
bgm_track = new_track;
}
int SND_GetChannel()
{
int i;
for (i = 8; i < 16; i++) {
if (Mix_Playing(i) == 0) {
if (c_sample[i] != NULL) {
Mix_FreeChunk(c_sample[i]);
c_sample[i] = NULL;
}
return i;
}
}
return -1;
}
void SND_Play(char *filename, int vol)
{
int ch;
ch = SND_GetChannel();
if (ch != -1) {
c_sample[ch] = Mix_LoadWAV(filename);
Mix_Volume(ch, vol);
Mix_PlayChannel(ch, c_sample[ch], 0);
}
}
void SND_Pos(char *filename, int vol, int dist)
{
int real_vol;
if (dist > 1600) return;
real_vol = vol * (40 - (sqrt(dist))) / 40;
SND_Play(filename, real_vol);
}
void SND_CircuitRelease(int str)
{
SND_Play("dat/a/circuitrelease.wav", sqrt(str * 2 + (str * 5300 / circuit_size) + (str > 100 ? 5300 : str*53)));
}

33
src/audio.h Executable file
View File

@ -0,0 +1,33 @@
//
// audio.h
//
// Copyright 2007, 2008 Lancer-X/ASCEAI
//
// This file is part of Meritous.
//
// Meritous is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
//
// Exposes audio.c functionality and types
#ifndef AUDIO_H
#define AUDIO_H
void InitAudio();
void MusicUpdate();
void TitleScreenMusic();
void SND_CircuitRelease(int str);
void SND_Pos(char *filename, int vol, int dist);
#endif

1829
src/boss.c Executable file

File diff suppressed because it is too large Load Diff

56
src/boss.h Executable file
View File

@ -0,0 +1,56 @@
//
// boss.h
//
// Copyright 2007, 2008 Lancer-X/ASCEAI
//
// This file is part of Meritous.
//
// Meritous is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
//
// Exposes boss.c functionality and types
#ifndef BOSS_H
#define BOSS_H
extern int boss_fight_mode, current_boss_room;
extern char *boss_names[];
extern char *artifact_names[];
extern int current_boss;
extern int boss_lives;
void DrawPowerObject();
void DrawArtifactOverhead(int p_obj);
int CanGetArtifact();
void BossRoom(int room);
void BossControl();
void TryHurtBoss(int x, int y, int range, int power);
void InitBossVars();
void DrawBossHP(int bar_length);
int PDist(int x1, int y1, int x2, int y2);
extern int proxy_seek;
extern int boss_dlg;
extern int resetboss;
void BossDialog();
#endif

2613
src/demon.c Executable file

File diff suppressed because it is too large Load Diff

63
src/demon.h Executable file
View File

@ -0,0 +1,63 @@
//
// demon.h
//
// Copyright 2007, 2008 Lancer-X/ASCEAI
//
// This file is part of Meritous.
//
// Meritous is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
//
// Exposes demon.c functionality and types
#ifndef DEMON_H
#define DEMON_H
void InitEnemies();
void ActivateEnemies(int room);
void DrawEntities();
void MoveEntities();
void HurtEnemies(int x, int y, int range, int power);
void CircuitBullets(int x, int y, int r);
void CreateGem(int x, int y, int r, int v);
extern int total_enemies, killed_enemies, total_gems;
void WriteCreatureData();
void WriteEnemyData();
void WriteGemData();
void ReadCreatureData();
void ReadEnemyData();
void ReadGemData();
void CrystalSummon();
void ActivateRand();
void DestroyThings();
void EnemySound(int t, int dist);
void SpawnBullet(int x, int y, int bullet_type, float dir, float spd, int invuln);
void SpawnLaser(int x, int y, float dir, int fire_time, int duration, float turn, int dmg);
void ClearBossBullets();
float PlayerDir(int x, int y);
int PlayerDist(int x, int y);
void CullEnemies(int nth);
void SoupUpEnemies();
void CurseEnemies();
#endif

699
src/ending.c Executable file
View File

@ -0,0 +1,699 @@
//
// ending.c
//
// Copyright 2007, 2008 Lancer-X/ASCEAI
//
// This file is part of Meritous.
//
// Meritous is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
//
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <SDL.h>
#include <SDL_image.h>
#include <assert.h>
#include "levelblit.h"
#include "audio.h"
#include "boss.h"
#include "mapgen.h"
void DrawScrolly(int t);
void DrawPText(int t);
void DrawSText(int t);
void DrawSTextV(int t);
void DrawCircuitFlash(int t, int method);
void DrawStream(int t);
void InitParticleStorm();
void RunParticleStorm(int offset);
SDL_Surface *streamspr = NULL, *glitter = NULL;
SDL_Color ending_pal[256];
void UpdatePalette()
{
SDL_SetPalette(screen, SDL_PHYSPAL, ending_pal, 0, 256);
}
void DrawCredits();
int credits_scroll = 0;
int EndingEvents()
{
static SDL_Event event;
player_room = 0;
current_boss = 3;
boss_fight_mode = 4;
MusicUpdate();
while (SDL_PollEvent(&event)) {
if (event.type == SDL_KEYDOWN) {
switch (event.key.keysym.sym) {
case SDLK_ESCAPE:
return 1;
break;
default:
break;
}
}
if (event.type == SDL_QUIT) {
return 1;
}
}
return 0;
}
void ShowEnding()
{
int i;
if (streamspr == NULL) {
streamspr = IMG_Load("dat/i/stream.png");
SDL_SetColorKey(streamspr, SDL_SRCCOLORKEY | SDL_RLEACCEL, 0);
glitter = IMG_Load("dat/i/glitter.png");
SDL_SetColorKey(glitter, SDL_SRCCOLORKEY | SDL_RLEACCEL, 0);
}
for (i = 0; i < 500; i += 1) {
if (((i % 60) >= 24)&&((i % 60) < 34)) {
DrawCircuitFlash((i % 60) - 24, 0);
} else {
DrawScrolly(i);
}
EndCycle(0);
if (EndingEvents()) return;
}
for (i = 0; i < 30; i++) {
DrawCircuitFlash(i, 1);
EndCycle(0);
if (EndingEvents()) return;
}
SDL_FillRect(screen, NULL, 255);
for (i = 0; i < 350; i++) {
DrawPText(i);
EndCycle(0);
if (EndingEvents()) return;
}
Paint(0, 0, 22, 27, "dat/d/cstream.loc");
if (player_shield < 30) {
for (i = 0; i < 400; i++) {
DrawStream(i);
EndCycle(0);
if (EndingEvents()) return;
}
InitParticleStorm();
for (i = 0; i < 240; i++) {
RunParticleStorm(240-i);
EndCycle(0);
if (EndingEvents()) return;
}
for (i = 0; i < 60; i++) {
RunParticleStorm(0);
EndCycle(0);
if (EndingEvents()) return;
}
for (i = 0; i < 180; i++) {
RunParticleStorm(i*3);
EndCycle(0);
if (EndingEvents()) return;
}
for (i = 0; i < 500; i++) {
DrawSText(i);
EndCycle(0);
if (EndingEvents()) return;
}
} else {
for (i = 0; i < 250; i++) {
DrawStream(i);
EndCycle(0);
if (EndingEvents()) return;
}
for (i = 0; i < 500; i++) {
DrawSTextV(i);
EndCycle(0);
if (EndingEvents()) return;
}
}
credits_scroll = 0;
for (;;) {
DrawCredits();
EndCycle(0);
if (EndingEvents()) return;
}
}
char *SText[15] = { "Merit released the locks on the PSI flowing through the Dome,",
"releasing the flow of PSI into the atmosphere.",
"",
"The Orcus Dome was originally built to centralise the limited",
"PSI available to everyone. However, this made the existing",
"reserves more vulnerable to malicious PSI users",
"",
"While other PSI users initially resented Merit for his rash",
"behaviour, they eventually adjusted to the decentralisation.",
"",
"Eventually, PSI users grew so adept at manipulating the",
"diluted flows of PSI that they were capable of the same things",
"as before. Each PSI user would keep their own individual",
"reserves of PSI for when they needed to weild greater power,",
"and the balance of power was restored." };
char *STextV[15] = {"Merit decided to assume the role of custodian over the Orcus",
"Dome, in Wervyn Anixil's place. He resumed the experiments on",
"PSI and found ways of making the Dome's remaining supply go as",
"far as it could.",
"",
"Other PSI users were suspicious of MERIT, just as they were",
"wary of Wervyn Anixil before him, but they soon adjusted.",
"",
"The balance of power was quickly restored, and stabilised for",
"eternity due to the work of Wervyn Anixil and now MERIT.",
"",
"",
" [[ BEST ENDING ]]",
"",
""};
void DrawSText(int t)
{
int offset = 540 + (t / 2);
int i, c;
t = t * 350 / 500;
int cl = 350 - t;
for (i = 0; i < 64; i++) {
DrawRect(0, i * 15 - offset, 640, 15, (64 - i) * cl / 350);
}
for (i = 64; i < 128; i++) {
DrawRect(0, i * 15 - offset, 640, 15, (i - 64) * cl / 350);
}
if (t < 300) {
for (i = 0; i < 15; i++) {
c = (255 + (i * 100) - t*10);
if (c < 0) c = 0;
if (c > 255) c = 255;
draw_text(68, 150+i*12, SText[i], 255-c);
}
} else {
for (i = 0; i < 15; i++) {
c = 5 + (t-300) * 5;
draw_text(68, 150+i*12, SText[i], 255-c);
}
}
UpdatePalette();
VideoUpdate();
}
void DrawSTextV(int t)
{
int offset = 540 + (t / 2);
int i, c;
t = t * 350 / 500;
int cl = 350 - t;
for (i = 0; i < 64; i++) {
DrawRect(0, i * 15 - offset, 640, 15, (64 - i) * cl / 350);
}
for (i = 64; i < 128; i++) {
DrawRect(0, i * 15 - offset, 640, 15, (i - 64) * cl / 350);
}
if (t < 300) {
for (i = 0; i < 15; i++) {
c = (255 + (i * 100) - t*10);
if (c < 0) c = 0;
if (c > 255) c = 255;
draw_text(68, 150+i*12, STextV[i], 255-c);
}
} else {
for (i = 0; i < 15; i++) {
c = 5 + (t-300) * 5;
draw_text(68, 150+i*12, STextV[i], 255-c);
}
}
UpdatePalette();
VideoUpdate();
}
float pt_x[500];
float pt_y[500];
float pt_vx[500];
float pt_vy[500];
int pt_t[500];
void InitParticleStorm()
{
int i;
for (i = 0; i < 500; i++) {
pt_x[i] = 320;
pt_y[i] = 960;
pt_vx[i] = (float)(rand()%101) / 33.333 - 1.5;
pt_vy[i] = (float)(rand()%101) / 10.0 - 16.1;
pt_t[i] = rand()%100;
}
}
char *credits[] = {
"Concept: Lancer-X/Asceai",
"Game design: Lancer-X/Asceai",
"Graphics: Lancer-X/Asceai",
"Programming: Lancer-X/Asceai",
"Sound Effects: Various (public domain) sources",
"Music: Various artists",
"Beta testing: Quasar",
"Beta testing: Terryn",
"Beta testing: Wervyn"
"\"Ambient Light\" Vogue of Triton"
"\"Battle of Ragnarok\" Frostbite"
"\"Dragon Cave\" TICAZ"
" cavern.xm Unknown"
"\"Caverns Boss\" Alexis Janson"
"\"Forest Boss\" Alexis Janson"
"\"Catacombs Boss\" Alexis Janson"
"\"Fear 2\" Mick Rippon"
"\"The Final Battle\" Goose/CéDA & iNVASiON"
"\"Ice Frontier\" Skaven/FC"
"\"KnarkLoader 1.0\" Rapacious"
"\"RPG-Battle\" Cyn"
"\"Metallic Forest\" Joseph Fox"
};
void DrawCredits()
{
static SDL_Surface *fin = NULL;
static SDL_Surface *theend[2] = {NULL};
SDL_Rect draw_to;
int i;
int ypos;
int c;
int n_credits = sizeof(credits)/sizeof(*credits);
int finish_point;
finish_point = 400 + (n_credits * 50);
draw_to.x = 384;
draw_to.y = 352;
SDL_FillRect(screen, NULL, 0);
if (fin == NULL) {
fin = IMG_Load("dat/i/fin.png");
theend[0] = IMG_Load("dat/i/theend.png");
theend[1] = IMG_Load("dat/i/true_end.png");
}
if (credits_scroll >= (finish_point + 80)) {
SDL_BlitSurface(theend[(player_shield == 30)], NULL, screen, NULL);
} else {
SDL_BlitSurface(fin, NULL, screen, &draw_to);
// Show each line of credits
for (i = 0; i < n_credits; i++) {
ypos = 800 + (i * 100) - credits_scroll * 2;
if ((ypos >= 0)&&(ypos < 480)) {
c = 255 - abs(ypos - 240);
draw_text(120, ypos, credits[i], c);
}
}
}
for (i = 0; i < 128; i++) {
ending_pal[i].r = 0;
ending_pal[i].g = i;
ending_pal[i].b = i*2;
}
for (i = 128; i < 256; i++) {
ending_pal[i].r = (i - 128)*2+1;
ending_pal[i].g = i;
ending_pal[i].b = 255;
}
// Dim palette if we're just starting
if (credits_scroll < 80) {
for (i = 0; i < 256; i++) {
ending_pal[i].r = ending_pal[i].r * credits_scroll / 80;
ending_pal[i].g = ending_pal[i].g * credits_scroll / 80;
ending_pal[i].b = ending_pal[i].b * credits_scroll / 80;
}
}
// Also palette if we're finishing
if ((credits_scroll >= (finish_point))&&(credits_scroll < (finish_point + 80))) {
for (i = 0; i < 256; i++) {
ending_pal[i].r = ending_pal[i].r * (finish_point+80-credits_scroll) / 80;
ending_pal[i].g = ending_pal[i].g * (finish_point+80-credits_scroll) / 80;
ending_pal[i].b = ending_pal[i].b * (finish_point+80-credits_scroll) / 80;
}
}
if ((credits_scroll >= (finish_point + 80))&&(credits_scroll < (finish_point + 160))) {
for (i = 0; i < 256; i++) {
ending_pal[i].r = ending_pal[i].r * (credits_scroll - (finish_point + 80)) / 80;
ending_pal[i].g = ending_pal[i].g * (credits_scroll - (finish_point + 80)) / 80;
ending_pal[i].b = ending_pal[i].b * (credits_scroll - (finish_point + 80)) / 80;
}
}
credits_scroll++;
UpdatePalette();
VideoUpdate();
}
void RunParticleStorm(int offset)
{
SDL_Rect draw_from, draw_to;
int i;
for (i = 0; i < 64; i++) {
DrawRect(0, i * 15 - offset, 640, 15, 64 - i);
}
for (i = 0; i < 500; i++) {
if (pt_t[i] > 0) {
pt_t[i]--;
} else {
pt_vy[i] += 0.1;
pt_x[i] += pt_vx[i];
pt_y[i] += pt_vy[i];
}
draw_from.x = (rand()%3)*32;
draw_from.y = 0;
draw_from.w = 32;
draw_from.h = 32;
draw_to.x = (int)pt_x[i] - 16;
draw_to.y = (int)pt_y[i] - 16 - offset;
SDL_BlitSurface(glitter, &draw_from, screen, &draw_to);
}
for (i = 0; i < 128; i++) {
ending_pal[i].r = i*2;
ending_pal[i].g = i*2;
ending_pal[i].b = 0;
}
for (i = 128; i < 256; i++) {
ending_pal[i].r = 255;
ending_pal[i].g = 255;
ending_pal[i].b = (i - 128)*2+1;
}
UpdatePalette();
VideoUpdate();
}
void DrawStream(int t)
{
int i;
int scr_x = 32;
int scr_y = 0;
int strm_scrl;
SDL_Rect draw_from, draw_to;
for (i = 0; i < 256; i++) {
ending_pal[i].r = i;
ending_pal[i].g = (i * 7 / 8) + 16 + sin( (float)t / 8 )*16;
ending_pal[i].b = (i * 3 / 4) + 32 + sin( (float)t / 8 )*32;
}
if (t >= 300) {
scr_x = 32 + rand()%32 - rand()%32;
scr_y = rand()%8;
}
if (t < 10) {
scr_y = (20 - t * 2);
}
DrawLevel(scr_x, scr_y, 0, 0);
DrawPlayer(344 - scr_x, 228 - scr_y, 0, 0);
for (i = 0; i < 7; i++) {
strm_scrl = (t * 20) % 128;
draw_to.x = 0 - strm_scrl - scr_x + (128*i);
draw_to.y = 19 - scr_y;
if (i >= 300) {
draw_to.y += rand()%4;
draw_to.y -= rand()%4;
}
SDL_BlitSurface(streamspr, NULL, screen, &draw_to);
}
// glitter
for (i = 0; i < 20; i++) {
draw_from.x = (rand()%3)*32;
draw_from.y = 0;
draw_from.w = 32;
draw_from.h = 32;
draw_to.x = rand()%(640+32)-32;
draw_to.y = (rand()%(124)) + 3;
SDL_BlitSurface(glitter, &draw_from, screen, &draw_to);
}
if (t > 250) {
if (t < 300) {
if (t == 251) {
SND_CircuitRelease(1000);
}
DrawCircle(320+32 - scr_x, 240 - scr_y, (t - 254) * 10, 255);
DrawCircle(320+32 - scr_x, 240 - scr_y, (t - 252) * 10, 225);
DrawCircle(320+32 - scr_x, 240 - scr_y, (t - 250) * 10, 195);
}
}
UpdatePalette();
VideoUpdate();
}
char *PText[10] = { "Activating the seal quickly unblocked the ley lines and allowed",
"PSI to flow through the Dome again. The remaining shadows were",
"quickly flushed out.",
"",
"Wervyn Anixil's unconventional use of the PSI resulted in him",
"being burned out and rendered powerless. Merit will see to it",
"that he faces judgement for his crimes.",
"",
"Neither of the two PSI weapons housed within the Dome had been",
"touched. However . . ." };
char *PTextV[10] ={ "Activating the seal quickly unblocked the ley lines and allowed",
"PSI to flow through the Dome again. The remaining shadows were",
"quickly flushed out.",
"",
"The traitor, who was never identified, perished in the Sealing.",
"It soon became clear that the traitor had managed to betray and",
"kill the real Wervyn Anixil during his experiments on the PSI.",
"If the Agate Knife was never found, nobody would have been any",
"the wiser, and things could have turned out very differently.",
"However, there was one last thing for MERIT to do."};
void DrawPText(int t)
{
int i;
int c;
int x, y;
for (i = 0; i < 256; i++) {
ending_pal[i].r = i;
ending_pal[i].g = i;
ending_pal[i].b = (i * 3 / 4) + 64;
}
if (t < 300) {
for (i = 0; i < 10; i++) {
c = (255 + (i * 100) - t*10);
if (c < 0) c = 0;
if (c > 255) c = 255;
if (player_shield != 30) {
draw_text(68, 180+i*12, PText[i], c);
} else {
draw_text(68, 180+i*12, PTextV[i], c);
}
}
} else {
for (i = 0; i < 10; i++) {
c = 5 + (t-300) * 5;
if (player_shield != 30) {
draw_text(68, 180+i*12, PText[i], c);
} else {
draw_text(68, 180+i*12, PTextV[i], c);
}
}
}
for (i = 0; i < (32 * 8); i++) {
x = (i % 32)*20;
y = (i / 32)*20;
c = 237 + (i/32*2) + (rand()% (19 - (i/32) *2));
DrawRect(x, y, 20, 20, c);
c = 237 + (i/32*2) + (rand()% (19 - (i/32) *2));
DrawRect(x, 460 - y, 20, 20, c);
}
UpdatePalette();
VideoUpdate();
}
void DrawScrolly(int t)
{
int xp;
int yp;
int i, j;
float a_dir;
float v_radius;
int all_blue = 0;
SDL_Rect draw_from, draw_to;
int x, y, r;
float bright;
if (t < 795) {
xp = 8192 - 320 - 3180 + (t * 4);
yp = t * 20;
} else {
xp = 8192 - 320 + ( (t-795) * 10);
yp = 795 * 20 - (t-795)*10;
}
// Palette
if ((rand() % 10)==9) {
all_blue = 1;
}
for (i = 0; i < 256; i++) {
bright = sin((float)t / 10.0) * 0.2 + 0.4;
ending_pal[i].r = (i * bright + (256*(1.0-bright))) * ((float)(all_blue == 0) * 0.5 + 0.5);
ending_pal[i].g = (i * bright + (256*(1.0-bright))) * ((float)(all_blue == 0) * 0.5 + 0.5);
ending_pal[i].b = i * bright + (256*(1.0-bright));
}
DrawLevel(xp, yp, 0, 0);
v_radius = sin((float)t / 10.0)*20 + 100;
for (i = 0; i < 5; i++) {
x = rand()%640;
y = rand()%480;
r = rand()%500+100;
DrawCircleEx(x, y, r+2, r-4, 128);
DrawCircleEx(x, y, r, r-2, 255);
}
for (i = 0; i < 4; i++) {
draw_from.x = (8 + i) * 32;
draw_from.y = 0;
draw_from.w = 32;
draw_from.h = 32;
a_dir = ((float)t / 10.0) + (M_PI*(float)i/2);
for (j = 10; j >= 0; j--) {
DrawCircleEx(320+cos(a_dir)*v_radius, 240+sin(a_dir)*v_radius, 22 + j * 2, 0, abs(j-3) * 15);
}
DrawCircleEx(320+cos(a_dir)*v_radius, 240+sin(a_dir)*v_radius, 20, 0, 0);
draw_to.x = 320 + cos(a_dir) * v_radius - 16;
draw_to.y = 240 + sin(a_dir) * v_radius - 16;
SDL_BlitSurface(artifact_spr, &draw_from, screen, &draw_to);
}
UpdatePalette();
VideoUpdate();
}
void DrawCircuitFlash(int t, int method)
{
static SDL_Surface *circ = NULL;
static int xpos, ypos;
int i, j;
SDL_Rect from;
if (circ == NULL) {
circ = IMG_Load("dat/i/circuits_1.png");
}
if (t == 0) {
if (method == 0) {
xpos = rand()%641;
ypos = rand()%481;
} else {
xpos = 320;
ypos = 240;
}
}
from.x = xpos;
from.y = ypos;
from.w = 640;
from.h = 480;
SDL_BlitSurface(circ, &from, screen, NULL);
for (i = 0; i < 256; i++) {
if (method == 0) {
j = i * t / 4;
} else {
j = i * t / 8;
if (t >= 20) {
j += t * 25;
}
}
if (j > 255) j = 255;
ending_pal[i].r = j;
ending_pal[i].g = j;
ending_pal[i].b = j;
}
UpdatePalette();
VideoUpdate();
}

29
src/ending.h Executable file
View File

@ -0,0 +1,29 @@
//
// ending.h
//
// Copyright 2007, 2008 Lancer-X/ASCEAI
//
// This file is part of Meritous.
//
// Meritous is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
//
// Exposes ending.c functionality and types
#ifndef ENDING_H
#define ENDING_H
void ShowEnding();
#endif

342
src/gamemap.c Executable file
View File

@ -0,0 +1,342 @@
//
// gamemap.c
//
// Copyright 2007, 2008 Lancer-X/ASCEAI
//
// This file is part of Meritous.
//
// Meritous is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
//
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <SDL.h>
#include <SDL_image.h>
#include "levelblit.h"
#include "mapgen.h"
#include "tiles.h"
#include "save.h"
SDL_Surface *automap = NULL;
void RecordRoom(int room_id);
int full_rend = 0;
void FullRender();
int c_scroll_x=0, c_scroll_y=0;
SDL_Surface *overview = NULL;
void InitAutomap()
{
int i;
if (automap != NULL) SDL_FreeSurface(automap);
if (overview != NULL) SDL_FreeSurface(overview);
automap = IMG_Load("dat/i/automap.png"); //520x520
overview = IMG_Load("dat/i/overview.png"); //200x200
//SDL_SetColorKey(automap, SDL_SRCCOLORKEY | SDL_RLEACCEL, 255);
full_rend = 0;
if (game_load) {
if (artifacts[0]) {
FullRender();
} else {
for (i = 0; i < 3000; i++) {
if (rooms[i].visited) {
RecordRoom(i);
}
}
RecordRoom(player_room);
}
}
}
void FullRender()
{
int x, y, i;
Uint8 *pix;
for (y = 0; y < map.h; y++) {
for (x = 0; x < map.w; x++) {
if (TileData[Get(x, y)].Is_Solid) {
if (Get(x, y) != 17) {
pix = automap->pixels;
pix += automap->w * (y + 4);
pix += x + 4;
*pix = 128;
}
}
}
}
for (i = 0; i < 3000; i++) {
if (rooms[i].visited) {
RecordRoom(i);
}
}
RecordRoom(player_room);
full_rend = 1;
}
void DisplayRoom(int room_id, Uint8 room_bg)
{
int x, y;
int rx, ry;
SDL_Rect fill;
Uint8 *pix;
for (y = 0; y < rooms[room_id].h; y++) {
for (x = 0; x < rooms[room_id].w; x++) {
rx = x + rooms[room_id].x;
ry = y + rooms[room_id].y;
pix = automap->pixels;
pix += automap->w * (ry + 4);
pix += rx + 4;
*pix = automap_cols[TileData[Get(rx, ry)].Type];
if (*pix == 192) *pix = room_bg;
}
}
fill.x = rooms[room_id].x * 200 / 512;
fill.y = rooms[room_id].y * 200 / 512;
fill.w = rooms[room_id].w * 200 / 512;
fill.h = rooms[room_id].h * 200 / 512;
SDL_FillRect(overview, &fill, 200);
}
void RecordRoom(int room_id)
{
static int last_player_room = -1;
if (last_player_room != -1) {
if (rooms[last_player_room].checkpoint) DisplayRoom(last_player_room, 150 - (rooms[last_player_room].s_dist/5*12));
else DisplayRoom(last_player_room, 192 - (rooms[last_player_room].s_dist/5*12));
}
last_player_room = room_id;
DisplayRoom(room_id, 0);
}
void DisplayAutomap()
{
SDL_Rect from;
SDL_Rect position;
int x, y;
int df_x, df_y;
int rx, ry;
int rw, rh;
int tile;
int nearest_checkpoint;
unsigned char col;
unsigned char xcol = 0;
static int t = 0;
int minimap_scroll_x, minimap_scroll_y;
if (key_held[K_UP]) {
c_scroll_y -= 32 + (key_held[K_SP]*64);
}
if (key_held[K_DN]) {
c_scroll_y += 32 + (key_held[K_SP]*64);
}
if (key_held[K_LT]) {
c_scroll_x -= 32 + (key_held[K_SP]*64);
}
if (key_held[K_RT]) {
c_scroll_x += 32 + (key_held[K_SP]*64);
}
if (c_scroll_x < 0) c_scroll_x = 0;
if (c_scroll_y < 0) c_scroll_y = 0;
if (c_scroll_x >= 512*32) c_scroll_x = 512*32 - 32;
if (c_scroll_y >= 512*32) c_scroll_y = 512*32 - 32;
nearest_checkpoint = GetNearestCheckpoint(c_scroll_x, c_scroll_y);
if (artifacts[0] && (!full_rend)) FullRender();
minimap_scroll_x = c_scroll_x / 32 - 200 / 2;
minimap_scroll_y = c_scroll_y / 32 - 229 / 2;
if (minimap_scroll_x < 0) minimap_scroll_x = 0;
if (minimap_scroll_y < 0) minimap_scroll_y = 0;
if (minimap_scroll_x >= 512 - 200) minimap_scroll_x = 512 - 200 - 1;
if (minimap_scroll_y >= 512 - 229) minimap_scroll_y = 512 - 229 - 1;
position.x = 437;
position.y = 235;
position.w = 200;
position.h = 229;
from.x = minimap_scroll_x + 4;
from.y = minimap_scroll_y + 4;
from.w = 200;
from.h = 229;
SDL_FillRect(screen, &position, 255);
SDL_BlitSurface(automap, &from, screen, &position);
rx = c_scroll_x / 32 - 27 - minimap_scroll_x + 437;
ry = c_scroll_y / 32 - 27 - minimap_scroll_y + 235;
DrawRect(rx, ry, 55, 1, 50);
DrawRect(rx, ry+54, 55, 1, 50);
DrawRect(rx, ry, 1, 55, 50);
DrawRect(rx+54, ry, 1, 55, 50);
from.x = 0;
from.y = 0;
from.w = 200;
from.h = 200;
position.x = 437;
position.y = 32;
SDL_BlitSurface(overview, &from, screen, &position);
rx = (c_scroll_x / 32 - 27) * 200 / 512 + 437;
ry = (c_scroll_y / 32 - 27) * 200 / 512 + 32;
rw = 54 * 200 / 512;
rh = 54 * 200 / 512;
if (rx < 437) {
rw -= (437 - rx);
rx = 437;
}
if (ry < 32) {
rh -= (32 - ry);
ry = 32;
}
if (rx+rw >= 437 + 200 - 1) {
rw -= ((rx+rw) - (437 + 200 - 1));
}
if (ry+rh >= 32 + 200 - 1) {
rh -= ((ry+rh) - (32 + 200 - 1));
}
DrawRect(rx, ry, rw + 1, 1, 50);
DrawRect(rx, ry + rh, rw + 1, 1, 50);
DrawRect(rx, ry, 1, rh + 1, 50);
DrawRect(rx + rw, ry, 1, rh + 1, 50);
DrawRect(2, 31, 432, 432, 255);
t++;
for (y = 0; y < 54; y++) {
for (x = 0; x < 54; x++) {
xcol = 0;
df_x = x * 8 + 2;
df_y = y * 8 + 32;
rx = c_scroll_x / 32 - 27 + x;
ry = c_scroll_y / 32 - 27 + y;
if ((rx >= 0)&&(ry >= 0)&&(rx < 512)&&(ry < 512)) {
if (rooms[GetRoom(rx, ry)].visited) {
tile = Get(rx, ry);
if (tele_select && (nearest_checkpoint == GetRoom(rx, ry)) && ((t / 3) % 2)) {
xcol = 255;
}
col = automap_cols[TileData[tile].Type];
DrawRect(df_x, df_y, 8, 8, col ^ xcol);
switch (tile) {
case 25:
DrawRect(df_x, df_y, 8, 8, 192 ^ xcol);
draw_char(df_x, df_y, '*', 0 ^ xcol);
break;
case 26:
DrawRect(df_x, df_y, 8, 8, 192 ^ xcol);
draw_char(df_x, df_y, '+', 0 ^ xcol);
break;
case 28:
DrawRect(df_x, df_y, 8, 8, 192 ^ xcol);
draw_char(df_x, df_y, 'S', 0 ^ xcol);
break;
case 29:
DrawRect(df_x, df_y, 8, 8, 192 ^ xcol);
draw_char(df_x, df_y, 'C', 0 ^ xcol);
break;
case 30:
DrawRect(df_x, df_y, 8, 8, 192 ^ xcol);
draw_char(df_x, df_y, 'R', 0 ^ xcol);
break;
case 31:
DrawRect(df_x, df_y, 8, 8, 192 ^ xcol);
draw_char(df_x, df_y, 'S', 0 ^ xcol);
break;
case 32:
DrawRect(df_x, df_y, 8, 8, 192 ^ xcol);
draw_char(df_x, df_y, 29, 0 ^ xcol);
break;
case 53:
DrawRect(df_x, df_y, 8, 8, 192 ^ xcol);
draw_char(df_x, df_y, 28, 0 ^ xcol);
break;
}
if (tile < 12) {
DrawRect(df_x, df_y, 8, 8, 0 ^ xcol);
draw_char(df_x, df_y, tile + 10, 255 ^ xcol);
}
if ((tile >= 45)&&(tile <= 52)) {
DrawRect(df_x, df_y, 8, 8, 0 ^ xcol);
draw_char(df_x, df_y, (tile - 45)%4 + 14, 255 ^ xcol);
}
if ((tile >= 13)&&(tile < 17)) {
DrawRect(df_x, df_y, 8, 8, 0 ^ xcol);
draw_char(df_x, df_y, tile - 13 + 22, 255 ^ xcol);
}
if ((tile >= 21)&&(tile < 25)) {
DrawRect(df_x, df_y, 8, 8, 0 ^ xcol);
draw_char(df_x, df_y, tile - 13 + 22, 255 ^ xcol);
}
if ((tile >= 38)&&(tile < 42)) {
DrawRect(df_x, df_y, 8, 8, 0 ^ xcol);
draw_char(df_x, df_y, tile - 13 + 22, 255 ^ xcol);
draw_char(df_x, df_y, 26, 255 ^ xcol);
}
if (( (player_x / 32) == rx)&&( (player_y / 32) == ry)) {
DrawRect(df_x, df_y, 8, 8, 0 ^ xcol);
draw_char(df_x, df_y, 30, 255 ^ xcol);
}
}
}
}
}
// Now, to cover up the gaps!
//DrawRect(0, 29, 640, 437, 230);
// +-------1----+-----+
// | | |
// 3 4 5
// | +--6--+
// | | |
// | | |
// +-------2----+-----+
DrawRect(0, 29, 640, 3, 230); // 1
DrawRect(0, 464, 640, 4, 230); // 2
DrawRect(0, 29, 2, 437, 230); // 3
DrawRect(434, 29, 3, 437, 230); // 4
DrawRect(637, 29, 3, 437, 230); // 5
DrawRect(437, 232, 200, 3, 230); // 6
}

34
src/gamemap.h Executable file
View File

@ -0,0 +1,34 @@
//
// gamemap.h
//
// Copyright 2007, 2008 Lancer-X/ASCEAI
//
// This file is part of Meritous.
//
// Meritous is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
//
// Exposes gamemap.c functionality and types
#ifndef GAMEMAP_H
#define GAMEMAP_H
void RecordRoom(int room_id);
void DisplayAutomap();
void InitAutomap();
extern int c_scroll_x, c_scroll_y;
#endif

239
src/help.c Executable file
View File

@ -0,0 +1,239 @@
//
// help.c
//
// Copyright 2007, 2008 Lancer-X/ASCEAI
//
// This file is part of Meritous.
//
// Meritous is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
//
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <SDL.h>
#include <SDL_image.h>
#include <string.h>
#include "levelblit.h"
struct help_line {
char *t;
};
struct help_section {
int lines;
char *identifier;
struct help_line *l[256];
};
struct help_file {
int sections;
struct help_section *s[256];
};
struct help_file *hlp = NULL;
int my_line;
int my_sec;
int my_cursor;
int my_link;
void InitHelp()
{
FILE *fp;
struct help_section *current_sec = NULL;
struct help_line *current_line = NULL;
char linebuf[80];
hlp = malloc(sizeof(struct help_file));
hlp->sections = 0;
fp = fopen("dat/d/helpfile.txt", "r");
while (!feof(fp)) {
fgets(linebuf, 79, fp);
if (linebuf[strlen(linebuf)-1] == '\n')
linebuf[strlen(linebuf)-1] = 0;
if (linebuf[0] == '\'') {
// comment
continue;
}
if (linebuf[0] == ':') {
// section
hlp->s[hlp->sections] = malloc(sizeof(struct help_section));
current_sec = hlp->s[hlp->sections];
hlp->sections++;
current_sec->identifier = malloc(strlen(linebuf));
current_sec->lines = 0;
strcpy(current_sec->identifier, linebuf+1);
continue;
}
// different line
if (current_sec != NULL) {
current_sec->l[current_sec->lines] = malloc(sizeof(struct help_line));
current_line = current_sec->l[current_sec->lines];
current_sec->lines++;
current_line->t = malloc(strlen(linebuf)+1);
strcpy(current_line->t, linebuf);
}
}
fclose(fp);
}
void DisplayHelp()
{
static int tick = 0;
int i;
struct help_section *current_sec = NULL;
char *ltext;
char c_ident[20];
int line_num;
int follow_link = 0;
char linkfollow[20] = "";
DrawRect(23, 23, 594, 434, 0);
DrawRect(24, 24, 592, 432, 200);
DrawRect(25, 25, 590, 430, 255);
DrawRect(26, 26, 588, 428, 200);
DrawRect(27, 27, 586, 426, 100);
DrawRect(30, 30, 580, 420, 20);
DrawRect(35, 35, 570, 410, 60);
// 70x40 display
current_sec = hlp->s[my_sec];
my_line = my_cursor - 19;
if (my_line < 0) my_line = 0;
if (my_line >= (current_sec->lines)) my_line = current_sec->lines - 1;
for (i = 0; i < 2; i++) {
draw_text(23+i, 40+(my_cursor - my_line)*10, "->", 255);
draw_text(599+i, 40+(my_cursor - my_line)*10, "<-", 255);
}
for (i = 0; i < 40; i++) {
line_num = my_line + i;
if (line_num >= 0) {
if (line_num < current_sec->lines) {
ltext = current_sec->l[line_num]->t;
switch (ltext[0]) {
case '!':
draw_text(40 + (560-strlen(ltext+1)*8)/2, 40+i*10, ltext+1, 255);
break;
case '?':
strncpy(c_ident, ltext+1, strchr(ltext+1, '?')-ltext-1);
c_ident[strchr(ltext+1, '?')-ltext-1] = 0;
draw_text(40, 40+i*10, strchr(ltext+1, '?')+1, my_cursor == line_num ? 200+(tick%16)*3 : 150);
if ((my_link == 1)&&(my_cursor == line_num)) {
follow_link = 1;
strcpy(linkfollow, c_ident);
}
break;
default:
draw_text(40, 40+i*10, ltext, 200);
break;
}
}
}
}
tick++;
SDL_UpdateRect(screen, 0, 0, 0, 0);
if (follow_link) {
for (i = 0; i < hlp->sections; i++) {
if (strcmp(linkfollow, hlp->s[i]->identifier) == 0) {
my_sec = i;
my_cursor = 0;
break;
}
}
my_link = 0;
}
}
int MoveCursor()
{
SDL_Event ev;
static int key_delay = 0;
static int key_up = 0, key_down = 0;
if (key_delay > 0) key_delay--;
my_link = 0;
while (SDL_PollEvent(&ev)) {
if (ev.type == SDL_KEYDOWN) {
if (ev.key.keysym.sym == SDLK_DOWN) {
key_down = 1;
key_delay = 10;
if (my_cursor < hlp->s[my_sec]->lines-1) my_cursor++;
}
if (ev.key.keysym.sym == SDLK_UP) {
key_up = 1;
key_delay = 10;
if (my_cursor > 0) my_cursor--;
}
if (ev.key.keysym.sym == SDLK_ESCAPE) {
return 0;
}
if (ev.key.keysym.sym == SDLK_h) {
return 0;
}
if ((ev.key.keysym.sym == SDLK_SPACE) || (ev.key.keysym.sym == SDLK_RETURN))
my_link = 1;
}
if (ev.type == SDL_KEYUP) {
if (ev.key.keysym.sym == SDLK_DOWN) {
key_down = 0;
}
if (ev.key.keysym.sym == SDLK_UP) {
key_up = 0;
}
}
if (ev.type == SDL_QUIT) {
return 0;
}
}
if (key_delay == 0) {
if (key_up == 1) {
if (my_cursor > 0) my_cursor--;
}
if (key_down == 1) {
if (my_cursor < hlp->s[my_sec]->lines-1) my_cursor++;
}
}
return 1;
}
void ShowHelp()
{
int in_help = 1;
if (hlp == NULL) {
InitHelp();
}
my_line = 0;
my_sec = 0;
my_cursor = 0;
my_link = 0;
while (in_help)
{
DisplayHelp();
in_help = MoveCursor();
SDL_Delay(30);
}
}

29
src/help.h Executable file
View File

@ -0,0 +1,29 @@
//
// help.h
//
// Copyright 2007, 2008 Lancer-X/ASCEAI
//
// This file is part of Meritous.
//
// Meritous is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
//
// help.c header file
#ifndef HELP_H
#define HELP_H
void ShowHelp();
#endif

2646
src/levelblit.c Executable file

File diff suppressed because it is too large Load Diff

105
src/levelblit.h Executable file
View File

@ -0,0 +1,105 @@
//
// levelblit.h
//
// Copyright 2007, 2008 Lancer-X/ASCEAI
//
// This file is part of Meritous.
//
// Meritous is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Meritous 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 Meritous. If not, see <http://www.gnu.org/licenses/>.
//
// Exposes levelblit.c functionality and types
#ifndef LEVELBLIT_H
#define LEVELBLIT_H
#define PLAYERW 16
#define PLAYERH 24
extern SDL_Surface *screen;
extern int player_x, player_y;
extern int scroll_x, scroll_y;
extern int player_room;
extern int prv_player_room;
extern int magic_circuit;
extern int circuit_size;
extern int circuit_range;
void DrawCircle(int x, int y, int r, unsigned char c);
void DrawCircleEx(int x, int y, int r, int r2, unsigned char c);
void DrawRect(int x, int y, int w, int h, unsigned char c);
int IsSolid(unsigned char tile);
void draw_char(int cur_x, int cur_y, int c, Uint8 tcol);
void draw_text(int x, int y, char *str, Uint8 tcol);
void draw_text_ex(int x, int y, char *str, Uint8 tcol, SDL_Surface *srf);
extern int player_shield;
extern int shield_hp;
extern int shield_recover;
extern int player_hp;
extern int player_lives;
extern int player_lives_part;
extern int enter_room_x, enter_room_y;
extern int player_dying;
extern int checkpoint_x;
extern int checkpoint_y;
extern int player_gems;
extern int specialmessage;
extern int specialmessagetimer;
extern int tele_select;
void WritePlayerData();
void ReadPlayerData();
extern int artifacts[];
void LoadingScreen(int part, float progress);
void SavingScreen(int part, float progress);
void ThinLine(SDL_Surface *scr, int x1, int y1, int x2, int y2, Uint8 col);
float RandomDir();
void Arc(SDL_Surface *s, int x, int y, int r, float dir);
extern SDL_Surface *artifact_spr;
void VideoUpdate();
void EndCycle(int n);
extern int enter_pressed;
extern int game_paused;
extern int key_held[];
extern int training;
extern int show_ending;
void DrawLevel(int off_x, int off_y, int hide_not_visited, int fog_of_war);
void DrawPlayer(int x, int y, int pl_dir, int pl_frm);
int GetNearestCheckpoint(int x, int y);
int dist(int x1, int y1, int x2, int y2);
#define K_UP 0
#define K_DN 1
#define K_LT 2
#define K_RT 3
#define K_SP 4
#endif

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