Compare commits
177 Commits
Author | SHA1 | Date |
---|---|---|
diligentcircle | d564db380d | |
The Diligent Circle 丸 | fae576e731 | |
Matthias Mailänder | 1fd8f14499 | |
Matthias Mailänder | 1d949ec051 | |
Matthias Mailänder | 4ea587dd61 | |
The Diligent Circle 丸 | 7749a795e7 | |
Matthias Mailänder | 28c4ba82f2 | |
diligentcircle | 186555d8c8 | |
diligentcircle | 8f4013e828 | |
diligentcircle | eb0bdc13cf | |
diligentcircle | 3c3cbae720 | |
diligentcircle | 5ad618da90 | |
diligentcircle | 413cc0c6a8 | |
diligentcircle | b2053e3959 | |
diligentcircle | 247d2c7bfe | |
diligentcircle | e6f679c4e2 | |
diligentcircle | 5842ff98d8 | |
diligentcircle | 5ee90df2f3 | |
diligentcircle | 7b594c9fa7 | |
diligentcircle | 48f01e4d7f | |
diligentcircle | 87fea0b2e0 | |
diligentcircle | 36e6853fe1 | |
diligentcircle | 344c5d3c82 | |
The Diligent Circle 丸 | c4decfc8b2 | |
The Diligent Circle 丸 | fd71294a2b | |
Jorge Maldonado Ventura | b3d8ee0717 | |
Jorge Maldonado Ventura | 1bd704d136 | |
The Diligent Circle 丸 | 5e65e8c7a8 | |
Jorge Maldonado Ventura | 4c5b72ba32 | |
Jorge Maldonado Ventura | 756a2ed4cb | |
The Diligent Circle 丸 | ac8f5b32e4 | |
Jorge Maldonado Ventura | c77abd6431 | |
Jorge Maldonado Ventura | bddb178ce5 | |
Layla Marchant | bc4a022db8 | |
Layla Marchant | 0d325f0726 | |
Layla Marchant | ab26edddec | |
Layla Marchant | d806f05a16 | |
Layla Marchant | e480841bec | |
Layla Marchant | 8d8f096736 | |
Jorge Maldonado Ventura | 0a64b46722 | |
Jorge Maldonado Ventura | 472261de07 | |
Jorge Maldonado Ventura | 89c1fac443 | |
Layla Marchant | bab012e310 | |
Layla Marchant | 3d0e36916d | |
The Diligent Circle 丸 | 5d654873b1 | |
Jorge Maldonado Ventura | 3642c86eaa | |
Jorge Maldonado Ventura | 76dee3a49a | |
Jorge Maldonado Ventura | f7e90253f5 | |
Layla Marchant | 50355b9489 | |
The Diligent Circle 丸 | 40033c95f2 | |
Layla Marchant | d53764dc13 | |
Layla Marchant | 5eadb91594 | |
Layla Marchant | 51cd7d9f1e | |
Layla Marchant | 82ffaebbc5 | |
Jorge Maldonado Ventura | 840c2249d5 | |
Layla Marchant | a9e98145fa | |
Layla Marchant | 50989a83e7 | |
Layla Marchant | 8241e13d77 | |
Jorge Maldonado Ventura | 551e0c2f72 | |
Jorge Maldonado Ventura | f6108d3957 | |
Layla Marchant | 1116a1a4d3 | |
Layla Marchant | d73fe2c22e | |
The Diligent Circle 丸 | a13ef7374e | |
Jorge Maldonado Ventura | a3243ad3a3 | |
Jorge Maldonado Ventura | b4d70611be | |
Jorge Maldonado Ventura | 2ad7dcbddb | |
Layla Marchant | e993034e63 | |
Jorge Maldonado Ventura | ae66d76d54 | |
Jorge Maldonado Ventura | 07f13a02be | |
Jorge Maldonado Ventura | 9c71933d5f | |
Layla Marchant | ebb76a1cd5 | |
Jorge Maldonado Ventura | 71461ddd5a | |
Jorge Maldonado Ventura | 0ef537f03c | |
Jorge Maldonado Ventura | 6dbe3d86a9 | |
Layla Marchant | e79563ecb4 | |
Layla Marchant | f6be38a5d8 | |
Layla Marchant | 5e6b23b46c | |
The Diligent Circle 丸 | cbc29c0bb8 | |
Matthias Mailänder | 59a56a1b9a | |
Layla Marchant | 958574490d | |
Layla Marchant | 7e8ec72933 | |
Layla Marchant | bc3513e5d9 | |
Layla Marchant | bb5f1eae92 | |
Layla Marchant | b3252b3ea7 | |
Layla Marchant | 69430b7a2a | |
Layla Marchant | 5b29033700 | |
Layla Marchant | 135a64e178 | |
Layla Marchant | 46ffc40592 | |
Layla Marchant | 0112d8074f | |
Layla Marchant | f209058367 | |
Layla Marchant | 6d71317514 | |
Layla Marchant | 8ca1cdc42c | |
Layla Marchant | 51a1b67841 | |
Layla Marchant | 7734959320 | |
Layla Marchant | 747d0c2af6 | |
Layla Marchant | a0c0edcacc | |
Layla Marchant | b61e5e7a32 | |
Layla Marchant | 0c24aa45c8 | |
Layla Marchant | 1625c54ee5 | |
Layla Marchant | 139940e8b2 | |
Layla Marchant | be2cc0f1c2 | |
Layla Marchant | 45470bb68c | |
Layla Marchant | 1a3e801271 | |
The Diligent Circle 丸 | 123087e60e | |
fmneto | 67a612309f | |
Layla Marchant | c38f8ea16a | |
Layla Marchant | 86f6fc597f | |
The Diligent Circle 丸 | 5449c7fc3e | |
Heimen Stoffels | d18b93c661 | |
Layla Marchant | 4cd8b15d8f | |
Layla Marchant | b9d64bb21c | |
The Diligent Circle 丸 | da3515fae4 | |
Heimen Stoffels | 1189e4ea5e | |
Layla Marchant | d129793583 | |
Layla Marchant | 8c0df9b310 | |
Layla Marchant | 0e666b2d20 | |
Layla Marchant | c516cd7bb4 | |
Layla Marchant | 000905e6af | |
Layla Marchant | fc0c8bedc6 | |
Layla Marchant | df066d4ad4 | |
Layla Marchant | d48a35d15c | |
Layla Marchant | e5666251c3 | |
Layla Marchant | 3e2795a231 | |
Layla Marchant | b25efb8595 | |
Layla Marchant | 8d136e4cea | |
Layla Marchant | b547ec5989 | |
The Diligent Circle 丸 | d7406d58d8 | |
Alistair Findlay | f6cd2e9300 | |
Alistair Findlay | 8e0ab7d4ed | |
Alistair Findlay | 7b7966bcf2 | |
Alistair Findlay | 2448a043e1 | |
Layla Marchant | 9237af3283 | |
Layla Marchant | 59c21a355e | |
Layla Marchant | 23b5c50a28 | |
Layla Marchant | adc85f1bec | |
Layla Marchant | cf7a82515d | |
Layla Marchant | ca11cdea27 | |
Layla Marchant | 21e16c157b | |
Layla Marchant | eb2c61cd04 | |
Layla Marchant | 6e8d32fd64 | |
Layla Marchant | 70f5112100 | |
Layla Marchant | 91dcd81268 | |
Layla Marchant | 5fa977fb90 | |
Layla Marchant | 5bc3657824 | |
Layla Marchant | 0201eddbe5 | |
Layla Marchant | facc34b7ba | |
Layla Marchant | aaa640055d | |
Layla Marchant | a1a67452fd | |
Layla Marchant | 1f0f3e679d | |
The Diligent Circle 丸 | dce97bf826 | |
maruhiro | 86a13338d4 | |
Layla Marchant | c213a1b897 | |
Layla Marchant | 0a056f0608 | |
Layla Marchant | 8d730136f5 | |
Layla Marchant | 82b35c5ce0 | |
Layla Marchant | 7b6eb5501f | |
Layla Marchant | 9a5076bb93 | |
Layla Marchant | 13a2f0fba5 | |
Layla Marchant | aa356c6747 | |
Layla Marchant | afccdb741f | |
Layla Marchant | b3856c6a3c | |
Layla Marchant | 9a627a77bb | |
Layla Marchant | 97bcd873c7 | |
Layla Marchant | b73a56e587 | |
Layla Marchant | 5e1892235c | |
Layla Marchant | b689e2bcfb | |
Layla Marchant | b517275bd3 | |
Layla Marchant | a2ad01846a | |
Layla Marchant | d8734e5625 | |
Layla Marchant | 1a4e2ea71e | |
Layla Marchant | 9749684468 | |
Layla Marchant | 5c9b69dd0c | |
Layla Marchant | 1a00e0df2c | |
Layla Marchant | 305e9fb05d | |
Layla Marchant | d31b65f50e | |
Layla Marchant | 9863aef0ba | |
Layla Marchant | 7ef5382576 |
|
@ -1 +1,3 @@
|
||||||
|
github: onpon4
|
||||||
patreon: diligentcircle
|
patreon: diligentcircle
|
||||||
|
liberapay: diligentcircle
|
||||||
|
|
|
@ -15,10 +15,8 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: install
|
- name: install
|
||||||
run: sudo apt-get install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libpango1.0-dev
|
run: sudo apt-get install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libpango1.0-dev
|
||||||
- name: autoconf
|
- name: autoconf and locale
|
||||||
run: autoreconf -vif
|
run: ./autogen.sh
|
||||||
- name: build locale
|
|
||||||
run: cd locale && ./build.py && cd ..
|
|
||||||
- name: configure
|
- name: configure
|
||||||
run: ./configure
|
run: ./configure
|
||||||
- name: build
|
- name: build
|
||||||
|
|
|
@ -6,6 +6,9 @@ dist
|
||||||
starfighter
|
starfighter
|
||||||
src/starfighter
|
src/starfighter
|
||||||
|
|
||||||
|
# Dolphin .directory
|
||||||
|
.directory
|
||||||
|
|
||||||
# Backups
|
# Backups
|
||||||
*~
|
*~
|
||||||
|
|
||||||
|
|
38
LICENSES
38
LICENSES
|
@ -598,11 +598,21 @@ Details: Tuned down 5 half-notes.
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
music/walking_among_androids.ogg
|
music/android_oppression.ogg
|
||||||
|
music/sleeping_with_androids.ogg
|
||||||
|
|
||||||
Author: Zander Noriega <https://soundcloud.com/zander-noriega>
|
Author: The Diligent Circle <https://onpon4.github.io>
|
||||||
License: CC BY 3.0 <http://creativecommons.org/licenses/by/3.0/>
|
License: CC0 <http://creativecommons.org/publicdomain/zero/1.0/>
|
||||||
Source: http://opengameart.org/content/walking-among-androids-20
|
|
||||||
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
music/androids_last_dance.ogg
|
||||||
|
|
||||||
|
Author: The Diligent Circle <https://onpon4.github.io>
|
||||||
|
License: CC0 <http://creativecommons.org/publicdomain/zero/1.0/>
|
||||||
|
Notes:
|
||||||
|
Partly inspired by, and using the same instruments as, Last Cyber
|
||||||
|
Dance, which was composed by neocrey <https://twitter.com/artnocy>.
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -666,20 +676,14 @@ Source: http://opengameart.org/content/last-cyber-dance
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
music/RE.ogg
|
music/first_cyber_dance.ogg
|
||||||
|
|
||||||
Author: WeskerHunter <http://redeclipse.net/forum/viewtopic.php?f=5&t=26>
|
Authors:
|
||||||
License: CC BY-SA 3.0 <http://creativecommons.org/licenses/by-sa/3.0/>
|
The Diligent Circle <https://onpon4.github.io>
|
||||||
Source: http://opengameart.org/content/fast-high-music
|
Sweetpea
|
||||||
Changes: Amplified -1 dB and slowed down 5% with Audacity
|
License: CC BY 4.0 <https://creativecommons.org/licenses/by/4.0/>
|
||||||
|
Details:
|
||||||
------------------------------------------------------------------------
|
Remix of Last Cyber Dance. Last Cyber Dance is by neocrey.
|
||||||
|
|
||||||
music/death.ogg
|
|
||||||
|
|
||||||
Author: Jan125 <http://opengameart.org/users/jan125>
|
|
||||||
License: CC BY 3.0 <http://creativecommons.org/licenses/by/3.0/>
|
|
||||||
Source: http://opengameart.org/content/stereotypical-90s-space-shooter-music
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
15
Makefile.am
15
Makefile.am
|
@ -3,19 +3,14 @@
|
||||||
# http://creativecommons.org/publicdomain/zero/1.0/ for more
|
# http://creativecommons.org/publicdomain/zero/1.0/ for more
|
||||||
# information. This file is offered as-is, without any warranty.
|
# information. This file is offered as-is, without any warranty.
|
||||||
|
|
||||||
SUBDIRS = src misc
|
SUBDIRS = gfx locale misc music sound src
|
||||||
|
|
||||||
dist_doc_DATA = README.txt COPYING LICENSES
|
dist_doc_DATA = README.txt COPYING LICENSES
|
||||||
|
|
||||||
# WHEN ADDING TRANSLATIONS: Please append all new gettext file names
|
nobase_dist_pkgdata_DATA = \
|
||||||
# here (both the .po file and the .mo file). This insures the
|
data/credits.txt \
|
||||||
# translation is both distributed and installed properly.
|
data/ipa_font_license.txt \
|
||||||
nobase_dist_pkgdata_DATA = data/* gfx/* music/* sound/* \
|
data/TakaoPGothic.ttf
|
||||||
locale/build.py \
|
|
||||||
locale/genpot.sh \
|
|
||||||
locale/pr-starfighter.pot \
|
|
||||||
locale/en.po \
|
|
||||||
locale/en/LC_MESSAGES/pr-starfighter.mo
|
|
||||||
|
|
||||||
EXTRA_DIST = autogen.sh win32build.sh misc
|
EXTRA_DIST = autogen.sh win32build.sh misc
|
||||||
|
|
||||||
|
|
32
README.txt
32
README.txt
|
@ -24,25 +24,22 @@ compared to the original:
|
||||||
project completed that work by adding music and replacing one
|
project completed that work by adding music and replacing one
|
||||||
non-libre graphic that got into version 1.2 by mistake.
|
non-libre graphic that got into version 1.2 by mistake.
|
||||||
|
|
||||||
* There are several gameplay changes. These changes were mostly done to
|
|
||||||
balance the game better. However, if you want the original experience,
|
|
||||||
"Classic" difficulty emulates it as closely as possible.
|
|
||||||
|
|
||||||
* Much of the dialog has been changed. There are various reasons for
|
* Much of the dialog has been changed. There are various reasons for
|
||||||
this; some of these include fixing bad writing, making the dialog
|
this; some of these include fixing bad writing, making the dialog
|
||||||
match new music queues, and giving the characters more personality.
|
match new music queues, and giving the characters more personality.
|
||||||
|
|
||||||
* In many places, the interface has been considerably improved. As an
|
* There are several gameplay changes. These changes were mostly done to
|
||||||
example, the simplistic target arrow of the original has been replaced
|
balance the game better. The original game is contained in the Classic
|
||||||
with a system of several arrows, one for each ship.
|
difficulty option, which is nearly identical to the original
|
||||||
|
experience. A few small differences (mainly old bugs that were not
|
||||||
* Unicode and gettext translation support have been added.
|
left in) do exist, and they are explained on the following page:
|
||||||
|
https://pr-starfighter.github.io/old.html
|
||||||
|
|
||||||
* Typing "humansdoitbetter" in the title screen no longer enables
|
* Typing "humansdoitbetter" in the title screen no longer enables
|
||||||
cheats. This is actually because the switch to SDL2 broke the original
|
cheats. This is actually because the switch to SDL2 broke the original
|
||||||
feature, and rather than fixing it, I just replaced it with something
|
feature, and rather than fixing it, we just replaced it with something
|
||||||
else. I'll let you figure out what the new method to access the cheat
|
else. We'll let you figure out what the new method to access the cheat
|
||||||
menu is. :)
|
menu is. 😉
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -109,6 +106,17 @@ final step (moving the Starfighter binary out from the src directory) is
|
||||||
required; in particular, failure to do so under MacOS leads to a failure
|
required; in particular, failure to do so under MacOS leads to a failure
|
||||||
to load data (images, sounds, fonts) needed by Starfighter.
|
to load data (images, sounds, fonts) needed by Starfighter.
|
||||||
|
|
||||||
|
On Linux and most other POSIX systems, you can instead build a run in
|
||||||
|
place build with the following commands:
|
||||||
|
|
||||||
|
./configure SF_RUN_IN_PLACE=1
|
||||||
|
make
|
||||||
|
mv misc/starfighter.sh .
|
||||||
|
|
||||||
|
For Linux, this method is preferred as the binary itself often cannot be
|
||||||
|
run by double-clicking, and the starfighter.sh script also automatically
|
||||||
|
sets the current working directory, making it suitable for launchers.
|
||||||
|
|
||||||
Run "./configure --help" to see all options for compiling.
|
Run "./configure --help" to see all options for compiling.
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
35
configure.ac
35
configure.ac
|
@ -7,7 +7,7 @@
|
||||||
# information. This file is offered as-is, without any warranty.
|
# information. This file is offered as-is, without any warranty.
|
||||||
|
|
||||||
AC_PREREQ([2.69])
|
AC_PREREQ([2.69])
|
||||||
AC_INIT([Project: Starfighter], [2.1], [diligentcircle@riseup.net], [starfighter])
|
AC_INIT([Project: Starfighter], [2.4], [diligentcircle@riseup.net], [starfighter])
|
||||||
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
|
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
|
||||||
AC_CONFIG_SRCDIR([src/Starfighter.c])
|
AC_CONFIG_SRCDIR([src/Starfighter.c])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
@ -18,7 +18,6 @@ AC_PROG_CC
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
|
|
||||||
STARFIGHTER_CPPFLAGS="-DVERSION=\\\"$PACKAGE_VERSION\\\""
|
STARFIGHTER_CPPFLAGS="-DVERSION=\\\"$PACKAGE_VERSION\\\""
|
||||||
STARFIGHTER_LDADD=""
|
|
||||||
|
|
||||||
# Detect MacOS
|
# Detect MacOS
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
|
@ -39,7 +38,7 @@ PKG_CHECK_EXISTS([SDL2_mixer], [
|
||||||
], [
|
], [
|
||||||
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image SDL2_mixer])
|
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image SDL2_mixer])
|
||||||
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOFONT"
|
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOFONT"
|
||||||
echo "Note: SDL_ttf not found; Unicode will not be supported."
|
echo "WARNING: SDL_ttf not found; Unicode will not be supported."
|
||||||
])
|
])
|
||||||
], [
|
], [
|
||||||
PKG_CHECK_EXISTS([SDL2_ttf], [
|
PKG_CHECK_EXISTS([SDL2_ttf], [
|
||||||
|
@ -47,27 +46,32 @@ PKG_CHECK_EXISTS([SDL2_mixer], [
|
||||||
], [
|
], [
|
||||||
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image])
|
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image])
|
||||||
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOFONT"
|
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOFONT"
|
||||||
echo "Note: SDL_ttf not found; Unicode will not be supported."
|
echo "WARNING: SDL_ttf not found; Unicode will not be supported."
|
||||||
])
|
])
|
||||||
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOSOUND"
|
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOSOUND"
|
||||||
echo "Note: SDL_mixer not found; audio will not be supported."
|
echo "WARNING: SDL_mixer not found; audio will not be supported."
|
||||||
])
|
])
|
||||||
PKG_CHECK_MODULES([PANGO], [pango], [
|
PKG_CHECK_MODULES([PANGO], [pango], [
|
||||||
], [
|
], [
|
||||||
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOFONT"
|
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOFONT"
|
||||||
echo "Note: Pango not found; Unicode will not be supported."
|
echo "WARNING: Pango not found; Unicode will not be supported."
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_ARG_VAR([SF_NOWARN], [Set to 1 to disable compiler warnings (useful for older GCC versions)])
|
AC_ARG_VAR([SF_WARN], [Set to 1 to enable compiler warnings])
|
||||||
|
AC_ARG_VAR([SF_UNHARDEN], [Set to 1 to disable hardening flags (for compatibility)])
|
||||||
AC_ARG_VAR([SF_SCREEN_WIDTH], [The width of the game window in pixels])
|
AC_ARG_VAR([SF_SCREEN_WIDTH], [The width of the game window in pixels])
|
||||||
AC_ARG_VAR([SF_SCREEN_HEIGHT], [The height of the game window in pixels])
|
AC_ARG_VAR([SF_SCREEN_HEIGHT], [The height of the game window in pixels])
|
||||||
AC_ARG_VAR([SF_NOFONT], [Set to 1 to manually force the compiler not to include font/Unicode support])
|
AC_ARG_VAR([SF_NOFONT], [Set to 1 to manually force the compiler not to include font/Unicode support])
|
||||||
|
AC_ARG_VAR([SF_OLD_MUSIC], [Set to 1 to compile for use with the MOD-based music originally packaged with the game by Parallel Realities (note: you must supply said music if you use this option; all files must have the same name and format as distributed with Project: Starfighter 1.1)])
|
||||||
AC_ARG_VAR([SF_RUN_IN_PLACE], [Set to 1 to compile Starfighter to run in-place (instead of installing)])
|
AC_ARG_VAR([SF_RUN_IN_PLACE], [Set to 1 to compile Starfighter to run in-place (instead of installing)])
|
||||||
AS_IF([test -n "$SF_NOWARN"], [
|
AS_IF([test -n "$SF_WARN"], [
|
||||||
echo "Disabling compiler warnings"
|
|
||||||
], [
|
|
||||||
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -Wall -Wformat-truncation=0"
|
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -Wall -Wformat-truncation=0"
|
||||||
])
|
])
|
||||||
|
AS_IF([test -n "$SF_UNHARDEN"], [
|
||||||
|
echo "Building without hardening flags"
|
||||||
|
], [
|
||||||
|
STARFIGHTER_LDADD="-Wl,-z,now"
|
||||||
|
])
|
||||||
AS_IF([test -n "$SF_SCREEN_WIDTH"], [
|
AS_IF([test -n "$SF_SCREEN_WIDTH"], [
|
||||||
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DSCREEN_WIDTH=$SF_SCREEN_WIDTH"
|
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DSCREEN_WIDTH=$SF_SCREEN_WIDTH"
|
||||||
echo "Using default screen width of $SF_SCREEN_WIDTH"
|
echo "Using default screen width of $SF_SCREEN_WIDTH"
|
||||||
|
@ -86,6 +90,11 @@ AS_IF([test -n "$SF_NOFONT"], [
|
||||||
echo "Font/Unicode support manually disabled"
|
echo "Font/Unicode support manually disabled"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AS_IF([test -n "$SF_OLD_MUSIC"], [
|
||||||
|
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DOLD_MUSIC"
|
||||||
|
echo "Building for use with old music"
|
||||||
|
])
|
||||||
|
|
||||||
AS_IF([test -n "$SF_RUN_IN_PLACE"], [
|
AS_IF([test -n "$SF_RUN_IN_PLACE"], [
|
||||||
echo "Preparing a run-in-place build"
|
echo "Preparing a run-in-place build"
|
||||||
])
|
])
|
||||||
|
@ -111,7 +120,11 @@ AC_CHECK_FUNCS([atexit mkdir])
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
src/Makefile
|
gfx/Makefile
|
||||||
|
locale/Makefile
|
||||||
misc/Makefile
|
misc/Makefile
|
||||||
|
music/Makefile
|
||||||
|
sound/Makefile
|
||||||
|
src/Makefile
|
||||||
])
|
])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
030 +++ ADDITIONAL PROGRAMMING +++
|
030 +++ ADDITIONAL PROGRAMMING +++
|
||||||
020 Richard Sweeney
|
020 Richard Sweeney
|
||||||
020 Guus Sliepen
|
020 Guus Sliepen
|
||||||
020 Layla Marchant
|
020 The Diligent Circle
|
||||||
050 +++ QUALITY ASSURANCE AND ADVICE +++
|
050 +++ QUALITY ASSURANCE AND ADVICE +++
|
||||||
030 Sam Lantinga Ian Bissett
|
030 Sam Lantinga Ian Bissett
|
||||||
020 Chris Taylor Xan Christoph Reichenbach
|
020 Chris Taylor Xan Christoph Reichenbach
|
||||||
|
@ -45,15 +45,14 @@
|
||||||
020 p0ss
|
020 p0ss
|
||||||
020 Berklee
|
020 Berklee
|
||||||
050 +++ MUSIC +++
|
050 +++ MUSIC +++
|
||||||
030 Zander Noriega
|
|
||||||
020 maxstack
|
020 maxstack
|
||||||
020 Deceased Superior Technician
|
020 Deceased Superior Technician
|
||||||
020 matthew.pablo
|
020 matthew.pablo
|
||||||
020 tgfcoder
|
020 tgfcoder
|
||||||
020 JunglistMilitia
|
020 JunglistMilitia
|
||||||
020 neocrey
|
020 neocrey
|
||||||
020 WeskerHunter
|
020 The Diligent Circle
|
||||||
020 Jan125
|
020 Sweetpea
|
||||||
020 Alexandr Zhelanov
|
020 Alexandr Zhelanov
|
||||||
050 +++ SPECIAL THANKS +++
|
050 +++ SPECIAL THANKS +++
|
||||||
030 Wes Whitmore Ceri Done
|
030 Wes Whitmore Ceri Done
|
||||||
|
@ -65,5 +64,5 @@
|
||||||
350 Project: Starfighter
|
350 Project: Starfighter
|
||||||
020 Copyright 2003 Parallel Realities
|
020 Copyright 2003 Parallel Realities
|
||||||
020 Copyright 2012 Guus Sliepen, Astrid S. de Wijn and others
|
020 Copyright 2012 Guus Sliepen, Astrid S. de Wijn and others
|
||||||
020 Copyright 2015-2019 Layla Marchant
|
020 Copyright 2015-2020 The Diligent Circle
|
||||||
120 pr-starfighter.github.io
|
120 pr-starfighter.github.io
|
||||||
|
|
|
@ -0,0 +1,198 @@
|
||||||
|
# This file has been dedicated to the public domain, to the extent
|
||||||
|
# possible under applicable law, via CC0. See
|
||||||
|
# http://creativecommons.org/publicdomain/zero/1.0/ for more
|
||||||
|
# information. This file is offered as-is, without any warranty.
|
||||||
|
|
||||||
|
gfxdir = $(pkgdatadir)/gfx
|
||||||
|
|
||||||
|
nobase_dist_gfx_DATA = \
|
||||||
|
aimFighter1.png \
|
||||||
|
aimFighter2.png \
|
||||||
|
alienDevice.png \
|
||||||
|
arrowEast.png \
|
||||||
|
arrowNorth.png \
|
||||||
|
arrowNorthEast.png \
|
||||||
|
arrowNorthWest.png \
|
||||||
|
arrowSouth.png \
|
||||||
|
arrowSouthEast.png \
|
||||||
|
arrowSouthWest.png \
|
||||||
|
arrowWest.png \
|
||||||
|
asteroid1.png \
|
||||||
|
asteroid2.png \
|
||||||
|
asteroid3.png \
|
||||||
|
barrier.png \
|
||||||
|
buyIcon.png \
|
||||||
|
cargo1.png \
|
||||||
|
chainLink.png \
|
||||||
|
cloakShip1.png \
|
||||||
|
cloakShip2.png \
|
||||||
|
credits.jpg \
|
||||||
|
cursor.png \
|
||||||
|
dollar.png \
|
||||||
|
drone1.png \
|
||||||
|
drone2.png \
|
||||||
|
dualFighter1.png \
|
||||||
|
dualFighter2.png \
|
||||||
|
elec1.png \
|
||||||
|
elec2.png \
|
||||||
|
elec3.png \
|
||||||
|
elec4.png \
|
||||||
|
eliteFighter1.png \
|
||||||
|
eliteFighter2.png \
|
||||||
|
escort1.png \
|
||||||
|
escort2.png \
|
||||||
|
evilUrsula1.png \
|
||||||
|
evilUrsula2.png \
|
||||||
|
execTrans1.png \
|
||||||
|
execTrans2.png \
|
||||||
|
explode05.png \
|
||||||
|
explode06.png \
|
||||||
|
explode07.png \
|
||||||
|
explode08.png \
|
||||||
|
explode1.png \
|
||||||
|
explode10.png \
|
||||||
|
explode11.png \
|
||||||
|
explode12.png \
|
||||||
|
explode13.png \
|
||||||
|
explode14.png \
|
||||||
|
explode15.png \
|
||||||
|
explode16.png \
|
||||||
|
explode2.png \
|
||||||
|
explode3.png \
|
||||||
|
explode4.png \
|
||||||
|
explode9.png \
|
||||||
|
eyananth.jpg \
|
||||||
|
face_chris.png \
|
||||||
|
face_crew.png \
|
||||||
|
face_kline.png \
|
||||||
|
face_krass.png \
|
||||||
|
face_phoebe.png \
|
||||||
|
face_sid.png \
|
||||||
|
face_ursula.png \
|
||||||
|
firefly-big.png \
|
||||||
|
firefly1.png \
|
||||||
|
firefly2.png \
|
||||||
|
friendArrowEast.png \
|
||||||
|
friendArrowNorth.png \
|
||||||
|
friendArrowNorthEast.png \
|
||||||
|
friendArrowNorthWest.png \
|
||||||
|
friendArrowSouth.png \
|
||||||
|
friendArrowSouthEast.png \
|
||||||
|
friendArrowSouthWest.png \
|
||||||
|
friendArrowWest.png \
|
||||||
|
frigateBody1.png \
|
||||||
|
frigateBody2.png \
|
||||||
|
frigateGun11.png \
|
||||||
|
frigateGun12.png \
|
||||||
|
frigateGun21.png \
|
||||||
|
frigateGun22.png \
|
||||||
|
gameover.png \
|
||||||
|
goodTrans1.png \
|
||||||
|
goodTrans2.png \
|
||||||
|
greenDir.png \
|
||||||
|
heart.png \
|
||||||
|
icon1.png \
|
||||||
|
icon10.png \
|
||||||
|
icon11.png \
|
||||||
|
icon12.png \
|
||||||
|
icon13.png \
|
||||||
|
icon14.png \
|
||||||
|
icon15.png \
|
||||||
|
icon16.png \
|
||||||
|
icon17.png \
|
||||||
|
icon18.png \
|
||||||
|
icon19.png \
|
||||||
|
icon2.png \
|
||||||
|
icon20.png \
|
||||||
|
icon21.png \
|
||||||
|
icon22.png \
|
||||||
|
icon23.png \
|
||||||
|
icon24.png \
|
||||||
|
icon25.png \
|
||||||
|
icon26.png \
|
||||||
|
icon3.png \
|
||||||
|
icon4.png \
|
||||||
|
icon5.png \
|
||||||
|
icon6.png \
|
||||||
|
icon7.png \
|
||||||
|
icon8.png \
|
||||||
|
icon9.png \
|
||||||
|
iconBase.png \
|
||||||
|
kline11.png \
|
||||||
|
kline12.png \
|
||||||
|
klineText.png \
|
||||||
|
merc1.png \
|
||||||
|
merc2.png \
|
||||||
|
mine.png \
|
||||||
|
mineBoss1.png \
|
||||||
|
mineBoss2.png \
|
||||||
|
mineBossWing11.png \
|
||||||
|
mineBossWing12.png \
|
||||||
|
mineBossWing21.png \
|
||||||
|
mineBossWing22.png \
|
||||||
|
mineBossWing31.png \
|
||||||
|
mineBossWing32.png \
|
||||||
|
mineBossWing41.png \
|
||||||
|
mineBossWing42.png \
|
||||||
|
miner1.png \
|
||||||
|
miner2.png \
|
||||||
|
missileBoat1.png \
|
||||||
|
missileBoat2.png \
|
||||||
|
mobileCannon1.png \
|
||||||
|
mobileCannon2.png \
|
||||||
|
mobileShield1.png \
|
||||||
|
mobileShield2.png \
|
||||||
|
mordor.jpg \
|
||||||
|
ore1.png \
|
||||||
|
ore2.png \
|
||||||
|
ore3.png \
|
||||||
|
phoebeText.png \
|
||||||
|
planet_blue.png \
|
||||||
|
planet_green.png \
|
||||||
|
planet_orange.png \
|
||||||
|
planet_red.png \
|
||||||
|
planet_sun.png \
|
||||||
|
plasmaAmmo.png \
|
||||||
|
plasmaDamage.png \
|
||||||
|
plasmaGreen.png \
|
||||||
|
plasmaRate.png \
|
||||||
|
plasmaRed.png \
|
||||||
|
plutoBoss1.png \
|
||||||
|
plutoBoss2.png \
|
||||||
|
pod.png \
|
||||||
|
prlogo.png \
|
||||||
|
rebelCarrier1.png \
|
||||||
|
rebelCarrier2.png \
|
||||||
|
redDir.png \
|
||||||
|
rocket.png \
|
||||||
|
rocket1.png \
|
||||||
|
rocket2.png \
|
||||||
|
rocketAmmo.png \
|
||||||
|
sellIcon.png \
|
||||||
|
sflogo.png \
|
||||||
|
sid1.png \
|
||||||
|
sid2.png \
|
||||||
|
sidText.png \
|
||||||
|
slaveTrans1.png \
|
||||||
|
slaveTrans2.png \
|
||||||
|
smallFont.png \
|
||||||
|
sol.jpg \
|
||||||
|
spirit.jpg \
|
||||||
|
splitBoss11.png \
|
||||||
|
splitBoss12.png \
|
||||||
|
splitBoss21.png \
|
||||||
|
splitBoss22.png \
|
||||||
|
splitBoss31.png \
|
||||||
|
splitBoss32.png \
|
||||||
|
startUp.jpg \
|
||||||
|
stunBolt.png \
|
||||||
|
superCharge.png \
|
||||||
|
targetText.png \
|
||||||
|
transport1.png \
|
||||||
|
transport2.png \
|
||||||
|
tug1.png \
|
||||||
|
tug2.png \
|
||||||
|
ursulaText.png \
|
||||||
|
wingmate1.png \
|
||||||
|
wingmate2.png
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# This file has been dedicated to the public domain, to the extent
|
||||||
|
# possible under applicable law, via CC0. See
|
||||||
|
# http://creativecommons.org/publicdomain/zero/1.0/ for more
|
||||||
|
# information. This file is offered as-is, without any warranty.
|
||||||
|
|
||||||
|
locdir = $(pkgdatadir)/locale
|
||||||
|
|
||||||
|
# WHEN ADDING TRANSLATIONS: Please append all new gettext file names
|
||||||
|
# here (both the .po file and the .mo file). This ensures the
|
||||||
|
# translation is both distributed and installed properly.
|
||||||
|
nobase_dist_loc_DATA = \
|
||||||
|
build.py \
|
||||||
|
genpot.sh \
|
||||||
|
pr-starfighter.pot \
|
||||||
|
en.po \
|
||||||
|
ja.po \
|
||||||
|
nl.po \
|
||||||
|
en/LC_MESSAGES/pr-starfighter.mo \
|
||||||
|
ja/LC_MESSAGES/pr-starfighter.mo \
|
||||||
|
nl/LC_MESSAGES/pr-starfighter.mo
|
867
locale/en.po
867
locale/en.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
for fname in os.listdir():
|
||||||
|
root, ext = os.path.splitext(fname)
|
||||||
|
if ext == ".po":
|
||||||
|
subprocess.call(["msgmerge", "-U", fname, "pr-starfighter.pot"])
|
File diff suppressed because it is too large
Load Diff
|
@ -4,8 +4,12 @@
|
||||||
# information. This file is offered as-is, without any warranty.
|
# information. This file is offered as-is, without any warranty.
|
||||||
|
|
||||||
desktopdir = $(datarootdir)/applications
|
desktopdir = $(datarootdir)/applications
|
||||||
desktop_DATA = starfighter.desktop
|
desktop_DATA = io.github.pr_starfighter.starfighter.desktop
|
||||||
|
|
||||||
icondir = $(datarootdir)/pixmaps
|
icondir = $(datarootdir)/pixmaps
|
||||||
icon_DATA = starfighter.png
|
icon_DATA = starfighter.png
|
||||||
|
|
||||||
|
dist_man6_MANS = starfighter.6
|
||||||
|
|
||||||
|
appdatadir = $(datarootdir)/metainfo
|
||||||
|
appdata_DATA = io.github.pr_starfighter.starfighter.metainfo.xml
|
||||||
|
|
|
@ -8,3 +8,4 @@ Icon=starfighter
|
||||||
Categories=Game;ActionGame;ArcadeGame;
|
Categories=Game;ActionGame;ArcadeGame;
|
||||||
Terminal=false
|
Terminal=false
|
||||||
StartupNotify=false
|
StartupNotify=false
|
||||||
|
Keywords=Games
|
|
@ -0,0 +1,113 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<component type="desktop-application">
|
||||||
|
<id>io.github.pr_starfighter.starfighter</id>
|
||||||
|
<metadata_license>CC-BY-SA-4.0</metadata_license>
|
||||||
|
<project_license>GPL-3.0-or-later</project_license>
|
||||||
|
<name>Project: Starfighter</name>
|
||||||
|
<summary>Space shoot 'em up game.</summary>
|
||||||
|
<recommends>
|
||||||
|
<control>keyboard</control>
|
||||||
|
<control>gamepad</control>
|
||||||
|
</recommends>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
<p>
|
||||||
|
Project: Starfighter is a space shoot 'em up game originally developed
|
||||||
|
by Parallel Realities in 2002, and released in 2003. You assume the role
|
||||||
|
of Chris Bainfield in his quest to put an end to WEAPCO, the weapons
|
||||||
|
corporation which has enslaved the galaxy.
|
||||||
|
</p>
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<launchable type="desktop-id">io.github.pr_starfighter.starfighter.desktop</launchable>
|
||||||
|
|
||||||
|
<screenshots>
|
||||||
|
<screenshot type="default">
|
||||||
|
<image>https://pr-starfighter.github.io/images/screenshot1.png</image>
|
||||||
|
<caption>Explosions</caption>
|
||||||
|
</screenshot>
|
||||||
|
<screenshot>
|
||||||
|
<image>https://pr-starfighter.github.io/images/screenshot2.png</image>
|
||||||
|
<caption>Main Menu</caption>
|
||||||
|
</screenshot>
|
||||||
|
<screenshot>
|
||||||
|
<image>https://pr-starfighter.github.io/images/screenshot3.png</image>
|
||||||
|
<caption>Boss Fight</caption>
|
||||||
|
</screenshot>
|
||||||
|
<screenshot>
|
||||||
|
<image>https://pr-starfighter.github.io/images/screenshot4.png</image>
|
||||||
|
<caption>Mines and Asteroids</caption>
|
||||||
|
</screenshot>
|
||||||
|
</screenshots>
|
||||||
|
|
||||||
|
<releases>
|
||||||
|
<release version="v2.4" date="2020-12-27" type="stable">
|
||||||
|
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.4</url>
|
||||||
|
</release>
|
||||||
|
<release version="v2.3.3" date="2020-09-20" type="stable">
|
||||||
|
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.3.3</url>
|
||||||
|
</release>
|
||||||
|
<release version="v2.3.2" date="2020-09-05" type="stable">
|
||||||
|
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.3.2</url>
|
||||||
|
</release>
|
||||||
|
<release version="v2.3.1" date="2020-07-27" type="stable">
|
||||||
|
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.3.1</url>
|
||||||
|
</release>
|
||||||
|
<release version="v2.3" date="2020-07-16" type="stable">
|
||||||
|
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.3</url>
|
||||||
|
</release>
|
||||||
|
<release version="v2.2.1" date="2020-06-22" type="stable">
|
||||||
|
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.2.1</url>
|
||||||
|
</release>
|
||||||
|
<release version="v2.2" date="2020-05-27" type="stable">
|
||||||
|
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.2</url>
|
||||||
|
</release>
|
||||||
|
<release version="v2.1.1" date="2020-05-24" type="stable">
|
||||||
|
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.1.1</url>
|
||||||
|
</release>
|
||||||
|
<release version="v2.1" date="2020-04-02" type="stable">
|
||||||
|
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.1</url>
|
||||||
|
</release>
|
||||||
|
<release version="v2.0" date="2019-07-04" type="stable">
|
||||||
|
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.0.0.3</url>
|
||||||
|
</release>
|
||||||
|
</releases>
|
||||||
|
|
||||||
|
<url type="homepage">https://pr-starfighter.github.io/</url>
|
||||||
|
<url type="bugtracker">https://github.com/pr-starfighter/starfighter/issues</url>
|
||||||
|
<url type="donation">https://liberapay.com/diligentcircle</url>
|
||||||
|
|
||||||
|
<categories>
|
||||||
|
<category>Game</category>
|
||||||
|
<category>ActionGame</category>
|
||||||
|
<category>ArcadeGame</category>
|
||||||
|
</categories>
|
||||||
|
|
||||||
|
<provides>
|
||||||
|
<binary>starfighter</binary>
|
||||||
|
</provides>
|
||||||
|
|
||||||
|
<update_contact>diligentcircle@riseup.net</update_contact>
|
||||||
|
<content_rating type="oars-1.0">
|
||||||
|
<content_attribute id="violence-cartoon">none</content_attribute>
|
||||||
|
<content_attribute id="violence-fantasy">none</content_attribute>
|
||||||
|
<content_attribute id="violence-realistic">moderate</content_attribute>
|
||||||
|
<content_attribute id="violence-bloodshed">none</content_attribute>
|
||||||
|
<content_attribute id="violence-sexual">none</content_attribute>
|
||||||
|
<content_attribute id="drugs-alcohol">none</content_attribute>
|
||||||
|
<content_attribute id="drugs-narcotics">none</content_attribute>
|
||||||
|
<content_attribute id="drugs-tobacco">none</content_attribute>
|
||||||
|
<content_attribute id="sex-nudity">none</content_attribute>
|
||||||
|
<content_attribute id="sex-themes">none</content_attribute>
|
||||||
|
<content_attribute id="language-profanity">moderate</content_attribute>
|
||||||
|
<content_attribute id="language-humor">none</content_attribute>
|
||||||
|
<content_attribute id="language-discrimination">none</content_attribute>
|
||||||
|
<content_attribute id="social-chat">none</content_attribute>
|
||||||
|
<content_attribute id="social-info">none</content_attribute>
|
||||||
|
<content_attribute id="social-audio">none</content_attribute>
|
||||||
|
<content_attribute id="social-location">none</content_attribute>
|
||||||
|
<content_attribute id="social-contacts">none</content_attribute>
|
||||||
|
<content_attribute id="money-purchasing">none</content_attribute>
|
||||||
|
<content_attribute id="money-gambling">none</content_attribute>
|
||||||
|
</content_rating>
|
||||||
|
</component>
|
|
@ -0,0 +1,51 @@
|
||||||
|
.\" Hey, EMACS: -*- nroff -*-
|
||||||
|
.\" First parameter, NAME, should be all caps
|
||||||
|
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||||
|
.\" other parameters are allowed: see man(7), man(1)
|
||||||
|
.TH STARFIGHTER 6 "September 5, 2020"
|
||||||
|
.\" Please adjust this date whenever revising the manpage.
|
||||||
|
.\"
|
||||||
|
.\" Some roff macros, for reference:
|
||||||
|
.\" .nh disable hyphenation
|
||||||
|
.\" .hy enable hyphenation
|
||||||
|
.\" .ad l left justify
|
||||||
|
.\" .ad b justify to both left and right margins
|
||||||
|
.\" .nf disable filling
|
||||||
|
.\" .fi enable filling
|
||||||
|
.\" .br insert line break
|
||||||
|
.\" .sp <n> insert n+1 empty lines
|
||||||
|
.\" for manpage-specific macros, see man(7)
|
||||||
|
.SH NAME
|
||||||
|
starfighter \- 2D shoot em up
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B starfighter
|
||||||
|
.RI [ options ]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This manual page briefly documents
|
||||||
|
.B Project: Starfighter.
|
||||||
|
|
||||||
|
In the year 2579, the intergalactic weapons corporation, WEAPCO, has
|
||||||
|
dominated the galaxy. Guide Chris Bainfield and his friend Sid Wilson on
|
||||||
|
their quest to liberate the galaxy from the clutches of WEAPCO. Along
|
||||||
|
the way, you will encounter new foes, make new allies, and assist local
|
||||||
|
rebels in strikes against the evil corporation.
|
||||||
|
|
||||||
|
Originally developed by Parallel Realities in 2003, Project: Starfighter
|
||||||
|
is a side-scrolling shoot 'em up space game, released under the GNU GPL.
|
||||||
|
Consisting of 26 engaging levels spanning four planetary systems, this
|
||||||
|
classic game will entertain for hours.
|
||||||
|
|
||||||
|
https://pr-starfighter.gitub.io
|
||||||
|
.SH OPTIONS
|
||||||
|
A summary of options is included below.
|
||||||
|
.TP
|
||||||
|
.B \-noaudio
|
||||||
|
Disables sound and music.
|
||||||
|
.TP
|
||||||
|
.B \-mono
|
||||||
|
Mono sound output (best for headphones).
|
||||||
|
.SH AUTHOR
|
||||||
|
This manual page was written by Bartosz Fenski <fenio@debian.org>,
|
||||||
|
for the Debian project (but may be used by others). Modified by The
|
||||||
|
Diligent Circle <diligentcircle@riseup.net> for official use by Project:
|
||||||
|
Starfighter.
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# This file has been dedicated to the public domain, to the extent
|
||||||
|
# possible under applicable law, via CC0. See
|
||||||
|
# http://creativecommons.org/publicdomain/zero/1.0/ for more
|
||||||
|
# information. This file is offered as-is, without any warranty.
|
||||||
|
#
|
||||||
|
# Script which can be used to easily run Starfighter in-place without
|
||||||
|
# installing on POSIX systems, but not on MacOS.
|
||||||
|
|
||||||
|
SCRIPT=$(readlink -f "$0")
|
||||||
|
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||||
|
cd $SCRIPTPATH
|
||||||
|
./src/starfighter "$@"
|
|
@ -0,0 +1,23 @@
|
||||||
|
# This file has been dedicated to the public domain, to the extent
|
||||||
|
# possible under applicable law, via CC0. See
|
||||||
|
# http://creativecommons.org/publicdomain/zero/1.0/ for more
|
||||||
|
# information. This file is offered as-is, without any warranty.
|
||||||
|
|
||||||
|
musicdir = $(pkgdatadir)/music
|
||||||
|
|
||||||
|
nobase_dist_music_DATA = \
|
||||||
|
android_oppression.ogg \
|
||||||
|
androids_last_dance.ogg \
|
||||||
|
first_cyber_dance.ogg \
|
||||||
|
frozen_jam.ogg \
|
||||||
|
last_cyber_dance.ogg \
|
||||||
|
orbital_colossus.ogg \
|
||||||
|
railjet_short.ogg \
|
||||||
|
rise_of_spirit.ogg \
|
||||||
|
sleeping_with_androids.ogg \
|
||||||
|
sound_and_silence.ogg \
|
||||||
|
space_dimensions.ogg \
|
||||||
|
through_space.ogg
|
||||||
|
|
||||||
|
EXTRA_DIST = sources
|
||||||
|
|
BIN
music/RE.ogg
BIN
music/RE.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
music/death.ogg
BIN
music/death.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,27 @@
|
||||||
|
# This file has been dedicated to the public domain, to the extent
|
||||||
|
# possible under applicable law, via CC0. See
|
||||||
|
# http://creativecommons.org/publicdomain/zero/1.0/ for more
|
||||||
|
# information. This file is offered as-is, without any warranty.
|
||||||
|
|
||||||
|
sounddir = $(pkgdatadir)/sound
|
||||||
|
|
||||||
|
nobase_dist_sound_DATA = \
|
||||||
|
beamLaser.ogg \
|
||||||
|
cloak.ogg \
|
||||||
|
clock.ogg \
|
||||||
|
explode.ogg \
|
||||||
|
explode2.ogg \
|
||||||
|
explode3.ogg \
|
||||||
|
explode4.ogg \
|
||||||
|
flyby.ogg \
|
||||||
|
hyperSpace.ogg \
|
||||||
|
item.ogg \
|
||||||
|
laser.ogg \
|
||||||
|
maledeath.ogg \
|
||||||
|
missile.ogg \
|
||||||
|
missile2.ogg \
|
||||||
|
plasma.ogg \
|
||||||
|
plasma2.ogg \
|
||||||
|
plasma3.ogg \
|
||||||
|
shield.ogg
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Project: Starfighter
|
Project: Starfighter
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012 Guus Sliepen
|
Copyright (C) 2011, 2012 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -78,10 +78,6 @@ int main(int argc, char **argv)
|
||||||
printf("Warning: failed to change directory to \"%s\"\n", DATADIR);
|
printf("Warning: failed to change directory to \"%s\"\n", DATADIR);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
|
||||||
bindtextdomain("pr-starfighter", "./locale/");
|
|
||||||
textdomain("pr-starfighter");
|
|
||||||
|
|
||||||
engine_init(); // Must do this first!
|
engine_init(); // Must do this first!
|
||||||
|
|
||||||
cheatAttempt = 0;
|
cheatAttempt = 0;
|
||||||
|
@ -97,7 +93,7 @@ int main(int argc, char **argv)
|
||||||
printf("Additional Commands\n");
|
printf("Additional Commands\n");
|
||||||
printf("\t-noaudio Disables sound and music\n");
|
printf("\t-noaudio Disables sound and music\n");
|
||||||
printf("\t-mono Mono sound output (best for headphones)\n\n");
|
printf("\t-mono Mono sound output (best for headphones)\n\n");
|
||||||
printf("http://starfighter.nongnu.org\n");
|
printf("https://pr-starfighter.github.io\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
@ -118,8 +114,8 @@ int main(int argc, char **argv)
|
||||||
cheatCount = 2;
|
cheatCount = 2;
|
||||||
if ((strcmp(argv[i], "it") == 0) && (cheatCount == 2))
|
if ((strcmp(argv[i], "it") == 0) && (cheatCount == 2))
|
||||||
cheatCount = 3;
|
cheatCount = 3;
|
||||||
if (((strcmp(argv[i], "better") == 0) && (cheatCount == 3)) ||
|
if (((strcmp(argv[i], "better") == 0) && (cheatCount == 3))
|
||||||
(strcmp(argv[i], "humansdoitbetter") == 0))
|
|| (strcmp(argv[i], "humansdoitbetter") == 0))
|
||||||
{
|
{
|
||||||
printf("Humans do it better! Cheats enabled.\n");
|
printf("Humans do it better! Cheats enabled.\n");
|
||||||
engine.cheat = 1;
|
engine.cheat = 1;
|
||||||
|
@ -129,9 +125,18 @@ int main(int argc, char **argv)
|
||||||
atexit(engine_cleanup);
|
atexit(engine_cleanup);
|
||||||
|
|
||||||
gfx_init();
|
gfx_init();
|
||||||
engine_setMode();
|
engine_setMode(); // Settings get loaded here
|
||||||
gfx_loadFont();
|
gfx_loadFont();
|
||||||
|
|
||||||
|
if ((strcmp(engine.lang, "default") == 0)
|
||||||
|
|| (strcmp(engine.lang, "") == 0))
|
||||||
|
setlocale(LC_ALL, "");
|
||||||
|
else
|
||||||
|
setlocale(LC_ALL, engine.lang);
|
||||||
|
|
||||||
|
bindtextdomain("pr-starfighter", "./locale/");
|
||||||
|
textdomain("pr-starfighter");
|
||||||
|
|
||||||
if (cheatAttempt && !engine.cheat)
|
if (cheatAttempt && !engine.cheat)
|
||||||
{
|
{
|
||||||
screen_clear(black);
|
screen_clear(black);
|
||||||
|
@ -166,7 +171,7 @@ int main(int argc, char **argv)
|
||||||
// Determine which part of the game we will go to...
|
// Determine which part of the game we will go to...
|
||||||
section = 0;
|
section = 0;
|
||||||
|
|
||||||
game.difficulty = DIFFICULTY_NORMAL;
|
game.difficulty = DIFFICULTY_EASY;
|
||||||
game_init();
|
game_init();
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
|
|
262
src/alien.c
262
src/alien.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012 Guus Sliepen
|
Copyright (C) 2011, 2012 Guus Sliepen
|
||||||
Copyright (C) 2012, 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -62,6 +62,39 @@ static int alien_getFreeIndex()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void alien_nerf(int index)
|
||||||
|
{
|
||||||
|
if (game.difficulty == DIFFICULTY_SUPEREASY)
|
||||||
|
{
|
||||||
|
if ((aliens[index].classDef == CD_SID)
|
||||||
|
|| (aliens[index].classDef == CD_PHOEBE)
|
||||||
|
|| (aliens[index].classDef == CD_URSULA)
|
||||||
|
|| (aliens[index].classDef == CD_GOODTRANSPORT)
|
||||||
|
|| (aliens[index].classDef == CD_REBELCARRIER)
|
||||||
|
|| ((game.area == MISN_URUSOR)
|
||||||
|
&& (aliens[index].classDef == CD_CARGOSHIP)))
|
||||||
|
{
|
||||||
|
aliens[index].shield *= 4;
|
||||||
|
aliens[index].maxShield *= 4;
|
||||||
|
}
|
||||||
|
else if ((aliens[index].classDef != CD_ASTEROID)
|
||||||
|
&& (aliens[index].classDef != CD_ASTEROID2))
|
||||||
|
{
|
||||||
|
aliens[index].shield /= 2;
|
||||||
|
aliens[index].maxShield /= 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||||
|
&& (game.difficulty < DIFFICULTY_HARD)
|
||||||
|
&& (game.area == MISN_URUSOR)
|
||||||
|
&& (aliens[index].classDef == CD_CARGOSHIP))
|
||||||
|
{
|
||||||
|
// Lighter version of the Urusor cargo ship shield buff.
|
||||||
|
aliens[index].shield *= 3;
|
||||||
|
aliens[index].maxShield *= 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void alien_defs_init()
|
void alien_defs_init()
|
||||||
{
|
{
|
||||||
// Dual Plasma Fighter.
|
// Dual Plasma Fighter.
|
||||||
|
@ -1063,7 +1096,8 @@ void aliens_init()
|
||||||
if (aliens[i].classDef == CD_CLOAKFIGHTER)
|
if (aliens[i].classDef == CD_CLOAKFIGHTER)
|
||||||
{
|
{
|
||||||
aliens[i].active = 0;
|
aliens[i].active = 0;
|
||||||
aliens[i].maxShield = aliens[i].shield = 400;
|
aliens[i].maxShield = 400;
|
||||||
|
aliens[i].shield = 400;
|
||||||
aliens[i].flags &= ~FL_RUNSAWAY;
|
aliens[i].flags &= ~FL_RUNSAWAY;
|
||||||
aliens[i].speed = 3;
|
aliens[i].speed = 3;
|
||||||
}
|
}
|
||||||
|
@ -1085,8 +1119,8 @@ void aliens_init()
|
||||||
barrierSpeed++;
|
barrierSpeed++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((game.area == MISN_POSWIC) &&
|
if ((game.area == MISN_POSWIC)
|
||||||
(aliens[i].classDef == CD_BOSS))
|
&& (aliens[i].classDef == CD_BOSS))
|
||||||
{
|
{
|
||||||
aliens[i].flags |= FL_IMMORTAL;
|
aliens[i].flags |= FL_IMMORTAL;
|
||||||
}
|
}
|
||||||
|
@ -1119,8 +1153,8 @@ void aliens_init()
|
||||||
aliens[ALIEN_BOSS_PART2].dx = -20;
|
aliens[ALIEN_BOSS_PART2].dx = -20;
|
||||||
aliens[ALIEN_BOSS_PART2].dy = 37;
|
aliens[ALIEN_BOSS_PART2].dy = 37;
|
||||||
}
|
}
|
||||||
else if ((game.area == MISN_ELAMALE) ||
|
else if ((game.area == MISN_ELAMALE)
|
||||||
(game.area == MISN_FELLON))
|
|| (game.area == MISN_FELLON))
|
||||||
{
|
{
|
||||||
aliens[ALIEN_BOSS].target = &player;
|
aliens[ALIEN_BOSS].target = &player;
|
||||||
aliens[ALIEN_BOSS].x = -screen->w / 2;
|
aliens[ALIEN_BOSS].x = -screen->w / 2;
|
||||||
|
@ -1165,12 +1199,16 @@ void aliens_init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int alien_add()
|
/* Adds an alien. If spawnedMisnTarget is non-NULL, it is set to 1 if
|
||||||
|
* a mission target which can be forced with game.forceMisnTarget was
|
||||||
|
* spawned (or otherwise left unchanged).
|
||||||
|
*/
|
||||||
|
int alien_add(int *spawnedMisnTarget)
|
||||||
{
|
{
|
||||||
int index = alien_getFreeIndex();
|
int index = alien_getFreeIndex();
|
||||||
|
|
||||||
if ((index == -1) || (game.area == MISN_JUPITER) ||
|
if ((index == -1) || (game.area == MISN_JUPITER)
|
||||||
(game.area == MISN_VENUS))
|
|| (game.area == MISN_VENUS))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
int *alienArray;
|
int *alienArray;
|
||||||
|
@ -1286,14 +1324,23 @@ int alien_add()
|
||||||
|
|
||||||
int randEnemy = alienArray[rand() % numberOfAliens];
|
int randEnemy = alienArray[rand() % numberOfAliens];
|
||||||
|
|
||||||
if ((game.area != MISN_DORIM) &&
|
if ((game.area != MISN_DORIM)
|
||||||
(game.area != MISN_SIVEDI) &&
|
&& (game.area != MISN_SIVEDI)
|
||||||
(game.area != MISN_MARS))
|
&& (game.area != MISN_MARS))
|
||||||
{
|
{
|
||||||
if ((game.system == SYSTEM_EYANANTH) && (game.area == MISN_INTERCEPTION))
|
if ((game.system == SYSTEM_EYANANTH)
|
||||||
|
&& (game.area == MISN_INTERCEPTION))
|
||||||
{
|
{
|
||||||
if (CHANCE(1. / 5.))
|
if (CHANCE(1. / 5.)
|
||||||
|
|| (game.difficulty != DIFFICULTY_ORIGINAL
|
||||||
|
&& game.forceMisnTarget))
|
||||||
|
{
|
||||||
randEnemy = CD_SLAVETRANSPORT;
|
randEnemy = CD_SLAVETRANSPORT;
|
||||||
|
game.forceMisnTarget = 0;
|
||||||
|
|
||||||
|
if (spawnedMisnTarget != NULL)
|
||||||
|
*spawnedMisnTarget = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CHANCE(1. / 6.))
|
if (CHANCE(1. / 6.))
|
||||||
|
@ -1315,12 +1362,9 @@ int alien_add()
|
||||||
LIMIT(aliens[index].deathCounter, -250, 0);
|
LIMIT(aliens[index].deathCounter, -250, 0);
|
||||||
|
|
||||||
// Attempts to place an alien. If it fails, the alien is deactivated.
|
// Attempts to place an alien. If it fails, the alien is deactivated.
|
||||||
for (int i = 0 ; i < 100 ; i++)
|
if (!alien_place(&aliens[index]))
|
||||||
{
|
{
|
||||||
if (alien_place(&aliens[index]))
|
|
||||||
break;
|
|
||||||
aliens[index].active = 0;
|
aliens[index].active = 0;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1341,6 +1385,8 @@ int alien_add()
|
||||||
if (game.area == MISN_ELLESH)
|
if (game.area == MISN_ELLESH)
|
||||||
aliens[index].flags |= FL_HASMINIMUMSPEED;
|
aliens[index].flags |= FL_HASMINIMUMSPEED;
|
||||||
|
|
||||||
|
alien_nerf(index);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1363,6 +1409,8 @@ void alien_addDrone(Object *hostAlien)
|
||||||
|
|
||||||
aliens[index].x = hostAlien->x + RANDRANGE(0, 50);
|
aliens[index].x = hostAlien->x + RANDRANGE(0, 50);
|
||||||
aliens[index].y = hostAlien->y + RANDRANGE(0, 50);
|
aliens[index].y = hostAlien->y + RANDRANGE(0, 50);
|
||||||
|
|
||||||
|
alien_nerf(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void alien_addSmallAsteroid(Object *hostAlien)
|
void alien_addSmallAsteroid(Object *hostAlien)
|
||||||
|
@ -1430,6 +1478,8 @@ void alien_addFriendly(int type)
|
||||||
// For the sake of it being the final battle :)
|
// For the sake of it being the final battle :)
|
||||||
if (game.area == MISN_EARTH)
|
if (game.area == MISN_EARTH)
|
||||||
aliens[type].flags |= FL_IMMORTAL;
|
aliens[type].flags |= FL_IMMORTAL;
|
||||||
|
|
||||||
|
alien_nerf(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
int alien_place(Object *alien)
|
int alien_place(Object *alien)
|
||||||
|
@ -1446,8 +1496,16 @@ int alien_place(Object *alien)
|
||||||
|
|
||||||
if (game.area == MISN_MARS)
|
if (game.area == MISN_MARS)
|
||||||
{
|
{
|
||||||
alien->x = screen->w + RANDRANGE(0, 400);
|
if (game.difficulty == DIFFICULTY_SUPEREASY)
|
||||||
alien->y = RANDRANGE(-screen->h / 3, (4 * screen->h) / 3);
|
{
|
||||||
|
alien->x = screen->w + RANDRANGE(0, 1200);
|
||||||
|
alien->y = RANDRANGE(-screen->h, screen->h);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
alien->x = screen->w + RANDRANGE(0, 400);
|
||||||
|
alien->y = RANDRANGE(-screen->h / 3, (4 * screen->h) / 3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
||||||
|
@ -1550,7 +1608,7 @@ void alien_setAI(Object *alien)
|
||||||
|
|
||||||
void alien_setKlineAttackMethod(Object *alien)
|
void alien_setKlineAttackMethod(Object *alien)
|
||||||
{
|
{
|
||||||
if (alien->shield <= 500)
|
if (alien->shield <= alien->maxShield / 4)
|
||||||
{
|
{
|
||||||
/// Dialog (Kline Kethlan)
|
/// Dialog (Kline Kethlan)
|
||||||
/// Used when the final "stage" of the Venus fight is entered.
|
/// Used when the final "stage" of the Venus fight is entered.
|
||||||
|
@ -1561,7 +1619,7 @@ void alien_setKlineAttackMethod(Object *alien)
|
||||||
alien->chance[0] = 100;
|
alien->chance[0] = 100;
|
||||||
alien->chance[1] = 2;
|
alien->chance[1] = 2;
|
||||||
}
|
}
|
||||||
else if (alien->shield <= 1000)
|
else if (alien->shield <= alien->maxShield / 2)
|
||||||
{
|
{
|
||||||
/// Dialog (Kline Kethlan)
|
/// Dialog (Kline Kethlan)
|
||||||
/// Used when the third "stage" of the Vinus fight is entered.
|
/// Used when the third "stage" of the Vinus fight is entered.
|
||||||
|
@ -1590,16 +1648,25 @@ This AI is exclusively for Kline.
|
||||||
*/
|
*/
|
||||||
void alien_setKlineAI(Object *alien)
|
void alien_setKlineAI(Object *alien)
|
||||||
{
|
{
|
||||||
|
int threshold;
|
||||||
|
|
||||||
// Weapon type change
|
// Weapon type change
|
||||||
if (CHANCE(1. / 3.))
|
if (CHANCE(1. / 3.))
|
||||||
{
|
{
|
||||||
if ((game.area != MISN_VENUS) || (game.difficulty != DIFFICULTY_ORIGINAL))
|
if ((game.area != MISN_VENUS)
|
||||||
|
|| (game.difficulty != DIFFICULTY_ORIGINAL))
|
||||||
{
|
{
|
||||||
alien->flags &= ~FL_AIMS;
|
alien->flags &= ~FL_AIMS;
|
||||||
|
|
||||||
if (CHANCE(0.5))
|
if (CHANCE(0.5))
|
||||||
{
|
{
|
||||||
if ((game.area != MISN_VENUS) || (alien->shield > 1500))
|
if (game.difficulty == DIFFICULTY_SUPEREASY)
|
||||||
|
threshold = 750;
|
||||||
|
else
|
||||||
|
threshold = 1500;
|
||||||
|
|
||||||
|
if ((game.area != MISN_VENUS)
|
||||||
|
|| (alien->shield > threshold))
|
||||||
alien->weaponType[0] = W_TRIPLE_SHOT;
|
alien->weaponType[0] = W_TRIPLE_SHOT;
|
||||||
else
|
else
|
||||||
alien->weaponType[0] = W_SPREADSHOT;
|
alien->weaponType[0] = W_SPREADSHOT;
|
||||||
|
@ -1618,8 +1685,8 @@ void alien_setKlineAI(Object *alien)
|
||||||
switch(RANDRANGE(0, 9))
|
switch(RANDRANGE(0, 9))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if ((alien->weaponType[0] != W_DIRSHOCKMISSILE) &&
|
if ((alien->weaponType[0] != W_DIRSHOCKMISSILE)
|
||||||
(alien->weaponType[1] != W_MICRO_HOMING_MISSILES))
|
&& (alien->weaponType[1] != W_MICRO_HOMING_MISSILES))
|
||||||
alien->flags |= FL_CONTINUOUS_FIRE;
|
alien->flags |= FL_CONTINUOUS_FIRE;
|
||||||
alien->dx = ((alien->x - alien->target->x) /
|
alien->dx = ((alien->x - alien->target->x) /
|
||||||
((300 / alien->speed) + RANDRANGE(0, 100)));
|
((300 / alien->speed) + RANDRANGE(0, 100)));
|
||||||
|
@ -1629,9 +1696,9 @@ void alien_setKlineAI(Object *alien)
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
// Kline only attacks when he is ready!
|
// Kline only attacks when he is ready!
|
||||||
if ((!(alien->flags & FL_NOFIRE)) &&
|
if ((!(alien->flags & FL_NOFIRE))
|
||||||
((game.area == MISN_ELAMALE) ||
|
&& ((game.area == MISN_ELAMALE)
|
||||||
game.difficulty != DIFFICULTY_ORIGINAL))
|
|| game.difficulty != DIFFICULTY_ORIGINAL))
|
||||||
alien->flags |= FL_DROPMINES;
|
alien->flags |= FL_DROPMINES;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
@ -1681,8 +1748,8 @@ void alien_searchForTarget(Object *alien)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((targetEnemy->classDef != CD_CARGOSHIP) &&
|
if ((targetEnemy->classDef != CD_CARGOSHIP)
|
||||||
(targetEnemy->classDef != CD_BOSS))
|
&& (targetEnemy->classDef != CD_BOSS))
|
||||||
{
|
{
|
||||||
badTarget = 1;
|
badTarget = 1;
|
||||||
}
|
}
|
||||||
|
@ -1698,8 +1765,8 @@ void alien_searchForTarget(Object *alien)
|
||||||
if (targetEnemy->classDef == CD_BOSS)
|
if (targetEnemy->classDef == CD_BOSS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((targetEnemy->flags & FL_DISABLED) ||
|
if ((targetEnemy->flags & FL_DISABLED)
|
||||||
(targetEnemy->flags & FL_NOFIRE))
|
|| (targetEnemy->flags & FL_NOFIRE))
|
||||||
badTarget = 1;
|
badTarget = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1770,8 +1837,8 @@ int alien_checkTarget(Object *alien)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
// Not at the correct vertical height
|
// Not at the correct vertical height
|
||||||
if ((alien->y < alien->target->y - 15) ||
|
if ((alien->y < alien->target->y - 15)
|
||||||
(alien->y > alien->target->y + alien->target->image[0]->h + 15))
|
|| (alien->y > alien->target->y + alien->target->image[0]->h + 15))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1785,11 +1852,11 @@ int alien_enemiesInFront(Object *alien)
|
||||||
{
|
{
|
||||||
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
||||||
{
|
{
|
||||||
if ((alien != &aliens[i]) && (aliens[i].flags & FL_WEAPCO) &&
|
if ((alien != &aliens[i]) && (aliens[i].flags & FL_WEAPCO)
|
||||||
(aliens[i].shield > 0))
|
&& (aliens[i].shield > 0))
|
||||||
{
|
{
|
||||||
if ((alien->y > aliens[i].y - 15) &&
|
if ((alien->y > aliens[i].y - 15)
|
||||||
(alien->y < aliens[i].y + aliens[i].image[0]->h + 15))
|
&& (alien->y < aliens[i].y + aliens[i].image[0]->h + 15))
|
||||||
{
|
{
|
||||||
if ((alien->face == 1) && (aliens[i].x < alien->x))
|
if ((alien->face == 1) && (aliens[i].x < alien->x))
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1814,7 +1881,7 @@ void alien_move(Object *alien)
|
||||||
|
|
||||||
if (alien->owner == alien)
|
if (alien->owner == alien)
|
||||||
{
|
{
|
||||||
if (alien->flags & FL_CIRCLES)
|
if ((alien->flags & FL_CIRCLES) && (!(alien->flags & FL_LEAVESECTOR)))
|
||||||
{
|
{
|
||||||
if (alien->face == 0)
|
if (alien->face == 0)
|
||||||
{
|
{
|
||||||
|
@ -1841,14 +1908,18 @@ void alien_move(Object *alien)
|
||||||
{
|
{
|
||||||
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
||||||
{
|
{
|
||||||
if ((aliens[i].owner != alien) && (aliens[i].active) &&
|
if ((aliens[i].owner != alien) && (aliens[i].active)
|
||||||
(aliens[i].shield > 0) && (!(aliens[i].flags & FL_LEAVESECTOR)) &&
|
&& (aliens[i].shield > 0)
|
||||||
(alien->classDef != CD_BARRIER) &&
|
&& (!(aliens[i].flags & FL_LEAVESECTOR))
|
||||||
ship_collision(alien, &aliens[i]))
|
&& (alien->classDef != CD_BARRIER)
|
||||||
|
&& ship_collision(alien, &aliens[i]))
|
||||||
{
|
{
|
||||||
if ((game.difficulty == DIFFICULTY_ORIGINAL) && (alien->classDef != CD_DRONE) &&
|
if ((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
(alien->classDef != CD_ASTEROID) && (alien->classDef != CD_ASTEROID2) &&
|
&& (alien->classDef != CD_DRONE)
|
||||||
(alien->owner == alien) && (game.area != MISN_ELLESH))
|
&& (alien->classDef != CD_ASTEROID)
|
||||||
|
&& (alien->classDef != CD_ASTEROID2)
|
||||||
|
&& (alien->owner == alien)
|
||||||
|
&& (game.area != MISN_ELLESH))
|
||||||
{
|
{
|
||||||
collided = 1;
|
collided = 1;
|
||||||
}
|
}
|
||||||
|
@ -1933,8 +2004,8 @@ void alien_destroy(Object *alien, Object *attacker)
|
||||||
audio_playSound(SFX_EXPLOSION, alien->x, alien->y);
|
audio_playSound(SFX_EXPLOSION, alien->x, alien->y);
|
||||||
|
|
||||||
// Chain reaction damage if needed (Classic Difficulty version)
|
// Chain reaction damage if needed (Classic Difficulty version)
|
||||||
if ((game.difficulty == DIFFICULTY_ORIGINAL) &&
|
if ((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
(alien->owner != alien) && (alien->flags & FL_DAMAGEOWNER))
|
&& (alien->owner != alien) && (alien->flags & FL_DAMAGEOWNER))
|
||||||
{
|
{
|
||||||
alien_hurt(alien->owner, attacker, alien->maxShield, 0);
|
alien_hurt(alien->owner, attacker, alien->maxShield, 0);
|
||||||
}
|
}
|
||||||
|
@ -1970,8 +2041,8 @@ void alien_destroy(Object *alien, Object *attacker)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CHANCE(1 / 16.) && (alien->flags & FL_WEAPCO) &&
|
if (CHANCE(1 / 16.) && (alien->flags & FL_WEAPCO)
|
||||||
(!(alien->flags & FL_NOBANTER)))
|
&& (!(alien->flags & FL_NOBANTER)))
|
||||||
{
|
{
|
||||||
radio_getRandomMessage(msg, _(
|
radio_getRandomMessage(msg, _(
|
||||||
/// Chris brag messages
|
/// Chris brag messages
|
||||||
|
@ -2003,8 +2074,8 @@ void alien_destroy(Object *alien, Object *attacker)
|
||||||
else if (attacker->classDef == CD_PHOEBE)
|
else if (attacker->classDef == CD_PHOEBE)
|
||||||
{
|
{
|
||||||
game.wingMate1Kills++;
|
game.wingMate1Kills++;
|
||||||
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO) &&
|
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO)
|
||||||
(!(alien->flags & FL_NOBANTER)))
|
&& (!(alien->flags & FL_NOBANTER)))
|
||||||
{
|
{
|
||||||
radio_getRandomMessage(msg, _(
|
radio_getRandomMessage(msg, _(
|
||||||
/// Phoebe brag messages
|
/// Phoebe brag messages
|
||||||
|
@ -2018,7 +2089,7 @@ void alien_destroy(Object *alien, Object *attacker)
|
||||||
"Target destroyed!\n"
|
"Target destroyed!\n"
|
||||||
"One more for me!\n"
|
"One more for me!\n"
|
||||||
"Yes! Did you see that, Chris?\n"
|
"Yes! Did you see that, Chris?\n"
|
||||||
"Hey Chris, remind me to check my kill count later!\n"
|
"Hey, Chris, remind me to check my kill count later!\n"
|
||||||
"Bring it on, WEAPCO!\n"
|
"Bring it on, WEAPCO!\n"
|
||||||
"Take that, WEAPCO!\n"
|
"Take that, WEAPCO!\n"
|
||||||
"My kill count is going up!\n"
|
"My kill count is going up!\n"
|
||||||
|
@ -2032,8 +2103,8 @@ void alien_destroy(Object *alien, Object *attacker)
|
||||||
else if (attacker->classDef == CD_URSULA)
|
else if (attacker->classDef == CD_URSULA)
|
||||||
{
|
{
|
||||||
game.wingMate2Kills++;
|
game.wingMate2Kills++;
|
||||||
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO) &&
|
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO)
|
||||||
(!(alien->flags & FL_NOBANTER)))
|
&& (!(alien->flags & FL_NOBANTER)))
|
||||||
{
|
{
|
||||||
radio_getRandomMessage(msg, _(
|
radio_getRandomMessage(msg, _(
|
||||||
/// Ursula brag messages
|
/// Ursula brag messages
|
||||||
|
@ -2123,6 +2194,8 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
||||||
{
|
{
|
||||||
int ai_type;
|
int ai_type;
|
||||||
double run_chance;
|
double run_chance;
|
||||||
|
int stage1_shield, stage2_shield, stage3_shield;
|
||||||
|
int i;
|
||||||
|
|
||||||
ai_type = ((game.difficulty == DIFFICULTY_ORIGINAL) ?
|
ai_type = ((game.difficulty == DIFFICULTY_ORIGINAL) ?
|
||||||
alien->AITypeOriginal : alien->AIType);
|
alien->AITypeOriginal : alien->AIType);
|
||||||
|
@ -2133,8 +2206,8 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
||||||
alien->shield -= damage;
|
alien->shield -= damage;
|
||||||
|
|
||||||
// Chain reaction damage if needed
|
// Chain reaction damage if needed
|
||||||
if ((game.difficulty != DIFFICULTY_ORIGINAL) &&
|
if ((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||||
(alien->owner != alien) && (alien->flags & FL_DAMAGEOWNER))
|
&& (alien->owner != alien) && (alien->flags & FL_DAMAGEOWNER))
|
||||||
{
|
{
|
||||||
alien_hurt(alien->owner, attacker, damage, ion);
|
alien_hurt(alien->owner, attacker, damage, ion);
|
||||||
}
|
}
|
||||||
|
@ -2143,11 +2216,15 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
||||||
{
|
{
|
||||||
if (game.area == MISN_ELAMALE)
|
if (game.area == MISN_ELAMALE)
|
||||||
{
|
{
|
||||||
if ((alien->shield <= alien->maxShield - ((game.difficulty != DIFFICULTY_ORIGINAL) ? 500 : 750)) &&
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
!(alien->flags & FL_LEAVESECTOR))
|
stage1_shield = KLINE_SHIELD_MEDIUM;
|
||||||
|
else
|
||||||
|
stage1_shield = KLINE_SHIELD_SMALL;
|
||||||
|
|
||||||
|
if ((alien->shield <= alien->maxShield - stage1_shield)
|
||||||
|
&& !(alien->flags & FL_LEAVESECTOR))
|
||||||
{
|
{
|
||||||
alien->flags |= FL_LEAVESECTOR;
|
alien->flags |= FL_LEAVESECTOR;
|
||||||
alien->flags &= ~FL_CIRCLES;
|
|
||||||
/// Dialog (Kline Kethlan)
|
/// Dialog (Kline Kethlan)
|
||||||
/// Used when Kline is beaten in the Elamale mission.
|
/// Used when Kline is beaten in the Elamale mission.
|
||||||
radio_setMessage(FS_KLINE, _("Seems I underestimated you, Bainfield. We'll meet again!"), 1);
|
radio_setMessage(FS_KLINE, _("Seems I underestimated you, Bainfield. We'll meet again!"), 1);
|
||||||
|
@ -2155,11 +2232,15 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
||||||
}
|
}
|
||||||
else if (game.area == MISN_EARTH)
|
else if (game.area == MISN_EARTH)
|
||||||
{
|
{
|
||||||
if ((alien->shield <= alien->maxShield - ((game.difficulty != DIFFICULTY_ORIGINAL) ? 750 : 500)) &&
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
!(alien->flags & FL_LEAVESECTOR))
|
stage1_shield = KLINE_SHIELD_SMALL;
|
||||||
|
else
|
||||||
|
stage1_shield = KLINE_SHIELD_MEDIUM;
|
||||||
|
|
||||||
|
if ((alien->shield <= alien->maxShield - stage1_shield)
|
||||||
|
&& !(alien->flags & FL_LEAVESECTOR))
|
||||||
{
|
{
|
||||||
alien->flags |= FL_LEAVESECTOR;
|
alien->flags |= FL_LEAVESECTOR;
|
||||||
alien->flags &= ~FL_CIRCLES;
|
|
||||||
/// Dialog (Sid Wilson)
|
/// Dialog (Sid Wilson)
|
||||||
/// Used when Kline is beaten in the Earth mission.
|
/// Used when Kline is beaten in the Earth mission.
|
||||||
radio_setMessage(FS_SID, _("Chris, Kethlan is getting away!"), 1);
|
radio_setMessage(FS_SID, _("Chris, Kethlan is getting away!"), 1);
|
||||||
|
@ -2167,33 +2248,60 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
||||||
}
|
}
|
||||||
else if (game.area == MISN_VENUS)
|
else if (game.area == MISN_VENUS)
|
||||||
{
|
{
|
||||||
if (alien->shield + damage > 1500 &&
|
stage1_shield = KLINE_STAGE1_SHIELD;
|
||||||
alien->shield <= 1500)
|
stage2_shield = KLINE_STAGE2_SHIELD;
|
||||||
|
stage3_shield = KLINE_STAGE3_SHIELD;
|
||||||
|
|
||||||
|
if (alien->shield + damage > stage1_shield
|
||||||
|
&& alien->shield <= stage1_shield)
|
||||||
|
{
|
||||||
alien_setKlineAttackMethod(alien);
|
alien_setKlineAttackMethod(alien);
|
||||||
else if (alien->shield + damage > 1000 &&
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
alien->shield <= 1000)
|
alien->shield = stage1_shield;
|
||||||
|
}
|
||||||
|
else if (alien->shield + damage > stage2_shield
|
||||||
|
&& alien->shield <= stage2_shield)
|
||||||
|
{
|
||||||
alien_setKlineAttackMethod(alien);
|
alien_setKlineAttackMethod(alien);
|
||||||
else if (alien->shield + damage > 500 &&
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
alien->shield <= 500)
|
alien->shield = stage2_shield;
|
||||||
|
}
|
||||||
|
else if (alien->shield + damage > stage3_shield
|
||||||
|
&& alien->shield <= stage3_shield)
|
||||||
|
{
|
||||||
alien_setKlineAttackMethod(alien);
|
alien_setKlineAttackMethod(alien);
|
||||||
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
|
alien->shield = stage3_shield;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((alien->shield <= alien->maxShield - 100) &&
|
stage1_shield = KLINE_SHIELD_TINY;
|
||||||
!(alien->flags & FL_LEAVESECTOR))
|
if ((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||||
|
&& (game.difficulty > DIFFICULTY_EASY))
|
||||||
{
|
{
|
||||||
alien->flags |= FL_LEAVESECTOR;
|
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
||||||
alien->flags &= ~FL_CIRCLES;
|
{
|
||||||
|
if (aliens[i].active && (i != ALIEN_KLINE)
|
||||||
|
&& (aliens[i].flags & FL_WEAPCO)
|
||||||
|
&& (aliens[i].shield > 0))
|
||||||
|
{
|
||||||
|
stage1_shield = KLINE_SHIELD_SMALL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((alien->shield <= alien->maxShield - stage1_shield)
|
||||||
|
&& !(alien->flags & FL_LEAVESECTOR))
|
||||||
|
alien->flags |= FL_LEAVESECTOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
run_chance = (game.difficulty == DIFFICULTY_ORIGINAL) ? 0.02 : damage / 50.;
|
run_chance = (game.difficulty == DIFFICULTY_ORIGINAL) ? 0.02 : damage / 50.;
|
||||||
|
|
||||||
if ((alien->flags & FL_RUNSAWAY) && CHANCE(run_chance))
|
if ((alien->flags & FL_RUNSAWAY) && CHANCE(run_chance))
|
||||||
{
|
|
||||||
alien->flags |= FL_LEAVESECTOR;
|
alien->flags |= FL_LEAVESECTOR;
|
||||||
}
|
|
||||||
|
|
||||||
audio_playSound(SFX_HIT, alien->x, alien->y);
|
audio_playSound(SFX_HIT, alien->x, alien->y);
|
||||||
if (ai_type == AI_EVASIVE)
|
if (ai_type == AI_EVASIVE)
|
||||||
|
@ -2212,7 +2320,5 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
||||||
}
|
}
|
||||||
|
|
||||||
alien->systemPower = 0;
|
alien->systemPower = 0;
|
||||||
if (alien->classDef == CD_KLINE)
|
|
||||||
alien->systemPower = alien->maxShield;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -26,9 +26,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
extern Object alien_defs[CD_MAX];
|
extern Object alien_defs[CD_MAX];
|
||||||
extern Object aliens[ALIEN_MAX];
|
extern Object aliens[ALIEN_MAX];
|
||||||
|
|
||||||
|
void alien_nerf(int index);
|
||||||
void alien_defs_init();
|
void alien_defs_init();
|
||||||
void aliens_init();
|
void aliens_init();
|
||||||
int alien_add();
|
int alien_add(int *spawnedMisnTarget);
|
||||||
void alien_addDrone(Object *hostAlien);
|
void alien_addDrone(Object *hostAlien);
|
||||||
void alien_addSmallAsteroid(Object *hostAlien);
|
void alien_addSmallAsteroid(Object *hostAlien);
|
||||||
void alien_addFriendly(int type);
|
void alien_addFriendly(int type);
|
||||||
|
|
97
src/audio.c
97
src/audio.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012 Guus Sliepen
|
Copyright (C) 2011, 2012 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include "structs.h"
|
#include "structs.h"
|
||||||
|
|
||||||
|
#include "alien.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
@ -66,7 +67,8 @@ void audio_playSound(int sid, float x, float y)
|
||||||
int angle = atanf((x - (screen->w / 2)) / (screen->w / 2)) * 180 / M_PI;
|
int angle = atanf((x - (screen->w / 2)) / (screen->w / 2)) * 180 / M_PI;
|
||||||
int attenuation = fabsf(x - (screen->w / 2)) / (screen->w / 20);
|
int attenuation = fabsf(x - (screen->w / 2)) / (screen->w / 20);
|
||||||
float distance = sqrtf(powf(fabsf(x - (screen->w / 2)), 2) + powf(fabsf(y - (screen->h / 2)), 2));
|
float distance = sqrtf(powf(fabsf(x - (screen->w / 2)), 2) + powf(fabsf(y - (screen->h / 2)), 2));
|
||||||
int volume = MIX_MAX_VOLUME - (MIX_MAX_VOLUME * distance / (3 * screen->w));
|
const int max_volume = MIX_MAX_VOLUME;
|
||||||
|
int volume = max_volume - (max_volume * distance / (3 * screen->w));
|
||||||
|
|
||||||
if ((!engine.useSound) || (!engine.useAudio) || (volume <= 0))
|
if ((!engine.useSound) || (!engine.useAudio) || (volume <= 0))
|
||||||
return;
|
return;
|
||||||
|
@ -109,8 +111,8 @@ void audio_playSound(int sid, float x, float y)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Mix_Playing(channel) && (volume <= MIX_MAX_VOLUME / 4) &&
|
if (Mix_Playing(channel) && (volume <= max_volume / 4)
|
||||||
(channelVolume[channel] >= MIX_MAX_VOLUME * 3 / 4))
|
&& (channelVolume[channel] >= max_volume * 3 / 4))
|
||||||
return;
|
return;
|
||||||
else
|
else
|
||||||
channelVolume[channel] = volume;
|
channelVolume[channel] = volume;
|
||||||
|
@ -169,6 +171,14 @@ void audio_setMusicVolume(int volume)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void audio_setMusicPosition(double position)
|
||||||
|
{
|
||||||
|
#ifndef NOSOUND
|
||||||
|
if (engine.useMusic && engine.useAudio)
|
||||||
|
Mix_SetMusicPosition(position);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void audio_playMusic(const char *filename, int loops)
|
void audio_playMusic(const char *filename, int loops)
|
||||||
{
|
{
|
||||||
#ifndef NOSOUND
|
#ifndef NOSOUND
|
||||||
|
@ -176,7 +186,7 @@ void audio_playMusic(const char *filename, int loops)
|
||||||
{
|
{
|
||||||
audio_haltMusic();
|
audio_haltMusic();
|
||||||
music = Mix_LoadMUS(filename);
|
music = Mix_LoadMUS(filename);
|
||||||
audio_setMusicVolume(100);
|
audio_setMusicVolume(MIX_MAX_VOLUME);
|
||||||
Mix_PlayMusic(music, loops);
|
Mix_PlayMusic(music, loops);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -188,25 +198,94 @@ void audio_playRandomTrack()
|
||||||
if ((!engine.useMusic) || (!engine.useAudio))
|
if ((!engine.useMusic) || (!engine.useAudio))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef OLD_MUSIC
|
||||||
|
int tracks = 0;
|
||||||
|
char track[][PATH_MAX] = {
|
||||||
|
"music/Frantic.mod", "music/Artificial.mod", "music/Lunatic.mod",
|
||||||
|
"music/ToxicFriend.mod", "music/DigitalInferno.mod",
|
||||||
|
"music/TempoTrance.mod", "music/IntoTheMachine.mod"
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (game.system)
|
||||||
|
{
|
||||||
|
case SYSTEM_SPIRIT:
|
||||||
|
tracks = 3;
|
||||||
|
break;
|
||||||
|
case SYSTEM_EYANANTH:
|
||||||
|
tracks = 5;
|
||||||
|
break;
|
||||||
|
case SYSTEM_MORDOR:
|
||||||
|
case SYSTEM_SOL:
|
||||||
|
tracks = 7;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tracks = 3;
|
||||||
|
}
|
||||||
|
#else
|
||||||
int tracks = 4;
|
int tracks = 4;
|
||||||
char track[][64] = {
|
char track[][PATH_MAX] = {
|
||||||
"music/railjet_short.ogg", "music/space_dimensions.ogg",
|
"music/railjet_short.ogg", "music/space_dimensions.ogg",
|
||||||
"music/frozen_jam.ogg", "music/sound_and_silence.ogg"
|
"music/frozen_jam.ogg", "music/sound_and_silence.ogg"
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
switch(game.area)
|
switch (game.area)
|
||||||
{
|
{
|
||||||
|
#ifndef OLD_MUSIC
|
||||||
case MISN_START:
|
case MISN_START:
|
||||||
audio_playMusic("music/railjet_short.ogg", -1);
|
case MISN_INTERCEPTION:
|
||||||
|
if ((aliens[ALIEN_KLINE].classDef == CD_KLINE)
|
||||||
|
&& aliens[ALIEN_KLINE].active)
|
||||||
|
audio_playMusic("music/last_cyber_dance.ogg", -1);
|
||||||
|
else if ((game.system == SYSTEM_MORDOR)
|
||||||
|
&& (aliens[ALIEN_BOSS].classDef == CD_CLOAKFIGHTER)
|
||||||
|
&& aliens[ALIEN_BOSS].active)
|
||||||
|
audio_playMusic("music/space_dimensions.ogg", -1);
|
||||||
|
else
|
||||||
|
audio_playMusic("music/railjet_short.ogg", -1);
|
||||||
break;
|
break;
|
||||||
|
case MISN_HAIL:
|
||||||
|
case MISN_JOLDAR:
|
||||||
|
case MISN_DORIM:
|
||||||
|
case MISN_SIVEDI:
|
||||||
|
case MISN_NEPTUNE:
|
||||||
|
case MISN_SATURN:
|
||||||
|
audio_playMusic("music/frozen_jam.ogg", -1);
|
||||||
|
break;
|
||||||
|
case MISN_CERADSE:
|
||||||
|
case MISN_ALLEZ:
|
||||||
|
case MISN_URUSOR:
|
||||||
|
case MISN_FELLON:
|
||||||
|
case MISN_POSWIC:
|
||||||
|
case MISN_MARS:
|
||||||
|
audio_playMusic("music/sound_and_silence.ogg", -1);
|
||||||
|
break;
|
||||||
|
case MISN_HINSTAG:
|
||||||
|
case MISN_NEROD:
|
||||||
|
case MISN_ODEON:
|
||||||
|
case MISN_ALMARTHA:
|
||||||
|
case MISN_PLUTO:
|
||||||
|
case MISN_URANUS:
|
||||||
|
case MISN_JUPITER:
|
||||||
|
audio_playMusic("music/space_dimensions.ogg", -1);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case MISN_MOEBO:
|
case MISN_MOEBO:
|
||||||
case MISN_ELAMALE:
|
case MISN_ELAMALE:
|
||||||
case MISN_ELLESH:
|
case MISN_ELLESH:
|
||||||
case MISN_EARTH:
|
case MISN_EARTH:
|
||||||
|
#ifdef OLD_MUSIC
|
||||||
|
audio_playMusic("music/HardTranceDub.mod", -1);
|
||||||
|
#else
|
||||||
audio_playMusic("music/orbital_colossus.ogg", -1);
|
audio_playMusic("music/orbital_colossus.ogg", -1);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case MISN_VENUS:
|
case MISN_VENUS:
|
||||||
audio_playMusic("music/RE.ogg", -1);
|
#ifdef OLD_MUSIC
|
||||||
|
audio_playMusic("music/LoopsAndTings.mod", -1);
|
||||||
|
#else
|
||||||
|
audio_playMusic("music/androids_last_dance.ogg", -1);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
audio_playMusic(track[rand() % tracks], -1);
|
audio_playMusic(track[rand() % tracks], -1);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012 Guus Sliepen
|
Copyright (C) 2011, 2012 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -29,6 +29,7 @@ void audio_haltMusic();
|
||||||
void audio_pauseMusic();
|
void audio_pauseMusic();
|
||||||
void audio_resumeMusic();
|
void audio_resumeMusic();
|
||||||
void audio_setMusicVolume(int volume);
|
void audio_setMusicVolume(int volume);
|
||||||
|
void audio_setMusicPosition(double position);
|
||||||
void audio_playMusic(const char *filename, int loops);
|
void audio_playMusic(const char *filename, int loops);
|
||||||
void audio_playRandomTrack();
|
void audio_playRandomTrack();
|
||||||
void audio_free();
|
void audio_free();
|
||||||
|
|
24
src/bullet.c
24
src/bullet.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012 Guus Sliepen
|
Copyright (C) 2011, 2012 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -33,6 +33,7 @@ void bullet_add(Object *theWeapon, Object *attacker, int y, int dy)
|
||||||
Object *bullet;
|
Object *bullet;
|
||||||
int imageIndex;
|
int imageIndex;
|
||||||
int tempX, tempY, steps;
|
int tempX, tempY, steps;
|
||||||
|
int min_damage;
|
||||||
|
|
||||||
bullet = malloc(sizeof(*bullet));
|
bullet = malloc(sizeof(*bullet));
|
||||||
if (bullet == NULL)
|
if (bullet == NULL)
|
||||||
|
@ -59,8 +60,8 @@ void bullet_add(Object *theWeapon, Object *attacker, int y, int dy)
|
||||||
if (attacker->face == 0)
|
if (attacker->face == 0)
|
||||||
{
|
{
|
||||||
bullet->dx = theWeapon->speed;
|
bullet->dx = theWeapon->speed;
|
||||||
if ((game.area == MISN_ELLESH) ||
|
if ((game.area == MISN_ELLESH)
|
||||||
(game.area == MISN_MARS))
|
|| (game.area == MISN_MARS))
|
||||||
bullet->dx += fabsf(engine.ssx + engine.smx);
|
bullet->dx += fabsf(engine.ssx + engine.smx);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -93,14 +94,29 @@ void bullet_add(Object *theWeapon, Object *attacker, int y, int dy)
|
||||||
|
|
||||||
bullet->damage = theWeapon->damage;
|
bullet->damage = theWeapon->damage;
|
||||||
|
|
||||||
|
// Adjustments to damage for Classic difficulty (to match original)
|
||||||
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
|
{
|
||||||
|
if (bullet->id == WT_MICROROCKET)
|
||||||
|
bullet->damage = 3;
|
||||||
|
else if (bullet->id == WT_SPREAD)
|
||||||
|
bullet->damage = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (bullet->id == WT_CHARGER)
|
if (bullet->id == WT_CHARGER)
|
||||||
{
|
{
|
||||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
|
{
|
||||||
bullet->damage = attacker->ammo[1];
|
bullet->damage = attacker->ammo[1];
|
||||||
|
min_damage = 50;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
bullet->damage = attacker->ammo[1] / 2;
|
bullet->damage = attacker->ammo[1] / 2;
|
||||||
|
min_damage = 15;
|
||||||
|
}
|
||||||
|
|
||||||
if (bullet->damage < 15)
|
if (bullet->damage < min_damage)
|
||||||
{
|
{
|
||||||
bullet->damage = 1;
|
bullet->damage = 1;
|
||||||
bullet->id = WT_PLASMA;
|
bullet->id = WT_PLASMA;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012 Guus Sliepen
|
Copyright (C) 2011, 2012 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -40,17 +40,18 @@ void collectable_add(float x, float y, int type, int value, int life)
|
||||||
Collectable *collectable;
|
Collectable *collectable;
|
||||||
int plasma_useless, shield_useless, rockets_useless;
|
int plasma_useless, shield_useless, rockets_useless;
|
||||||
|
|
||||||
plasma_useless = (((weapons[W_PLAYER_WEAPON].reload[0] >= rate2reload[game.minPlasmaRate]) &&
|
plasma_useless = (((weapons[W_PLAYER_WEAPON].reload[0] >= rate2reload[game.minPlasmaRate])
|
||||||
(weapons[W_PLAYER_WEAPON].ammo[0] <= game.minPlasmaOutput) &&
|
&& (weapons[W_PLAYER_WEAPON].ammo[0] <= game.minPlasmaOutput)
|
||||||
(weapons[W_PLAYER_WEAPON].damage <= game.minPlasmaDamage)) ||
|
&& (weapons[W_PLAYER_WEAPON].damage <= game.minPlasmaDamage))
|
||||||
(player.ammo[0] >= game.maxPlasmaAmmo));
|
|| (player.ammo[0] >= game.maxPlasmaAmmo));
|
||||||
|
|
||||||
shield_useless = ((game.difficulty == DIFFICULTY_NIGHTMARE) ||
|
shield_useless = ((game.difficulty == DIFFICULTY_NIGHTMARE)
|
||||||
(player.shield >= player.maxShield));
|
|| (player.shield >= player.maxShield));
|
||||||
|
|
||||||
rockets_useless = ((player.weaponType[1] == W_CHARGER) ||
|
rockets_useless = ((player.weaponType[1] == W_CHARGER)
|
||||||
(player.weaponType[1] == W_LASER) || (game.maxRocketAmmo <= 0) ||
|
|| (player.weaponType[1] == W_LASER)
|
||||||
(player.ammo[1] >= game.maxRocketAmmo));
|
|| (game.maxRocketAmmo <= 0)
|
||||||
|
|| (player.ammo[1] >= game.maxRocketAmmo));
|
||||||
|
|
||||||
if (type == P_ANYTHING)
|
if (type == P_ANYTHING)
|
||||||
{
|
{
|
||||||
|
@ -61,21 +62,22 @@ void collectable_add(float x, float y, int type, int value, int life)
|
||||||
switch (r)
|
switch (r)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if ((game.difficulty == DIFFICULTY_ORIGINAL) ||
|
if ((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
(game.difficulty == DIFFICULTY_NIGHTMARE))
|
|| (game.difficulty == DIFFICULTY_NIGHTMARE))
|
||||||
{
|
{
|
||||||
type = P_PLASMA_AMMO;
|
type = P_PLASMA_AMMO;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((!shield_useless) &&
|
if ((!shield_useless)
|
||||||
(CHANCE(2 * (player.maxShield - player.shield) / player.maxShield)))
|
&& (CHANCE(2 * (player.maxShield - player.shield) / player.maxShield)))
|
||||||
{
|
{
|
||||||
type = P_SHIELD;
|
type = P_SHIELD;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ((!rockets_useless) && (game.maxRocketAmmo > 0) &&
|
else if ((!rockets_useless)
|
||||||
(CHANCE((game.maxRocketAmmo - player.ammo[1]) / game.maxRocketAmmo)))
|
&& (game.maxRocketAmmo > 0)
|
||||||
|
&& (CHANCE((game.maxRocketAmmo - player.ammo[1]) / game.maxRocketAmmo)))
|
||||||
{
|
{
|
||||||
type = P_ROCKET;
|
type = P_ROCKET;
|
||||||
}
|
}
|
||||||
|
@ -91,20 +93,21 @@ void collectable_add(float x, float y, int type, int value, int life)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
if ((game.difficulty == DIFFICULTY_ORIGINAL) ||
|
if ((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
(game.difficulty == DIFFICULTY_NIGHTMARE))
|
|| (game.difficulty == DIFFICULTY_NIGHTMARE))
|
||||||
{
|
{
|
||||||
type = P_ROCKET;
|
type = P_ROCKET;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((!shield_useless) &&
|
if ((!shield_useless)
|
||||||
(CHANCE(2 * (player.maxShield - player.shield) / player.maxShield)))
|
&& (CHANCE(2 * (player.maxShield - player.shield) / player.maxShield)))
|
||||||
{
|
{
|
||||||
type = P_SHIELD;
|
type = P_SHIELD;
|
||||||
}
|
}
|
||||||
else if ((!plasma_useless) && (game.maxPlasmaAmmo > 0) &&
|
else if ((!plasma_useless)
|
||||||
(CHANCE((game.maxPlasmaAmmo - player.ammo[0]) / game.maxPlasmaAmmo)))
|
&& (game.maxPlasmaAmmo > 0)
|
||||||
|
&& (CHANCE((game.maxPlasmaAmmo - player.ammo[0]) / game.maxPlasmaAmmo)))
|
||||||
{
|
{
|
||||||
type = P_PLASMA_AMMO;
|
type = P_PLASMA_AMMO;
|
||||||
}
|
}
|
||||||
|
@ -120,13 +123,13 @@ void collectable_add(float x, float y, int type, int value, int life)
|
||||||
{
|
{
|
||||||
type = P_PLASMA_RATE;
|
type = P_PLASMA_RATE;
|
||||||
|
|
||||||
if ((game.difficulty == DIFFICULTY_NIGHTMARE) ||
|
if ((game.difficulty == DIFFICULTY_NIGHTMARE)
|
||||||
((game.difficulty != DIFFICULTY_EASY) &&
|
|| ((game.difficulty > DIFFICULTY_EASY)
|
||||||
(game.difficulty != DIFFICULTY_ORIGINAL) &&
|
&& (game.difficulty != DIFFICULTY_ORIGINAL)
|
||||||
((game.area == MISN_MOEBO) ||
|
&& ((game.area == MISN_MOEBO)
|
||||||
(game.area == MISN_ELAMALE) ||
|
|| (game.area == MISN_ELAMALE)
|
||||||
(game.area == MISN_ELLESH) ||
|
|| (game.area == MISN_ELLESH)
|
||||||
(game.area == MISN_EARTH))))
|
|| (game.area == MISN_EARTH))))
|
||||||
{
|
{
|
||||||
// Deny the Super Charge in Nightmare difficulty, and on bosses.
|
// Deny the Super Charge in Nightmare difficulty, and on bosses.
|
||||||
r = rand() % 59;
|
r = rand() % 59;
|
||||||
|
@ -150,6 +153,10 @@ void collectable_add(float x, float y, int type, int value, int life)
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
return; // don't bother!
|
return; // don't bother!
|
||||||
|
|
||||||
|
if ((game.difficulty == DIFFICULTY_SUPEREASY)
|
||||||
|
&& (type != P_CARGO))
|
||||||
|
value *= 2;
|
||||||
|
|
||||||
// No point in giving the player plasma ammo if the weapons aren't
|
// No point in giving the player plasma ammo if the weapons aren't
|
||||||
// upgraded! Give them money instead. (Except in Classic difficulty.)
|
// upgraded! Give them money instead. (Except in Classic difficulty.)
|
||||||
if ((type == P_PLASMA_AMMO) && (game.difficulty != DIFFICULTY_ORIGINAL))
|
if ((type == P_PLASMA_AMMO) && (game.difficulty != DIFFICULTY_ORIGINAL))
|
||||||
|
@ -164,9 +171,9 @@ void collectable_add(float x, float y, int type, int value, int life)
|
||||||
// rockets. Causes problems otherwise :)
|
// rockets. Causes problems otherwise :)
|
||||||
if (type == P_ROCKET)
|
if (type == P_ROCKET)
|
||||||
{
|
{
|
||||||
if ((player.weaponType[1] == W_CHARGER) ||
|
if ((player.weaponType[1] == W_CHARGER)
|
||||||
(player.weaponType[1] == W_LASER) ||
|
|| (player.weaponType[1] == W_LASER)
|
||||||
(value < 10))
|
|| (value < 10))
|
||||||
{
|
{
|
||||||
type = P_CASH;
|
type = P_CASH;
|
||||||
}
|
}
|
||||||
|
@ -179,8 +186,8 @@ void collectable_add(float x, float y, int type, int value, int life)
|
||||||
// Shield bonus is useless if you can't heal; give cash instead.
|
// Shield bonus is useless if you can't heal; give cash instead.
|
||||||
if ((type == P_SHIELD) && (game.difficulty != DIFFICULTY_ORIGINAL))
|
if ((type == P_SHIELD) && (game.difficulty != DIFFICULTY_ORIGINAL))
|
||||||
{
|
{
|
||||||
if ((game.difficulty == DIFFICULTY_NIGHTMARE) ||
|
if ((game.difficulty == DIFFICULTY_NIGHTMARE)
|
||||||
(player.shield >= player.maxShield))
|
|| (player.shield >= player.maxShield))
|
||||||
{
|
{
|
||||||
type = P_CASH;
|
type = P_CASH;
|
||||||
}
|
}
|
||||||
|
@ -196,11 +203,12 @@ void collectable_add(float x, float y, int type, int value, int life)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (game.difficulty != DIFFICULTY_SUPEREASY)
|
||||||
{
|
{
|
||||||
// No cash or ammo on interceptions. Completely stops grinding.
|
// No cash or ammo on interceptions. Completely stops grinding.
|
||||||
if ((game.area == MISN_INTERCEPTION) &&
|
if ((game.area == MISN_INTERCEPTION)
|
||||||
((type == P_CASH) || (type == P_PLASMA_AMMO) || (type == P_ROCKET)))
|
&& ((type == P_CASH) || (type == P_PLASMA_AMMO)
|
||||||
|
|| (type == P_ROCKET)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -329,24 +337,27 @@ int collectable_numGood()
|
||||||
|
|
||||||
while (col != NULL)
|
while (col != NULL)
|
||||||
{
|
{
|
||||||
if ((col->type != P_MINE) && (col->type != P_ORE) &&
|
if ((col->type != P_MINE) && (col->type != P_ORE)
|
||||||
((col->type != P_SHIELD) || (player.shield < player.maxShield)) &&
|
&& ((col->type != P_SHIELD)
|
||||||
((col->type != P_ROCKET) || (player.ammo[1] < game.maxRocketAmmo)) &&
|
|| (player.shield < player.maxShield))
|
||||||
((col->type != P_PLASMA_AMMO) || (player.ammo[0] < game.maxPlasmaAmmo)) &&
|
&& ((col->type != P_ROCKET)
|
||||||
((col->type != P_PLASMA_SHOT) ||
|
|| (player.ammo[1] < game.maxRocketAmmo))
|
||||||
(player.ammo[0] < game.maxPlasmaAmmo) ||
|
&& ((col->type != P_PLASMA_AMMO)
|
||||||
(weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput)) &&
|
|| (player.ammo[0] < game.maxPlasmaAmmo))
|
||||||
((col->type != P_PLASMA_DAMAGE) ||
|
&& ((col->type != P_PLASMA_SHOT)
|
||||||
(player.ammo[0] < game.maxPlasmaAmmo) ||
|
|| (player.ammo[0] < game.maxPlasmaAmmo)
|
||||||
(weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage)) &&
|
|| (weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput))
|
||||||
((col->type != P_PLASMA_RATE) ||
|
&& ((col->type != P_PLASMA_DAMAGE)
|
||||||
(player.ammo[0] < game.maxPlasmaAmmo) ||
|
|| (player.ammo[0] < game.maxPlasmaAmmo)
|
||||||
(weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate])) &&
|
|| (weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage))
|
||||||
((col->type != P_SUPER) ||
|
&& ((col->type != P_PLASMA_RATE)
|
||||||
(player.ammo[0] < game.maxPlasmaAmmo) ||
|
|| (player.ammo[0] < game.maxPlasmaAmmo)
|
||||||
(weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput) ||
|
|| (weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate]))
|
||||||
(weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage) ||
|
&& ((col->type != P_SUPER)
|
||||||
(weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate])))
|
|| (player.ammo[0] < game.maxPlasmaAmmo)
|
||||||
|
|| (weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput)
|
||||||
|
|| (weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage)
|
||||||
|
|| (weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate])))
|
||||||
{
|
{
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2012, 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -88,7 +88,7 @@ void cutscene_init(int scene)
|
||||||
aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
|
aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
|
||||||
aliens[0].x = screen->w * 3 / 5;
|
aliens[0].x = screen->w * 3 / 5;
|
||||||
aliens[0].y = screen->h / 2;
|
aliens[0].y = screen->h / 2;
|
||||||
aliens[0].dx = 3.1;
|
aliens[0].dx = 3.05;
|
||||||
aliens[0].active = 1;
|
aliens[0].active = 1;
|
||||||
|
|
||||||
for (int i = 1 ; i < 7 ; i++)
|
for (int i = 1 ; i < 7 ; i++)
|
||||||
|
@ -162,7 +162,7 @@ void cutscene_init(int scene)
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
gfx_loadBackground("gfx/spirit.jpg");
|
gfx_loadBackground("gfx/spirit.jpg");
|
||||||
engine.ssx = -1.4;
|
engine.ssx = -1.45;
|
||||||
engine.ssy = 0;
|
engine.ssy = 0;
|
||||||
|
|
||||||
aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
|
aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
|
||||||
|
@ -254,7 +254,7 @@ void cutscene_init(int scene)
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
gfx_loadBackground("gfx/eyananth.jpg");
|
gfx_loadBackground("gfx/eyananth.jpg");
|
||||||
engine.ssx = -1.4;
|
engine.ssx = -1.45;
|
||||||
engine.ssy = 0;
|
engine.ssy = 0;
|
||||||
|
|
||||||
aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
|
aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
|
||||||
|
@ -360,7 +360,7 @@ void cutscene_init(int scene)
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
gfx_loadBackground("gfx/mordor.jpg");
|
gfx_loadBackground("gfx/mordor.jpg");
|
||||||
engine.ssx = -1.4;
|
engine.ssx = -1.45;
|
||||||
engine.ssy = 0;
|
engine.ssy = 0;
|
||||||
|
|
||||||
aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
|
aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
|
||||||
|
@ -446,7 +446,7 @@ void cutscene_init(int scene)
|
||||||
if (scene == 0 && i > 0 && (timer % 15) == i) {
|
if (scene == 0 && i > 0 && (timer % 15) == i) {
|
||||||
aliens[i].dx += (DRAND - 0.5) * 0.1;
|
aliens[i].dx += (DRAND - 0.5) * 0.1;
|
||||||
aliens[i].dy += (DRAND - 0.5) * 0.1;
|
aliens[i].dy += (DRAND - 0.5) * 0.1;
|
||||||
if (aliens[i].x > 500 - timer)
|
if (aliens[i].x > 500 - (timer % 480))
|
||||||
aliens[i].dx -= 0.2;
|
aliens[i].dx -= 0.2;
|
||||||
if (aliens[i].x < 0)
|
if (aliens[i].x < 0)
|
||||||
aliens[i].dx += 0.2;
|
aliens[i].dx += 0.2;
|
||||||
|
@ -468,13 +468,13 @@ void cutscene_init(int scene)
|
||||||
}
|
}
|
||||||
|
|
||||||
timer--;
|
timer--;
|
||||||
if (timer == 0)
|
if (timer <= 0)
|
||||||
{
|
{
|
||||||
showMessage = !showMessage;
|
showMessage = !showMessage;
|
||||||
timer = 120;
|
timer = 30;
|
||||||
if (showMessage)
|
if (showMessage)
|
||||||
{
|
{
|
||||||
timer = 60 * 7;
|
timer = engine.radioLife * 2;
|
||||||
currentMessage++;
|
currentMessage++;
|
||||||
|
|
||||||
if (currentMessage == 10)
|
if (currentMessage == 10)
|
||||||
|
@ -498,8 +498,14 @@ void cutscene_init(int scene)
|
||||||
|
|
||||||
game_delayFrame();
|
game_delayFrame();
|
||||||
|
|
||||||
if ((engine.keyState[KEY_ESCAPE]) || (engine.keyState[KEY_FIRE]) ||
|
if ((engine.keyState[KEY_FIRE]) || (engine.keyState[KEY_ALTFIRE]))
|
||||||
(engine.keyState[KEY_ALTFIRE]))
|
{
|
||||||
|
timer = 0;
|
||||||
|
engine.keyState[KEY_FIRE] = 0;
|
||||||
|
engine.keyState[KEY_ALTFIRE] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (engine.keyState[KEY_ESCAPE])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012 Guus Sliepen
|
Copyright (C) 2011, 2012 Guus Sliepen
|
||||||
Copyright (C) 2012, 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
42
src/defs.h
42
src/defs.h
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012 Guus Sliepen
|
Copyright (C) 2011, 2012 Guus Sliepen
|
||||||
Copyright (C) 2012, 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -29,10 +29,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#define WRAP_ADD(x, y, a, b) x = (((x) + (y)) + \
|
#define WRAP_ADD(x, y, a, b) x = (((x) + (y)) + \
|
||||||
((x) + (y) < (a) ? ((b) - (a)) : 0) + \
|
((x) + (y) < (a) ? ((b) - (a)) : 0) + \
|
||||||
((x) + (y) > (b) ? ((a) - (b)) : 0))
|
((x) + (y) > (b) ? ((a) - (b)) : 0))
|
||||||
#define CHANCE(x) ((rand() % RAND_MAX) < ((x) * RAND_MAX))
|
#define CHANCE(x) (((double)rand() / ((double)RAND_MAX+1)) < (x))
|
||||||
#define RANDRANGE(x, y) (((x) < (y)) ? ((x) + (rand() % (long)(1 + (y) - (x)))) : (x))
|
#define RANDRANGE(x, y) (((x) < (y)) ? \
|
||||||
|
((x) + (rand() % (long)(1 + (y) - (x)))) : (x))
|
||||||
#define DRAND ((double)rand() / RAND_MAX)
|
#define DRAND ((double)rand() / RAND_MAX)
|
||||||
#define _(s) gettext(s)
|
#define _(s) gettext(s)
|
||||||
|
#define CSDLP(x) (((x) == SDL_PRESSED) ? 1 : 0)
|
||||||
|
|
||||||
// A soft dependency defines these as well, so check if they are
|
// A soft dependency defines these as well, so check if they are
|
||||||
// defined before defining (avoids compiler warnings)
|
// defined before defining (avoids compiler warnings)
|
||||||
|
@ -103,6 +105,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#define BRIEFING_WIDTH 520
|
#define BRIEFING_WIDTH 520
|
||||||
|
|
||||||
|
#define JS_DEADZONE 0.05
|
||||||
|
#define JS_MAX (32767 - JS_DEADZONE*32767)
|
||||||
|
|
||||||
|
#define KLINE_STAGE1_SHIELD (aliens[ALIEN_KLINE].maxShield * 3 / 4)
|
||||||
|
#define KLINE_STAGE2_SHIELD (aliens[ALIEN_KLINE].maxShield / 2)
|
||||||
|
#define KLINE_STAGE3_SHIELD (aliens[ALIEN_KLINE].maxShield / 4)
|
||||||
|
#define KLINE_SHIELD_TINY (aliens[ALIEN_KLINE].maxShield / 20)
|
||||||
|
#define KLINE_SHIELD_SMALL (aliens[ALIEN_KLINE].maxShield / 4)
|
||||||
|
#define KLINE_SHIELD_MEDIUM (aliens[ALIEN_KLINE].maxShield * 3 / 8)
|
||||||
|
|
||||||
|
// Radio life/speed
|
||||||
|
#define RADIO_LIFE_INSTANT 60
|
||||||
|
#define RADIO_LIFE_FAST 120
|
||||||
|
#define RADIO_LIFE_NORMAL 240
|
||||||
|
#define RADIO_LIFE_SLOW 360
|
||||||
|
#define RADIO_LIFE_SLOTH 480
|
||||||
|
#define DEFAULT_RADIO_LIFE RADIO_LIFE_NORMAL
|
||||||
|
|
||||||
// Object Flags
|
// Object Flags
|
||||||
#define FL_WEAPCO (1L << 0)
|
#define FL_WEAPCO (1L << 0)
|
||||||
#define FL_FRIEND (1L << 1)
|
#define FL_FRIEND (1L << 1)
|
||||||
|
@ -536,8 +556,10 @@ enum {
|
||||||
// Text sprites
|
// Text sprites
|
||||||
enum {
|
enum {
|
||||||
// Main menu
|
// Main menu
|
||||||
TS_PRESENTS = MAX_INFOLINES,
|
TS_DILIGENTCIRCLE = MAX_INFOLINES,
|
||||||
|
TS_PRESENTS,
|
||||||
TS_AN_SDL_GAME,
|
TS_AN_SDL_GAME,
|
||||||
|
TS_ORIGINALLY_BY,
|
||||||
TS_START_NEW_GAME,
|
TS_START_NEW_GAME,
|
||||||
TS_LOAD_GAME,
|
TS_LOAD_GAME,
|
||||||
TS_CONTINUE_CURRENT_GAME,
|
TS_CONTINUE_CURRENT_GAME,
|
||||||
|
@ -549,6 +571,7 @@ enum {
|
||||||
TS_MUSIC,
|
TS_MUSIC,
|
||||||
TS_FULLSCREEN,
|
TS_FULLSCREEN,
|
||||||
TS_AUTOPAUSE,
|
TS_AUTOPAUSE,
|
||||||
|
TS_RADIO_SPEED,
|
||||||
TS_BACK_TO_MAIN_MENU,
|
TS_BACK_TO_MAIN_MENU,
|
||||||
TS_SAVESLOT_0,
|
TS_SAVESLOT_0,
|
||||||
TS_SAVESLOT_1,
|
TS_SAVESLOT_1,
|
||||||
|
@ -794,7 +817,8 @@ enum {
|
||||||
|
|
||||||
// Difficulties
|
// Difficulties
|
||||||
enum {
|
enum {
|
||||||
DIFFICULTY_EASY = 0,
|
DIFFICULTY_SUPEREASY = 0,
|
||||||
|
DIFFICULTY_EASY,
|
||||||
DIFFICULTY_NORMAL,
|
DIFFICULTY_NORMAL,
|
||||||
DIFFICULTY_HARD,
|
DIFFICULTY_HARD,
|
||||||
DIFFICULTY_NIGHTMARE,
|
DIFFICULTY_NIGHTMARE,
|
||||||
|
@ -802,6 +826,14 @@ enum {
|
||||||
DIFFICULTY_MAX
|
DIFFICULTY_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Engine state values (used for engine.done)
|
||||||
|
enum {
|
||||||
|
ENGINE_RUNNING = 0,
|
||||||
|
ENGINE_CLOSING,
|
||||||
|
ENGINE_SYSEXIT,
|
||||||
|
ENGINE_FORMATION
|
||||||
|
};
|
||||||
|
|
||||||
extern const char * const systemBackground[];
|
extern const char * const systemBackground[];
|
||||||
extern const int rate2reload[6];
|
extern const int rate2reload[6];
|
||||||
|
|
||||||
|
|
84
src/engine.c
84
src/engine.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -56,7 +56,7 @@ Engine engine;
|
||||||
|
|
||||||
void engine_init()
|
void engine_init()
|
||||||
{
|
{
|
||||||
engine.musicVolume = 100;
|
engine.musicVolume = MIX_MAX_VOLUME;
|
||||||
engine.useAudio = 1;
|
engine.useAudio = 1;
|
||||||
|
|
||||||
engine.maxAliens = 9;
|
engine.maxAliens = 9;
|
||||||
|
@ -103,6 +103,9 @@ void engine_init()
|
||||||
for (int i = 0; i < KEY_LAST; i++)
|
for (int i = 0; i < KEY_LAST; i++)
|
||||||
engine.keyState[i] = 0;
|
engine.keyState[i] = 0;
|
||||||
|
|
||||||
|
engine.xaxis = 0;
|
||||||
|
engine.yaxis = 0;
|
||||||
|
|
||||||
engine.eventTimer = 0;
|
engine.eventTimer = 0;
|
||||||
engine.counter2 = 0;
|
engine.counter2 = 0;
|
||||||
engine.timeTaken = 0;
|
engine.timeTaken = 0;
|
||||||
|
@ -255,22 +258,27 @@ This sets up the video and sound system, and creates Starfighter's window.
|
||||||
*/
|
*/
|
||||||
void engine_setMode()
|
void engine_setMode()
|
||||||
{
|
{
|
||||||
strcpy(engine.configDirectory, "");
|
|
||||||
|
|
||||||
engine_setupConfigDirectory();
|
|
||||||
|
|
||||||
/* Initialize the SDL library */
|
|
||||||
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK) < 0)
|
|
||||||
{
|
|
||||||
printf("Couldn't initialize SDL: %s\n", SDL_GetError());
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
char filename[PATH_MAX];
|
char filename[PATH_MAX];
|
||||||
int fullScreen = 0;
|
int fullScreen = 0;
|
||||||
int useSound = 1;
|
int useSound = 1;
|
||||||
int useMusic = 1;
|
int useMusic = 1;
|
||||||
int autoPause = 0;
|
int autoPause = 0;
|
||||||
|
int radioLife = DEFAULT_RADIO_LIFE;
|
||||||
|
char lang[STRMAX_SHORT];
|
||||||
|
int i;
|
||||||
|
|
||||||
|
strcpy(lang, "default");
|
||||||
|
|
||||||
|
strcpy(engine.configDirectory, "");
|
||||||
|
|
||||||
|
engine_setupConfigDirectory();
|
||||||
|
|
||||||
|
/* Initialize the SDL library */
|
||||||
|
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK|SDL_INIT_GAMECONTROLLER) < 0)
|
||||||
|
{
|
||||||
|
printf("Couldn't initialize SDL: %s\n", SDL_GetError());
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
snprintf(filename, PATH_MAX, "%sconf", engine.configDirectory);
|
snprintf(filename, PATH_MAX, "%sconf", engine.configDirectory);
|
||||||
|
@ -278,7 +286,9 @@ void engine_setMode()
|
||||||
|
|
||||||
if (fp != NULL)
|
if (fp != NULL)
|
||||||
{
|
{
|
||||||
if (fscanf(fp, "%d %d %d %d", &fullScreen, &useSound, &useMusic, &autoPause) < 4)
|
if (fscanf(fp, "%d %d %d %d %d%*c%[^\n]",
|
||||||
|
&fullScreen, &useSound, &useMusic, &autoPause,
|
||||||
|
&radioLife, lang) < 6)
|
||||||
printf("Warning: Config file \"%s\" is not correctly formatted\n", filename);
|
printf("Warning: Config file \"%s\" is not correctly formatted\n", filename);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
@ -287,6 +297,8 @@ void engine_setMode()
|
||||||
engine.useSound = useSound;
|
engine.useSound = useSound;
|
||||||
engine.useMusic = useMusic;
|
engine.useMusic = useMusic;
|
||||||
engine.autoPause = autoPause;
|
engine.autoPause = autoPause;
|
||||||
|
engine.radioLife = radioLife;
|
||||||
|
strcpy(engine.lang, lang);
|
||||||
|
|
||||||
screen_adjustDimensions(DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT);
|
screen_adjustDimensions(DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT);
|
||||||
|
|
||||||
|
@ -307,7 +319,7 @@ void engine_setMode()
|
||||||
#ifndef NOSOUND
|
#ifndef NOSOUND
|
||||||
if (engine.useAudio)
|
if (engine.useAudio)
|
||||||
{
|
{
|
||||||
if (Mix_OpenAudio(44100, AUDIO_S16, 2, 1024) < 0)
|
if (Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 1024) < 0)
|
||||||
{
|
{
|
||||||
printf("Warning: Couldn't set 44100 Hz 16-bit stereo audio - Reason:\n%s\n", Mix_GetError());
|
printf("Warning: Couldn't set 44100 Hz 16-bit stereo audio - Reason:\n%s\n", Mix_GetError());
|
||||||
printf("Sound and Music will be disabled\n");
|
printf("Sound and Music will be disabled\n");
|
||||||
|
@ -319,8 +331,29 @@ void engine_setMode()
|
||||||
SDL_ShowCursor(SDL_DISABLE);
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
SDL_EventState(SDL_MOUSEMOTION, SDL_DISABLE);
|
SDL_EventState(SDL_MOUSEMOTION, SDL_DISABLE);
|
||||||
|
|
||||||
SDL_JoystickEventState(SDL_ENABLE);
|
// Determine if the GameController API can be used
|
||||||
SDL_JoystickOpen(0);
|
engine.useController = 1;
|
||||||
|
for (i=0; i<SDL_NumJoysticks(); i++) {
|
||||||
|
if (!SDL_IsGameController(i)) {
|
||||||
|
engine.useController = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (engine.useController) {
|
||||||
|
SDL_GameControllerEventState(SDL_ENABLE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SDL_JoystickEventState(SDL_ENABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Open controllers
|
||||||
|
for (i=0; i<SDL_NumJoysticks(); i++) {
|
||||||
|
if (engine.useController)
|
||||||
|
SDL_GameControllerOpen(i);
|
||||||
|
else
|
||||||
|
SDL_JoystickOpen(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void engine_setFullscreen(int value)
|
void engine_setFullscreen(int value)
|
||||||
|
@ -343,7 +376,7 @@ void engine_resetLists()
|
||||||
LinkedRect *r1, *r2;
|
LinkedRect *r1, *r2;
|
||||||
|
|
||||||
ob = engine.bulletHead->next;
|
ob = engine.bulletHead->next;
|
||||||
while(ob != NULL)
|
while (ob != NULL)
|
||||||
{
|
{
|
||||||
ob2 = ob;
|
ob2 = ob;
|
||||||
ob = ob->next;
|
ob = ob->next;
|
||||||
|
@ -353,7 +386,7 @@ void engine_resetLists()
|
||||||
engine.bulletTail = engine.bulletHead;
|
engine.bulletTail = engine.bulletHead;
|
||||||
|
|
||||||
ob = engine.explosionHead->next;
|
ob = engine.explosionHead->next;
|
||||||
while(ob != NULL)
|
while (ob != NULL)
|
||||||
{
|
{
|
||||||
ob2 = ob;
|
ob2 = ob;
|
||||||
ob = ob->next;
|
ob = ob->next;
|
||||||
|
@ -385,7 +418,7 @@ void engine_resetLists()
|
||||||
screen_bufferTail = screen_bufferHead;
|
screen_bufferTail = screen_bufferHead;
|
||||||
|
|
||||||
ob = engine.debrisHead->next;
|
ob = engine.debrisHead->next;
|
||||||
while(ob != NULL)
|
while (ob != NULL)
|
||||||
{
|
{
|
||||||
ob2 = ob;
|
ob2 = ob;
|
||||||
ob = ob->next;
|
ob = ob->next;
|
||||||
|
@ -402,6 +435,8 @@ atexit();
|
||||||
*/
|
*/
|
||||||
void engine_cleanup()
|
void engine_cleanup()
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
gfx_free();
|
gfx_free();
|
||||||
SDL_FreeSurface(gfx_background);
|
SDL_FreeSurface(gfx_background);
|
||||||
SDL_FreeSurface(gfx_unscaledBackground);
|
SDL_FreeSurface(gfx_unscaledBackground);
|
||||||
|
@ -412,7 +447,7 @@ void engine_cleanup()
|
||||||
free(engine.collectableHead);
|
free(engine.collectableHead);
|
||||||
free(screen_bufferHead);
|
free(screen_bufferHead);
|
||||||
|
|
||||||
for (int i = 0 ; i < FONT_MAX ; i++)
|
for (i=0 ; i<FONT_MAX ; i++)
|
||||||
{
|
{
|
||||||
if (gfx_fontSprites[i] != NULL)
|
if (gfx_fontSprites[i] != NULL)
|
||||||
SDL_FreeSurface(gfx_fontSprites[i]);
|
SDL_FreeSurface(gfx_fontSprites[i]);
|
||||||
|
@ -446,8 +481,11 @@ void engine_cleanup()
|
||||||
fp = fopen(filename, "w");
|
fp = fopen(filename, "w");
|
||||||
if (fp != NULL)
|
if (fp != NULL)
|
||||||
{
|
{
|
||||||
fprintf(fp, "%d %d %d %d\n", engine.fullScreen, engine.useSound,
|
fprintf(fp,
|
||||||
engine.useMusic, engine.autoPause);
|
"%d %d %d %d %d\n"
|
||||||
|
"%s\n",
|
||||||
|
engine.fullScreen, engine.useSound, engine.useMusic,
|
||||||
|
engine.autoPause, engine.radioLife, engine.lang);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
11
src/engine.h
11
src/engine.h
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -62,7 +62,6 @@ typedef struct Engine_ {
|
||||||
int lowShield;
|
int lowShield;
|
||||||
int averageShield;
|
int averageShield;
|
||||||
|
|
||||||
float targetShield;
|
|
||||||
int targetIndex;
|
int targetIndex;
|
||||||
|
|
||||||
// Mission completion timer (allows for 4 seconds before leaving sector)
|
// Mission completion timer (allows for 4 seconds before leaving sector)
|
||||||
|
@ -90,10 +89,16 @@ typedef struct Engine_ {
|
||||||
int useMusic;
|
int useMusic;
|
||||||
int fullScreen;
|
int fullScreen;
|
||||||
int autoPause;
|
int autoPause;
|
||||||
|
int radioLife;
|
||||||
|
char lang[STRMAX_SHORT];
|
||||||
|
|
||||||
char configDirectory[PATH_MAX];
|
char configDirectory[PATH_MAX];
|
||||||
|
|
||||||
char keyState[KEY_LAST];
|
int keyState[KEY_LAST];
|
||||||
|
double xaxis;
|
||||||
|
double yaxis;
|
||||||
|
|
||||||
|
int useController;
|
||||||
|
|
||||||
int cheat; // overall cheat
|
int cheat; // overall cheat
|
||||||
int cheatShield;
|
int cheatShield;
|
||||||
|
|
43
src/event.c
43
src/event.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2012, 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -48,8 +48,8 @@ void events_init()
|
||||||
switch (game.area)
|
switch (game.area)
|
||||||
{
|
{
|
||||||
case MISN_INTERCEPTION:
|
case MISN_INTERCEPTION:
|
||||||
if ((aliens[ALIEN_KLINE].classDef == CD_KLINE) &&
|
if ((aliens[ALIEN_KLINE].classDef == CD_KLINE)
|
||||||
(aliens[ALIEN_KLINE].active))
|
&& (aliens[ALIEN_KLINE].active))
|
||||||
{
|
{
|
||||||
events[0].time = 2;
|
events[0].time = 2;
|
||||||
events[0].face = FS_KLINE;
|
events[0].face = FS_KLINE;
|
||||||
|
@ -73,7 +73,7 @@ void events_init()
|
||||||
events[0].time = 2;
|
events[0].time = 2;
|
||||||
events[0].face = FS_SID;
|
events[0].face = FS_SID;
|
||||||
/// Dialog (Sid Wilson)
|
/// Dialog (Sid Wilson)
|
||||||
strcpy(events[0].message, _("You should try and destroy some of the frigate's weaponary, it'll help!"));
|
strcpy(events[0].message, _("You should try and destroy some of the frigate's weaponry, it'll help!"));
|
||||||
|
|
||||||
events[1].time = 120;
|
events[1].time = 120;
|
||||||
events[1].face = FS_SID;
|
events[1].face = FS_SID;
|
||||||
|
@ -113,12 +113,12 @@ void events_init()
|
||||||
/// Dialog (friendly transport from Eyananth, Allez mission)
|
/// Dialog (friendly transport from Eyananth, Allez mission)
|
||||||
strcpy(events[0].message, _("Thank God! Please, help us! If they destroy this ship..."));
|
strcpy(events[0].message, _("Thank God! Please, help us! If they destroy this ship..."));
|
||||||
|
|
||||||
events[1].time = 6;
|
events[1].time = 3 + engine.radioLife/60;
|
||||||
events[1].face = FS_CHRIS;
|
events[1].face = FS_CHRIS;
|
||||||
/// Dialog (Chris Bainfield)
|
/// Dialog (Chris Bainfield)
|
||||||
strcpy(events[1].message, _("How long do you need?"));
|
strcpy(events[1].message, _("How long do you need?"));
|
||||||
|
|
||||||
events[2].time = 10;
|
events[2].time = 4 + 2*engine.radioLife/60;
|
||||||
events[2].face = FS_CREW;
|
events[2].face = FS_CREW;
|
||||||
/// Dialog (friendly transport from Eyananth, Allez mission)
|
/// Dialog (friendly transport from Eyananth, Allez mission)
|
||||||
strcpy(events[2].message, _("Just a few minutes!"));
|
strcpy(events[2].message, _("Just a few minutes!"));
|
||||||
|
@ -168,6 +168,15 @@ void events_init()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_ELAMALE:
|
case MISN_ELAMALE:
|
||||||
|
/* It would be trivial to modify these radio times for
|
||||||
|
* engine.radioLife like with everything else, but we don't
|
||||||
|
* do that here so that the music cue stays the same. A bit
|
||||||
|
* inconsistent, but the dialog isn't terribly important,
|
||||||
|
* just flavor text really, and you can read it at your
|
||||||
|
* leasure if you want by pausing. We might change this
|
||||||
|
* later if we decide that preserving the music cue isn't
|
||||||
|
* important after all.
|
||||||
|
*/
|
||||||
events[0].time = 5;
|
events[0].time = 5;
|
||||||
events[0].face = FS_PHOEBE;
|
events[0].face = FS_PHOEBE;
|
||||||
/// Dialog (Phoebe Lexx)
|
/// Dialog (Phoebe Lexx)
|
||||||
|
@ -225,12 +234,12 @@ void events_init()
|
||||||
/// Translation note: This should appear robotic or at least monotone.
|
/// Translation note: This should appear robotic or at least monotone.
|
||||||
strcpy(events[0].message, _("Unidentified craft sighted. Will proceed to destroy all targets."));
|
strcpy(events[0].message, _("Unidentified craft sighted. Will proceed to destroy all targets."));
|
||||||
|
|
||||||
events[1].time = 8;
|
events[1].time = 4 + engine.radioLife/60;
|
||||||
events[1].face = FS_CHRIS;
|
events[1].face = FS_CHRIS;
|
||||||
/// Dialog (Chris Bainfield)
|
/// Dialog (Chris Bainfield)
|
||||||
strcpy(events[1].message, _("Looks like she's got one of those homing missile launchers too! Any advice, Phoebe?"));
|
strcpy(events[1].message, _("Looks like she's got one of those homing missile launchers too! Any advice, Phoebe?"));
|
||||||
|
|
||||||
events[2].time = 14;
|
events[2].time = 5 + 2*engine.radioLife/60;
|
||||||
events[2].face = FS_PHOEBE;
|
events[2].face = FS_PHOEBE;
|
||||||
/// Dialog (Phoebe Lexx)
|
/// Dialog (Phoebe Lexx)
|
||||||
strcpy(events[2].message, _("Just try and dodge them!"));
|
strcpy(events[2].message, _("Just try and dodge them!"));
|
||||||
|
@ -243,7 +252,7 @@ void events_init()
|
||||||
/// Dialog (Chris Bainfield)
|
/// Dialog (Chris Bainfield)
|
||||||
strcpy(events[0].message, _("That's a nice ship you got there, old-timer!"));
|
strcpy(events[0].message, _("That's a nice ship you got there, old-timer!"));
|
||||||
|
|
||||||
events[1].time = 7;
|
events[1].time = 2 + engine.radioLife/60;
|
||||||
events[1].face = FS_KRASS;
|
events[1].face = FS_KRASS;
|
||||||
/// Dialog (Krass Tyler)
|
/// Dialog (Krass Tyler)
|
||||||
strcpy(events[1].message, _("Thanks, boy. Made it myself!"));
|
strcpy(events[1].message, _("Thanks, boy. Made it myself!"));
|
||||||
|
@ -333,12 +342,12 @@ void events_init()
|
||||||
/// Dialog (Ursula Lexx)
|
/// Dialog (Ursula Lexx)
|
||||||
strcpy(events[1].message, _("It's a trap! My God! It's Tyler!"));
|
strcpy(events[1].message, _("It's a trap! My God! It's Tyler!"));
|
||||||
|
|
||||||
events[2].time = 8;
|
events[2].time = 3 + engine.radioLife/60;
|
||||||
events[2].face = FS_KRASS;
|
events[2].face = FS_KRASS;
|
||||||
/// Dialog (Krass Tyler)
|
/// Dialog (Krass Tyler)
|
||||||
strcpy(events[2].message, _("I'm a mercenary, what do you expect?! WEAPCO hired me to do a job, just like you have been doing."));
|
strcpy(events[2].message, _("I'm a mercenary, what do you expect?! WEAPCO hired me to do a job, just like you have been doing."));
|
||||||
|
|
||||||
events[3].time = 14;
|
events[3].time = 4 + 2*engine.radioLife/60;
|
||||||
events[3].face = FS_CHRIS;
|
events[3].face = FS_CHRIS;
|
||||||
/// Dialog (Chris Bainfield)
|
/// Dialog (Chris Bainfield)
|
||||||
strcpy(events[3].message, _("Good point. It would be foolish to expect anything else."));
|
strcpy(events[3].message, _("Good point. It would be foolish to expect anything else."));
|
||||||
|
@ -347,12 +356,12 @@ void events_init()
|
||||||
events[4].entity = ALIEN_BOSS_PART2;
|
events[4].entity = ALIEN_BOSS_PART2;
|
||||||
events[4].flag = -FL_ACTIVATE;
|
events[4].flag = -FL_ACTIVATE;
|
||||||
|
|
||||||
events[5].time = 20;
|
events[5].time = 5 + 3*engine.radioLife/60;
|
||||||
events[5].face = FS_KRASS;
|
events[5].face = FS_KRASS;
|
||||||
/// Dialog (Krass Tyler)
|
/// Dialog (Krass Tyler)
|
||||||
strcpy(events[5].message, _("Now if you'll assist me in dying quickly, I have a cheque to earn, boy..."));
|
strcpy(events[5].message, _("Now if you'll assist me in dying quickly, I have a cheque to earn, boy..."));
|
||||||
|
|
||||||
events[6].time = 25;
|
events[6].time = 6 + 4*engine.radioLife/60;
|
||||||
events[6].face = FS_CHRIS;
|
events[6].face = FS_CHRIS;
|
||||||
/// Dialog (Chris Bainfield)
|
/// Dialog (Chris Bainfield)
|
||||||
strcpy(events[6].message, _("I have a name, you know. Do you remember it?"));
|
strcpy(events[6].message, _("I have a name, you know. Do you remember it?"));
|
||||||
|
@ -373,7 +382,7 @@ void events_init()
|
||||||
/// Dialog (Kline Kethlan)
|
/// Dialog (Kline Kethlan)
|
||||||
strcpy(events[0].message, _("That's far enough, Bainfield. You've been lucky so far, but your luck is about to run out!"));
|
strcpy(events[0].message, _("That's far enough, Bainfield. You've been lucky so far, but your luck is about to run out!"));
|
||||||
|
|
||||||
events[1].time = 8;
|
events[1].time = 3 + engine.radioLife/60;
|
||||||
events[1].face = FS_CHRIS;
|
events[1].face = FS_CHRIS;
|
||||||
/// Dialog (Chris Bainfield)
|
/// Dialog (Chris Bainfield)
|
||||||
strcpy(events[1].message, _("Yeah, right! Like I'd lose to you after coming this far!"));
|
strcpy(events[1].message, _("Yeah, right! Like I'd lose to you after coming this far!"));
|
||||||
|
@ -386,10 +395,14 @@ void events_init()
|
||||||
/// Dialog (Chris Bainfield)
|
/// Dialog (Chris Bainfield)
|
||||||
strcpy(events[0].message, _("WEAPCO is finished, Kethlan! You have nowhere to run, nowhere to hide, and no one to help you."));
|
strcpy(events[0].message, _("WEAPCO is finished, Kethlan! You have nowhere to run, nowhere to hide, and no one to help you."));
|
||||||
|
|
||||||
events[1].time = 8;
|
events[1].time = 3 + engine.radioLife/60;
|
||||||
events[1].face = FS_KLINE;
|
events[1].face = FS_KLINE;
|
||||||
/// Dialog (Kline Kethlan)
|
/// Dialog (Kline Kethlan)
|
||||||
strcpy(events[1].message, _("You underestimate me, Bainfield."));
|
strcpy(events[1].message, _("You underestimate me, Bainfield."));
|
||||||
|
if (game.difficulty == DIFFICULTY_ORIGINAL) {
|
||||||
|
events[1].entity = ALIEN_KLINE;
|
||||||
|
events[1].flag = -(FL_IMMORTAL | FL_NOMOVE | FL_NOFIRE);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
579
src/game.c
579
src/game.c
File diff suppressed because it is too large
Load Diff
13
src/game.h
13
src/game.h
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -26,9 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "structs.h"
|
#include "structs.h"
|
||||||
|
|
||||||
typedef struct Game_ {
|
typedef struct Game_ {
|
||||||
Object thePlayer;
|
|
||||||
Object playerWeapon;
|
|
||||||
|
|
||||||
int saveFormat;
|
int saveFormat;
|
||||||
|
|
||||||
int difficulty;
|
int difficulty;
|
||||||
|
@ -67,14 +64,17 @@ typedef struct Game_ {
|
||||||
// remaining shield for experimental fighter
|
// remaining shield for experimental fighter
|
||||||
int experimentalShield;
|
int experimentalShield;
|
||||||
|
|
||||||
|
// Whether to force interception targets to appear
|
||||||
|
int forceMisnTarget;
|
||||||
|
|
||||||
Uint32 timeTaken; // In seconds
|
Uint32 timeTaken; // In seconds
|
||||||
int missionCompleted[MAX_PLANETS];
|
int missionCompleted[MAX_PLANETS];
|
||||||
|
|
||||||
int stationedPlanet;
|
int stationedPlanet;
|
||||||
int destinationPlanet;
|
int destinationPlanet;
|
||||||
|
|
||||||
char stationedName[20];
|
char stationedName[STRMAX_SHORT];
|
||||||
char destinationName[20];
|
char destinationName[STRMAX_SHORT];
|
||||||
double distanceCovered;
|
double distanceCovered;
|
||||||
|
|
||||||
int minPlasmaRate;
|
int minPlasmaRate;
|
||||||
|
@ -102,6 +102,7 @@ extern Game game;
|
||||||
extern char game_systemNames[SYSTEM_MAX][STRMAX_SHORT];
|
extern char game_systemNames[SYSTEM_MAX][STRMAX_SHORT];
|
||||||
|
|
||||||
void game_init();
|
void game_init();
|
||||||
|
void game_setStars();
|
||||||
void game_doStars();
|
void game_doStars();
|
||||||
void game_doExplosions();
|
void game_doExplosions();
|
||||||
void game_delayFrame();
|
void game_delayFrame();
|
||||||
|
|
27
src/gfx.c
27
src/gfx.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -272,6 +272,20 @@ int gfx_renderUnicode(const char *in, int x, int y, int fontColor, int wrap, SDL
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
static int gfx_charIsUTF8Start(unsigned char c)
|
||||||
|
{
|
||||||
|
// Top bit not set (single byte ASCII character)
|
||||||
|
if ((c & 0x80) == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
// Top two bits set (start of multi-byte character)
|
||||||
|
if ((c & 0x80) && (c & 0x40))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
// Top bit set, but second bit not set (somewhere in the middle)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int gfx_unicodeWidth(const char *in)
|
int gfx_unicodeWidth(const char *in)
|
||||||
{
|
{
|
||||||
int w;
|
int w;
|
||||||
|
@ -360,7 +374,8 @@ int gfx_renderUnicodeBase(const char *in, int x, int y, int real_x, int fontColo
|
||||||
nBreakPoints = 0;
|
nBreakPoints = 0;
|
||||||
for (i = 0; i < nLogAttrs; i++)
|
for (i = 0; i < nLogAttrs; i++)
|
||||||
{
|
{
|
||||||
if (logAttrs[i].is_line_break)
|
if (logAttrs[i].is_line_break
|
||||||
|
&& gfx_charIsUTF8Start(remainingStr[i]))
|
||||||
{
|
{
|
||||||
breakPoints[nBreakPoints] = i;
|
breakPoints[nBreakPoints] = i;
|
||||||
nBreakPoints++;
|
nBreakPoints++;
|
||||||
|
@ -631,9 +646,11 @@ void gfx_createTextObject(int index, const char *inString, int x, int y, int fon
|
||||||
gfx_textSprites[index].life = 0;
|
gfx_textSprites[index].life = 0;
|
||||||
|
|
||||||
/* Shortcut: if we already rendered the same string in the same color, don't render it again. */
|
/* Shortcut: if we already rendered the same string in the same color, don't render it again. */
|
||||||
if (gfx_textSprites[index].text && gfx_textSprites[index].image &&
|
// TODO: Double-check this, I think it's trying to test if gfx_textSprites[index].image is NULL.
|
||||||
gfx_textSprites[index].fontColor == fontColor &&
|
// Also, check what `text` will be when "empty".
|
||||||
!strcmp(gfx_textSprites[index].text, inString))
|
if (gfx_textSprites[index].text && gfx_textSprites[index].image
|
||||||
|
&& (gfx_textSprites[index].fontColor == fontColor)
|
||||||
|
&& (strcmp(gfx_textSprites[index].text, inString) == 0))
|
||||||
{
|
{
|
||||||
gfx_textSprites[index].x = x;
|
gfx_textSprites[index].x = x;
|
||||||
gfx_textSprites[index].y = y;
|
gfx_textSprites[index].y = y;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "structs.h"
|
#include "structs.h"
|
||||||
|
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
#include "engine.h"
|
||||||
|
|
||||||
void info_clearLines()
|
void info_clearLines()
|
||||||
{
|
{
|
||||||
|
@ -66,5 +67,5 @@ void info_setLine(const char *in, int color)
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_createTextObject(index, in, 0, 0, color);
|
gfx_createTextObject(index, in, 0, 0, color);
|
||||||
gfx_textSprites[index].life = 240;
|
gfx_textSprites[index].life = engine.radioLife;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2012, 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -179,6 +179,7 @@ void intermission_updateSystemStatus()
|
||||||
game.stationedPlanet = 0;
|
game.stationedPlanet = 0;
|
||||||
game.system = 1;
|
game.system = 1;
|
||||||
game.area = MISN_RESCUESLAVES;
|
game.area = MISN_RESCUESLAVES;
|
||||||
|
game.forceMisnTarget = 1;
|
||||||
intermission_initPlanets(game.system);
|
intermission_initPlanets(game.system);
|
||||||
|
|
||||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
|
@ -189,6 +190,7 @@ void intermission_updateSystemStatus()
|
||||||
game.stationedPlanet = 0;
|
game.stationedPlanet = 0;
|
||||||
game.system = 2;
|
game.system = 2;
|
||||||
game.area = MISN_CLOAKFIGHTER;
|
game.area = MISN_CLOAKFIGHTER;
|
||||||
|
game.forceMisnTarget = 1;
|
||||||
intermission_initPlanets(game.system);
|
intermission_initPlanets(game.system);
|
||||||
|
|
||||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
|
@ -693,10 +695,10 @@ static int intermission_showSystem(float pos, int selectable)
|
||||||
r.y -= (intermission_planets[planet].image->h / 2);
|
r.y -= (intermission_planets[planet].image->h / 2);
|
||||||
screen_blit(intermission_planets[planet].image, r.x, r.y);
|
screen_blit(intermission_planets[planet].image, r.x, r.y);
|
||||||
|
|
||||||
if (selectable &&
|
if (selectable
|
||||||
game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6,
|
&& game_collision(engine.cursor_x + 13, engine.cursor_y + 13,
|
||||||
r.x, r.y, intermission_planets[planet].image->w,
|
6, 6, r.x, r.y, intermission_planets[planet].image->w,
|
||||||
intermission_planets[planet].image->h))
|
intermission_planets[planet].image->h))
|
||||||
{
|
{
|
||||||
if (!printedName)
|
if (!printedName)
|
||||||
{
|
{
|
||||||
|
@ -754,8 +756,8 @@ static void intermission_showStatus(SDL_Surface *infoSurface)
|
||||||
for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
|
for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
|
||||||
{
|
{
|
||||||
y += 20;
|
y += 20;
|
||||||
if ((i == TS_CHRIS_HEADER) || (i == TS_PHOEBE_HEADER) ||
|
if ((i == TS_CHRIS_HEADER) || (i == TS_PHOEBE_HEADER)
|
||||||
(i == TS_URSULA_HEADER))
|
|| (i == TS_URSULA_HEADER))
|
||||||
y += 25;
|
y += 25;
|
||||||
|
|
||||||
gfx_textSprites[i].y = y;
|
gfx_textSprites[i].y = y;
|
||||||
|
@ -912,7 +914,7 @@ static void intermission_createMissionDetailSurface(SDL_Surface *comms, int miss
|
||||||
y = intermission_renderDialog(comms, y, FS_CHRIS, string);
|
y = intermission_renderDialog(comms, y, FS_CHRIS, string);
|
||||||
|
|
||||||
/// Mission dialog: Spirit, Moebo (Sid Wilson)
|
/// Mission dialog: Spirit, Moebo (Sid Wilson)
|
||||||
strcpy(string, _("We're all counting on you, Chris! But just remember - They didn't call that thing \"Star Killer\" just because it sounded nice!"));
|
strcpy(string, _("We're all counting on you, Chris! But remember, they didn't call that thing \"Star Killer\" just because it sounded nice!"));
|
||||||
y = intermission_renderDialog(comms, y, FS_SID, string);
|
y = intermission_renderDialog(comms, y, FS_SID, string);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -959,14 +961,14 @@ static void intermission_createMissionDetailSurface(SDL_Surface *comms, int miss
|
||||||
y = intermission_renderDialog(comms, y, FS_SID, string);
|
y = intermission_renderDialog(comms, y, FS_SID, string);
|
||||||
|
|
||||||
/// Mission dialog: Eyananth, Allez (Chris Bainfield)
|
/// Mission dialog: Eyananth, Allez (Chris Bainfield)
|
||||||
strcpy(string, _("Alright, Tell 'em I'm on my way."));
|
strcpy(string, _("Alright, tell 'em I'm on my way."));
|
||||||
y = intermission_renderDialog(comms, y, FS_CHRIS, string);
|
y = intermission_renderDialog(comms, y, FS_CHRIS, string);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_URUSOR:
|
case MISN_URUSOR:
|
||||||
/// Mission dialog: Eyananth, Urusor (Sid Wilson)
|
/// Mission dialog: Eyananth, Urusor (Sid Wilson)
|
||||||
strcpy(string, _("I need some resources before we leave, it'll make life a lot easier in Mordor. Problem is that WEAPCO hoards these parts."));
|
strcpy(string, _("I need some resources before we leave. It'll make life a lot easier in Mordor. Problem is that WEAPCO hoards these parts."));
|
||||||
y = intermission_renderDialog(comms, y, FS_SID, string);
|
y = intermission_renderDialog(comms, y, FS_SID, string);
|
||||||
|
|
||||||
/// Mission dialog: Eyananth, Urusor (Chris Bainfield)
|
/// Mission dialog: Eyananth, Urusor (Chris Bainfield)
|
||||||
|
@ -1057,7 +1059,7 @@ static void intermission_createMissionDetailSurface(SDL_Surface *comms, int miss
|
||||||
|
|
||||||
case MISN_FELLON:
|
case MISN_FELLON:
|
||||||
/// Mission dialog: Mordor, Fellon (Sid Wilson)
|
/// Mission dialog: Mordor, Fellon (Sid Wilson)
|
||||||
strcpy(string, _("A rebel group has organized a counter strike. If we can help them secure a victory it will be a real boost to morale."));
|
strcpy(string, _("A rebel group has organized a counter strike. If we can help them secure a victory, it will be a real boost to morale."));
|
||||||
y = intermission_renderDialog(comms, y, FS_SID, string);
|
y = intermission_renderDialog(comms, y, FS_SID, string);
|
||||||
|
|
||||||
/// Mission dialog: Mordor, Fellon (Chris Bainfield)
|
/// Mission dialog: Mordor, Fellon (Chris Bainfield)
|
||||||
|
@ -1226,7 +1228,7 @@ static void intermission_createMissionDetailSurface(SDL_Surface *comms, int miss
|
||||||
strcpy(string, "Hey, why am I talking to myself? This shouldn't happen! Clearly, this must be a bug.");
|
strcpy(string, "Hey, why am I talking to myself? This shouldn't happen! Clearly, this must be a bug.");
|
||||||
y = intermission_renderDialog(comms, y, FS_CHRIS, string);
|
y = intermission_renderDialog(comms, y, FS_CHRIS, string);
|
||||||
|
|
||||||
snprintf(string, STRMAX, "I should go to starfighter.nongnu.org and report this bug there. In that report, I should mention that the mission number is %d.", misn);
|
snprintf(string, STRMAX, "I should go to pr-starfighter.github.io and report this bug there. In that report, I should mention that the mission number is %d.", misn);
|
||||||
y = intermission_renderDialog(comms, y, FS_CHRIS, string);
|
y = intermission_renderDialog(comms, y, FS_CHRIS, string);
|
||||||
|
|
||||||
strcpy(string, "Wait, what am I still talking into empty space for? It's not like anyone can hear me...");
|
strcpy(string, "Wait, what am I still talking into empty space for? It's not like anyone can hear me...");
|
||||||
|
@ -1318,7 +1320,11 @@ static void intermission_doOptions(SDL_Surface *optionsSurface, int x, int y)
|
||||||
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x + 187, y + 92, 45, 22))
|
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x + 187, y + 92, 45, 22))
|
||||||
{
|
{
|
||||||
engine.useMusic = 1;
|
engine.useMusic = 1;
|
||||||
|
#ifdef OLD_MUSIC
|
||||||
|
audio_playMusic("music/3DParadise.mod", -1);
|
||||||
|
#else
|
||||||
audio_playMusic("music/through_space.ogg", -1);
|
audio_playMusic("music/through_space.ogg", -1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x + 248, y + 92, 45, 22))
|
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x + 248, y + 92, 45, 22))
|
||||||
|
@ -1442,7 +1448,7 @@ int intermission()
|
||||||
gfx_faceSprites[FS_KLINE] = gfx_loadImage("gfx/face_kline.png");
|
gfx_faceSprites[FS_KLINE] = gfx_loadImage("gfx/face_kline.png");
|
||||||
gfx_faceSprites[FS_CREW] = gfx_loadImage("gfx/face_crew.png");
|
gfx_faceSprites[FS_CREW] = gfx_loadImage("gfx/face_crew.png");
|
||||||
|
|
||||||
engine.done = 0;
|
engine.done = ENGINE_RUNNING;
|
||||||
engine.keyState[KEY_FIRE] = 0;
|
engine.keyState[KEY_FIRE] = 0;
|
||||||
engine.ssx = 0;
|
engine.ssx = 0;
|
||||||
engine.ssy = 0;
|
engine.ssy = 0;
|
||||||
|
@ -1461,8 +1467,8 @@ int intermission()
|
||||||
intermission_createCommsSurface(commsSurface);
|
intermission_createCommsSurface(commsSurface);
|
||||||
|
|
||||||
// Remove the Supercharge, if it is there
|
// Remove the Supercharge, if it is there
|
||||||
if ((game.difficulty != DIFFICULTY_EASY) &&
|
if ((game.difficulty > DIFFICULTY_EASY)
|
||||||
(game.difficulty != DIFFICULTY_ORIGINAL))
|
&& (game.difficulty != DIFFICULTY_ORIGINAL))
|
||||||
{
|
{
|
||||||
weapons[W_PLAYER_WEAPON].reload[0] = MAX(
|
weapons[W_PLAYER_WEAPON].reload[0] = MAX(
|
||||||
weapons[W_PLAYER_WEAPON].reload[0],
|
weapons[W_PLAYER_WEAPON].reload[0],
|
||||||
|
@ -1499,7 +1505,11 @@ int intermission()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((engine.useAudio) && (engine.useMusic))
|
if ((engine.useAudio) && (engine.useMusic))
|
||||||
|
#ifdef OLD_MUSIC
|
||||||
|
audio_playMusic("music/3DParadise.mod", -1);
|
||||||
|
#else
|
||||||
audio_playMusic("music/through_space.ogg", -1);
|
audio_playMusic("music/through_space.ogg", -1);
|
||||||
|
#endif
|
||||||
|
|
||||||
/// Retain "%s" as-is. It is replaced with the current system name.
|
/// Retain "%s" as-is. It is replaced with the current system name.
|
||||||
snprintf(string, STRMAX_SHORT, _("System : %s"), game_systemNames[game.system]);
|
snprintf(string, STRMAX_SHORT, _("System : %s"), game_systemNames[game.system]);
|
||||||
|
@ -1539,9 +1549,9 @@ int intermission()
|
||||||
|
|
||||||
player_flushInput();
|
player_flushInput();
|
||||||
engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
|
engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
|
||||||
engine.done = 0;
|
engine.done = ENGINE_RUNNING;
|
||||||
|
|
||||||
while (!engine.done)
|
while (engine.done == ENGINE_RUNNING)
|
||||||
{
|
{
|
||||||
renderer_update();
|
renderer_update();
|
||||||
|
|
||||||
|
@ -1595,7 +1605,7 @@ int intermission()
|
||||||
{
|
{
|
||||||
game.area = intermission_planets[game.stationedPlanet].missionNumber;
|
game.area = intermission_planets[game.stationedPlanet].missionNumber;
|
||||||
rtn = 2;
|
rtn = 2;
|
||||||
engine.done = 1;
|
engine.done = ENGINE_CLOSING;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1679,7 +1689,7 @@ int intermission()
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
rtn = 0;
|
rtn = 0;
|
||||||
engine.done = 1;
|
engine.done = ENGINE_CLOSING;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
|
@ -1714,7 +1724,7 @@ int intermission()
|
||||||
{
|
{
|
||||||
game.area = MISN_INTERCEPTION;
|
game.area = MISN_INTERCEPTION;
|
||||||
rtn = 2;
|
rtn = 2;
|
||||||
engine.done = 1;
|
engine.done = ENGINE_CLOSING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1728,8 +1738,8 @@ int intermission()
|
||||||
x = screen->w / 16;
|
x = screen->w / 16;
|
||||||
y = screen->h - 80;
|
y = screen->h - 80;
|
||||||
w = screen->w - 2 * x - 32;
|
w = screen->w - 2 * x - 32;
|
||||||
if ((game.stationedPlanet == game.destinationPlanet) &&
|
if ((game.stationedPlanet == game.destinationPlanet)
|
||||||
(!intermission_planets[game.stationedPlanet].missionCompleted))
|
&& (!intermission_planets[game.stationedPlanet].missionCompleted))
|
||||||
screen_blit(gfx_sprites[SP_START_MISSION], x, y);
|
screen_blit(gfx_sprites[SP_START_MISSION], x, y);
|
||||||
else if (game.stationedPlanet != game.destinationPlanet)
|
else if (game.stationedPlanet != game.destinationPlanet)
|
||||||
screen_blit(gfx_sprites[SP_GOTO], x, y);
|
screen_blit(gfx_sprites[SP_GOTO], x, y);
|
||||||
|
@ -1742,9 +1752,9 @@ int intermission()
|
||||||
screen_blit(gfx_sprites[SP_OPTIONS], x + 6 * w / 7, y);
|
screen_blit(gfx_sprites[SP_OPTIONS], x + 6 * w / 7, y);
|
||||||
screen_blit(gfx_sprites[SP_EXIT], x + w, y);
|
screen_blit(gfx_sprites[SP_EXIT], x + w, y);
|
||||||
|
|
||||||
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x, y, 32, 32) &&
|
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x, y, 32, 32)
|
||||||
((game.stationedPlanet != game.destinationPlanet) ||
|
&& ((game.stationedPlanet != game.destinationPlanet)
|
||||||
(!intermission_planets[game.stationedPlanet].missionCompleted)))
|
|| (!intermission_planets[game.stationedPlanet].missionCompleted)))
|
||||||
{
|
{
|
||||||
if (game.stationedPlanet == game.destinationPlanet)
|
if (game.stationedPlanet == game.destinationPlanet)
|
||||||
screen_blitText(TS_INFO_START_MISSION, -1, screen->h - 25);
|
screen_blitText(TS_INFO_START_MISSION, -1, screen->h - 25);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2012, 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -98,7 +98,7 @@ void mission_init()
|
||||||
mission_clearAll();
|
mission_clearAll();
|
||||||
|
|
||||||
/// Mission objective (start)
|
/// Mission objective (start)
|
||||||
strcpy(missions[MISN_START].primaryObjective[0], _("Escape from WEAPCO Persuit"));
|
strcpy(missions[MISN_START].primaryObjective[0], _("Escape from WEAPCO Pursuit"));
|
||||||
missions[MISN_START].primaryType[0] = M_DESTROY_ALL_TARGETS;
|
missions[MISN_START].primaryType[0] = M_DESTROY_ALL_TARGETS;
|
||||||
missions[MISN_START].completed1[0] = OB_INCOMPLETE;
|
missions[MISN_START].completed1[0] = OB_INCOMPLETE;
|
||||||
|
|
||||||
|
@ -565,8 +565,8 @@ static void mission_killAllEnemies()
|
||||||
{
|
{
|
||||||
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
||||||
{
|
{
|
||||||
if ((aliens[i].flags & FL_WEAPCO) && (aliens[i].active) &&
|
if ((aliens[i].flags & FL_WEAPCO) && (aliens[i].active)
|
||||||
(aliens[i].shield > 0))
|
&& (aliens[i].shield > 0))
|
||||||
aliens[i].shield = 0;
|
aliens[i].shield = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -596,13 +596,13 @@ void mission_checkTimer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// specific to Spirit Boss
|
// specific to Spirit Boss
|
||||||
if ((game.area == MISN_MOEBO) &&
|
if ((game.area == MISN_MOEBO)
|
||||||
(mission.completed1[0] < OB_INCOMPLETE))
|
&& (mission.completed1[0] < OB_INCOMPLETE))
|
||||||
engine.timeMission = 1;
|
engine.timeMission = 1;
|
||||||
|
|
||||||
// specific to the Asteroid belt
|
// specific to the Asteroid belt
|
||||||
if ((game.area == MISN_MARS) &&
|
if ((game.area == MISN_MARS)
|
||||||
(mission.completed1[0] < OB_INCOMPLETE))
|
&& (mission.completed1[0] < OB_INCOMPLETE))
|
||||||
{
|
{
|
||||||
mission.completed1[0] = OB_COMPLETED;
|
mission.completed1[0] = OB_COMPLETED;
|
||||||
mission_killAllEnemies();
|
mission_killAllEnemies();
|
||||||
|
@ -616,8 +616,8 @@ static void mission_evaluate(int type, int id, int *completed, int *targetValue,
|
||||||
char message[STRMAX_SHORT];
|
char message[STRMAX_SHORT];
|
||||||
char fmt[STRMAX_SHORT];
|
char fmt[STRMAX_SHORT];
|
||||||
|
|
||||||
if ((*targetValue <= 0) && (type != M_PROTECT_TARGET) &&
|
if ((*targetValue <= 0) && (type != M_PROTECT_TARGET)
|
||||||
(type != M_PROTECT_PICKUP))
|
&& (type != M_PROTECT_PICKUP))
|
||||||
{
|
{
|
||||||
*completed = OB_JUST_COMPLETED;
|
*completed = OB_JUST_COMPLETED;
|
||||||
mission_checkTimer();
|
mission_checkTimer();
|
||||||
|
@ -814,9 +814,9 @@ void mission_updateRequirements(int type, int id, int value)
|
||||||
{
|
{
|
||||||
if ((mission.completed1[i] == OB_INCOMPLETE) || (mission.completed1[i] == OB_CONDITION))
|
if ((mission.completed1[i] == OB_INCOMPLETE) || (mission.completed1[i] == OB_CONDITION))
|
||||||
{
|
{
|
||||||
if ((mission.primaryType[i] == type) &&
|
if ((mission.primaryType[i] == type)
|
||||||
((mission.target1[i] == id) ||
|
&& ((mission.target1[i] == id)
|
||||||
(mission.target1[i] == CD_ANY)))
|
|| (mission.target1[i] == CD_ANY)))
|
||||||
{
|
{
|
||||||
matched = 1;
|
matched = 1;
|
||||||
mission.targetValue1[i] -= value;
|
mission.targetValue1[i] -= value;
|
||||||
|
@ -833,9 +833,9 @@ void mission_updateRequirements(int type, int id, int value)
|
||||||
{
|
{
|
||||||
if ((mission.completed2[i] == OB_INCOMPLETE) || (mission.completed2[i] == OB_CONDITION))
|
if ((mission.completed2[i] == OB_INCOMPLETE) || (mission.completed2[i] == OB_CONDITION))
|
||||||
{
|
{
|
||||||
if ((mission.secondaryType[i] == type) &&
|
if ((mission.secondaryType[i] == type)
|
||||||
((mission.target2[i] == id) ||
|
&& ((mission.target2[i] == id)
|
||||||
(mission.target2[i] == CD_ANY)))
|
|| (mission.target2[i] == CD_ANY)))
|
||||||
{
|
{
|
||||||
mission.targetValue2[i] -= value;
|
mission.targetValue2[i] -= value;
|
||||||
mission_evaluate(type, id, &mission.completed2[i], &mission.targetValue2[i], FONT_YELLOW);
|
mission_evaluate(type, id, &mission.completed2[i], &mission.targetValue2[i], FONT_YELLOW);
|
||||||
|
@ -889,7 +889,7 @@ void mission_updateRequirements(int type, int id, int value)
|
||||||
intermission_planets[PLANET_CLOAKFIGHTER].missionCompleted = 1;
|
intermission_planets[PLANET_CLOAKFIGHTER].missionCompleted = 1;
|
||||||
/// Dialog (Chris Bainfield)
|
/// Dialog (Chris Bainfield)
|
||||||
/// Used when the Mordor cloak ship is destroyed.
|
/// Used when the Mordor cloak ship is destroyed.
|
||||||
radio_setMessage(FS_CHRIS, _("That's one less suprise that WEAPCO can spring on us!"), 1);
|
radio_setMessage(FS_CHRIS, _("That's one less surprise that WEAPCO can spring on us!"), 1);
|
||||||
game.experimentalShield = 0;
|
game.experimentalShield = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -924,7 +924,11 @@ static int mission_revealObjectives()
|
||||||
aliens[ALIEN_KLINE].y = player.y;
|
aliens[ALIEN_KLINE].y = player.y;
|
||||||
aliens[ALIEN_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE;
|
aliens[ALIEN_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE;
|
||||||
player_setTarget(ALIEN_KLINE);
|
player_setTarget(ALIEN_KLINE);
|
||||||
|
#ifdef OLD_MUSIC
|
||||||
|
audio_playMusic("music/TranceGeneration.mod", -1);
|
||||||
|
#else
|
||||||
audio_playMusic("music/last_cyber_dance.ogg", -1);
|
audio_playMusic("music/last_cyber_dance.ogg", -1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -937,7 +941,9 @@ int mission_checkCompleted()
|
||||||
{
|
{
|
||||||
if (mission.completed1[i] == OB_INCOMPLETE)
|
if (mission.completed1[i] == OB_INCOMPLETE)
|
||||||
{
|
{
|
||||||
if ((mission.primaryType[i] == M_DESTROY_ALL_TARGETS) && (engine.allAliensDead) && (mission.remainingObjectives1 + mission.remainingObjectives2 == 1))
|
if ((mission.primaryType[i] == M_DESTROY_ALL_TARGETS)
|
||||||
|
&& (engine.allAliensDead)
|
||||||
|
&& (mission.remainingObjectives1 + mission.remainingObjectives2 == 1))
|
||||||
{
|
{
|
||||||
mission.completed1[i] = OB_JUST_COMPLETED;
|
mission.completed1[i] = OB_JUST_COMPLETED;
|
||||||
mission_checkTimer();
|
mission_checkTimer();
|
||||||
|
@ -949,7 +955,9 @@ int mission_checkCompleted()
|
||||||
{
|
{
|
||||||
if (mission.completed2[i] == OB_INCOMPLETE)
|
if (mission.completed2[i] == OB_INCOMPLETE)
|
||||||
{
|
{
|
||||||
if ((mission.secondaryType[i] == M_DESTROY_ALL_TARGETS) && (engine.allAliensDead) && (mission.remainingObjectives1 + mission.remainingObjectives2 == 1))
|
if ((mission.secondaryType[i] == M_DESTROY_ALL_TARGETS)
|
||||||
|
&& (engine.allAliensDead)
|
||||||
|
&& (mission.remainingObjectives1 + mission.remainingObjectives2 == 1))
|
||||||
{
|
{
|
||||||
mission.completed2[i] = OB_JUST_COMPLETED;
|
mission.completed2[i] = OB_JUST_COMPLETED;
|
||||||
mission_checkTimer();
|
mission_checkTimer();
|
||||||
|
@ -983,10 +991,10 @@ int mission_checkCompleted()
|
||||||
mission.completed1[i] = OB_COMPLETED;
|
mission.completed1[i] = OB_COMPLETED;
|
||||||
|
|
||||||
// do some area specific things
|
// do some area specific things
|
||||||
if ((game.area == MISN_MOEBO) ||
|
if ((game.area == MISN_MOEBO)
|
||||||
(game.area == MISN_DORIM) ||
|
|| (game.area == MISN_DORIM)
|
||||||
(game.area == MISN_ELLESH) ||
|
|| (game.area == MISN_ELLESH)
|
||||||
(game.area == MISN_MARS))
|
|| (game.area == MISN_MARS))
|
||||||
{
|
{
|
||||||
if (mission.remainingObjectives2 == 0)
|
if (mission.remainingObjectives2 == 0)
|
||||||
{
|
{
|
||||||
|
@ -1017,8 +1025,8 @@ int mission_checkCompleted()
|
||||||
mission.completed2[i] = OB_COMPLETED;
|
mission.completed2[i] = OB_COMPLETED;
|
||||||
|
|
||||||
// do some area specific things
|
// do some area specific things
|
||||||
if ((game.area == MISN_DORIM) &&
|
if ((game.area == MISN_DORIM)
|
||||||
(mission.remainingObjectives1 == 0))
|
&& (mission.remainingObjectives1 == 0))
|
||||||
{
|
{
|
||||||
mission_killAllEnemies();
|
mission_killAllEnemies();
|
||||||
engine.addAliens = -1;
|
engine.addAliens = -1;
|
||||||
|
@ -1167,14 +1175,16 @@ void mission_showStartScreen()
|
||||||
gfx_createTextObject(TS_POWER, "Power", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_POWER, "Power", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_OUTPUT, "Output", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_OUTPUT, "Output", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_COOLER, "Cooler", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_COOLER, "Cooler", 0, 0, FONT_WHITE);
|
||||||
audio_playRandomTrack();
|
|
||||||
|
|
||||||
if (game.area != MISN_INTERCEPTION)
|
if (game.area != MISN_INTERCEPTION)
|
||||||
{
|
{
|
||||||
|
// Note: music is started here only for regular missions. For
|
||||||
|
// interceptions, it is instead started by game_mainLoop().
|
||||||
|
audio_playRandomTrack();
|
||||||
renderer_update();
|
renderer_update();
|
||||||
|
|
||||||
player_flushInput();
|
player_flushInput();
|
||||||
engine.done = 0;
|
engine.done = ENGINE_RUNNING;
|
||||||
engine.keyState[KEY_FIRE] = 0;
|
engine.keyState[KEY_FIRE] = 0;
|
||||||
engine.keyState[KEY_ALTFIRE] = 0;
|
engine.keyState[KEY_ALTFIRE] = 0;
|
||||||
engine.keyState[KEY_ESCAPE] = 0;
|
engine.keyState[KEY_ESCAPE] = 0;
|
||||||
|
@ -1186,17 +1196,23 @@ void mission_showStartScreen()
|
||||||
|
|
||||||
if (mission.timeLimit1[0] > 0)
|
if (mission.timeLimit1[0] > 0)
|
||||||
{
|
{
|
||||||
if (game.area != MISN_MARS)
|
if (game.area == MISN_MARS)
|
||||||
{
|
{
|
||||||
/// "%d" must be retained. It is replaced with the mission time
|
snprintf(temp, STRMAX_SHORT, ngettext(
|
||||||
/// limit in minutes.
|
/// "%d" must be retained. It is replaced with the mission required
|
||||||
snprintf(temp, STRMAX_SHORT, _("TIME LIMIT: %d minutes"), mission.timeLimit1[0]);
|
/// survival time in minutes.
|
||||||
|
"SURVIVAL FOR %d minute",
|
||||||
|
"SURVIVAL FOR %d minutes",
|
||||||
|
mission.timeLimit1[0]), mission.timeLimit1[0]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/// "%d" must be retained. It is replaced with the mission required
|
snprintf(temp, STRMAX_SHORT, ngettext(
|
||||||
/// survival time in minutes.
|
/// "%d" must be retained. It is replaced with the mission time
|
||||||
snprintf(temp, STRMAX_SHORT, _("SURVIVAL FOR %d minutes"), mission.timeLimit1[0]);
|
/// limit in minutes.
|
||||||
|
"TIME LIMIT: %d minute",
|
||||||
|
"TIME LIMIT: %d minutes",
|
||||||
|
mission.timeLimit1[0]), mission.timeLimit1[0]);
|
||||||
}
|
}
|
||||||
screen_renderUnicode(temp, -1, screen->h / 2 + 195, FONT_RED);
|
screen_renderUnicode(temp, -1, screen->h / 2 + 195, FONT_RED);
|
||||||
}
|
}
|
||||||
|
@ -1216,17 +1232,17 @@ void mission_showStartScreen()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((game.area == MISN_URUSOR) ||
|
if ((game.area == MISN_URUSOR)
|
||||||
(game.area == MISN_POSWIC) ||
|
|| (game.area == MISN_POSWIC)
|
||||||
(game.area == MISN_EARTH))
|
|| (game.area == MISN_EARTH))
|
||||||
screen_renderUnicode(_("Sid Wilson will join you on this mission"), screen->w / 2 - BRIEFING_WIDTH / 2 + 20, screen->h / 2 + 175, FONT_WHITE);
|
screen_renderUnicode(_("Sid Wilson will join you on this mission"), screen->w / 2 - BRIEFING_WIDTH / 2 + 20, screen->h / 2 + 175, FONT_WHITE);
|
||||||
|
|
||||||
renderer_update();
|
renderer_update();
|
||||||
|
|
||||||
game_delayFrame();
|
game_delayFrame();
|
||||||
player_getInput();
|
player_getInput();
|
||||||
if ((engine.keyState[KEY_FIRE]) || (engine.keyState[KEY_ALTFIRE]) ||
|
if ((engine.keyState[KEY_FIRE]) || (engine.keyState[KEY_ALTFIRE])
|
||||||
(engine.keyState[KEY_ESCAPE]))
|
|| (engine.keyState[KEY_ESCAPE]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1293,7 +1309,7 @@ void mission_showFinishedScreen()
|
||||||
renderer_update();
|
renderer_update();
|
||||||
|
|
||||||
player_flushInput();
|
player_flushInput();
|
||||||
engine.done = 0;
|
engine.done = ENGINE_RUNNING;
|
||||||
engine.keyState[KEY_FIRE] = 0;
|
engine.keyState[KEY_FIRE] = 0;
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -25,14 +25,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
typedef struct Mission_ {
|
typedef struct Mission_ {
|
||||||
|
|
||||||
char primaryObjective[3][50]; // Description
|
char primaryObjective[3][STRMAX]; // Description
|
||||||
int primaryType[3]; // The type of mission this is
|
int primaryType[3]; // The type of mission this is
|
||||||
int target1[3]; // index of target in aliens array
|
int target1[3]; // index of target in aliens array
|
||||||
int targetValue1[3]; // Number of things to collect (slaves, cash, etc)
|
int targetValue1[3]; // Number of things to collect (slaves, cash, etc)
|
||||||
int timeLimit1[3]; // In minutes
|
int timeLimit1[3]; // In minutes
|
||||||
int completed1[3];
|
int completed1[3];
|
||||||
|
|
||||||
char secondaryObjective[3][50]; // Description
|
char secondaryObjective[3][STRMAX]; // Description
|
||||||
int secondaryType[3]; // The type of mission this is
|
int secondaryType[3]; // The type of mission this is
|
||||||
int target2[3]; // index of target in aliens array
|
int target2[3]; // index of target in aliens array
|
||||||
int targetValue2[3]; // Number of things to collect (slaves, cash, etc)
|
int targetValue2[3]; // Number of things to collect (slaves, cash, etc)
|
||||||
|
|
265
src/player.c
265
src/player.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2012, 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
@ -46,8 +49,14 @@ Initialises the player for a new game.
|
||||||
void player_init()
|
void player_init()
|
||||||
{
|
{
|
||||||
player.active = 1;
|
player.active = 1;
|
||||||
player.x = screen->w / 2;
|
if (game.difficulty == DIFFICULTY_ORIGINAL) {
|
||||||
player.y = screen->h / 2;
|
player.x = screen->w / 4;
|
||||||
|
player.y = screen->h / 3;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
player.x = screen->w / 2;
|
||||||
|
player.y = screen->h / 2;
|
||||||
|
}
|
||||||
player.speed = 2;
|
player.speed = 2;
|
||||||
player.systemPower = player.maxShield;
|
player.systemPower = player.maxShield;
|
||||||
player.face = 0;
|
player.face = 0;
|
||||||
|
@ -82,8 +91,6 @@ void player_init()
|
||||||
void player_setTarget(int index)
|
void player_setTarget(int index)
|
||||||
{
|
{
|
||||||
engine.targetIndex = index;
|
engine.targetIndex = index;
|
||||||
engine.targetShield = 85;
|
|
||||||
engine.targetShield /= aliens[index].shield;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -98,14 +105,14 @@ void player_damage(int amount, int delay)
|
||||||
|
|
||||||
player_resetDamageDelay = 0;
|
player_resetDamageDelay = 0;
|
||||||
|
|
||||||
if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0) &&
|
if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0)
|
||||||
((!player.hit) ||
|
&& ((!player.hit)
|
||||||
(game.difficulty == DIFFICULTY_ORIGINAL) ||
|
|| (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
((player.shield != engine.lowShield) &&
|
|| ((player.shield != engine.lowShield)
|
||||||
(player.shield != 1))))
|
&& (player.shield != 1))))
|
||||||
{
|
{
|
||||||
if ((game.difficulty == DIFFICULTY_ORIGINAL) ||
|
if ((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
(player_damageDelay >= delay))
|
|| (player_damageDelay >= delay))
|
||||||
{
|
{
|
||||||
player.shield -= amount;
|
player.shield -= amount;
|
||||||
|
|
||||||
|
@ -114,8 +121,8 @@ void player_damage(int amount, int delay)
|
||||||
audio_playSound(SFX_HIT, player.x, player.y);
|
audio_playSound(SFX_HIT, player.x, player.y);
|
||||||
|
|
||||||
// Damage tiers (not in Classic mode)
|
// Damage tiers (not in Classic mode)
|
||||||
if ((oldshield > engine.lowShield) &&
|
if ((oldshield > engine.lowShield)
|
||||||
(player.shield <= engine.lowShield))
|
&& (player.shield <= engine.lowShield))
|
||||||
{
|
{
|
||||||
info_setLine("!!! WARNING: SHIELD LOW !!!", FONT_RED);
|
info_setLine("!!! WARNING: SHIELD LOW !!!", FONT_RED);
|
||||||
if (game.difficulty != DIFFICULTY_ORIGINAL)
|
if (game.difficulty != DIFFICULTY_ORIGINAL)
|
||||||
|
@ -245,8 +252,9 @@ static enum keys mapkey(int code) {
|
||||||
|
|
||||||
void player_getInput()
|
void player_getInput()
|
||||||
{
|
{
|
||||||
static int prevjoyup, prevjoydown, prevjoyleft, prevjoyright;
|
static int prevjoyup = 0, prevjoydown = 0, prevjoyleft = 0, prevjoyright = 0;
|
||||||
int joyup, joydown, joyleft, joyright;
|
int joyup, joydown, joyleft, joyright;
|
||||||
|
double val;
|
||||||
static int px = -1, py = -1;
|
static int px = -1, py = -1;
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
|
|
||||||
|
@ -261,8 +269,10 @@ void player_getInput()
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
if (engine.gameSection == SECTION_INTERMISSION)
|
if (engine.gameSection == SECTION_INTERMISSION)
|
||||||
{
|
{
|
||||||
if (engine.event.button.button == SDL_BUTTON_LEFT) engine.keyState[KEY_FIRE] = 1;
|
if (engine.event.button.button == SDL_BUTTON_LEFT)
|
||||||
if (engine.event.button.button == SDL_BUTTON_RIGHT) engine.keyState[KEY_ALTFIRE] = 1;
|
engine.keyState[KEY_FIRE] = 1;
|
||||||
|
if (engine.event.button.button == SDL_BUTTON_RIGHT)
|
||||||
|
engine.keyState[KEY_ALTFIRE] = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -283,61 +293,172 @@ void player_getInput()
|
||||||
|
|
||||||
case SDL_JOYBUTTONDOWN:
|
case SDL_JOYBUTTONDOWN:
|
||||||
case SDL_JOYBUTTONUP:
|
case SDL_JOYBUTTONUP:
|
||||||
switch (engine.event.jbutton.button)
|
if (!engine.useController)
|
||||||
{
|
{
|
||||||
case 0:
|
switch (engine.event.jbutton.button)
|
||||||
case 3:
|
{
|
||||||
engine.keyState[KEY_ALTFIRE] = engine.event.jbutton.state;
|
case 0:
|
||||||
break;
|
case 3:
|
||||||
case 1:
|
engine.keyState[KEY_ALTFIRE] = CSDLP(
|
||||||
case 2:
|
engine.event.jbutton.state);
|
||||||
engine.keyState[KEY_FIRE] = engine.event.jbutton.state;
|
break;
|
||||||
break;
|
case 1:
|
||||||
case 4:
|
case 2:
|
||||||
case 6:
|
engine.keyState[KEY_FIRE] = CSDLP(
|
||||||
engine.keyState[KEY_ESCAPE] = engine.event.jbutton.state;
|
engine.event.jbutton.state);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 4:
|
||||||
case 7:
|
case 6:
|
||||||
case 8:
|
engine.keyState[KEY_ESCAPE] = CSDLP(
|
||||||
engine.keyState[KEY_SWITCH] = engine.event.jbutton.state;
|
engine.event.jbutton.state);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 5:
|
||||||
if (engine.event.jbutton.state)
|
case 7:
|
||||||
engine.keyState[KEY_PAUSE] = 1;
|
case 8:
|
||||||
break;
|
engine.keyState[KEY_SWITCH] = CSDLP(
|
||||||
|
engine.event.jbutton.state);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
engine.keyState[KEY_PAUSE] = CSDLP(
|
||||||
|
engine.event.jbutton.state);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_CONTROLLERBUTTONDOWN:
|
||||||
|
case SDL_CONTROLLERBUTTONUP:
|
||||||
|
if (engine.useController)
|
||||||
|
{
|
||||||
|
switch (engine.event.cbutton.button)
|
||||||
|
{
|
||||||
|
case SDL_CONTROLLER_BUTTON_A:
|
||||||
|
case SDL_CONTROLLER_BUTTON_Y:
|
||||||
|
engine.keyState[KEY_ALTFIRE] = CSDLP(
|
||||||
|
engine.event.cbutton.state);
|
||||||
|
break;
|
||||||
|
case SDL_CONTROLLER_BUTTON_B:
|
||||||
|
case SDL_CONTROLLER_BUTTON_X:
|
||||||
|
engine.keyState[KEY_FIRE] = CSDLP(
|
||||||
|
engine.event.cbutton.state);
|
||||||
|
break;
|
||||||
|
case SDL_CONTROLLER_BUTTON_LEFTSHOULDER:
|
||||||
|
engine.keyState[KEY_ESCAPE] = CSDLP(
|
||||||
|
engine.event.cbutton.state);
|
||||||
|
break;
|
||||||
|
case SDL_CONTROLLER_BUTTON_BACK:
|
||||||
|
case SDL_CONTROLLER_BUTTON_RIGHTSHOULDER:
|
||||||
|
engine.keyState[KEY_SWITCH] = CSDLP(
|
||||||
|
engine.event.cbutton.state);
|
||||||
|
break;
|
||||||
|
case SDL_CONTROLLER_BUTTON_START:
|
||||||
|
engine.keyState[KEY_PAUSE] = CSDLP(
|
||||||
|
engine.event.cbutton.state);
|
||||||
|
break;
|
||||||
|
case SDL_CONTROLLER_BUTTON_DPAD_UP:
|
||||||
|
engine.keyState[KEY_UP] = CSDLP(
|
||||||
|
engine.event.cbutton.state);
|
||||||
|
break;
|
||||||
|
case SDL_CONTROLLER_BUTTON_DPAD_DOWN:
|
||||||
|
engine.keyState[KEY_DOWN] = CSDLP(
|
||||||
|
engine.event.cbutton.state);
|
||||||
|
break;
|
||||||
|
case SDL_CONTROLLER_BUTTON_DPAD_LEFT:
|
||||||
|
engine.keyState[KEY_LEFT] = CSDLP(
|
||||||
|
engine.event.cbutton.state);
|
||||||
|
break;
|
||||||
|
case SDL_CONTROLLER_BUTTON_DPAD_RIGHT:
|
||||||
|
engine.keyState[KEY_RIGHT] = CSDLP(
|
||||||
|
engine.event.cbutton.state);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_JOYHATMOTION:
|
case SDL_JOYHATMOTION:
|
||||||
engine.keyState[KEY_UP] = engine.event.jhat.value & SDL_HAT_UP;
|
if (!engine.useController)
|
||||||
engine.keyState[KEY_DOWN] = engine.event.jhat.value & SDL_HAT_DOWN;
|
{
|
||||||
engine.keyState[KEY_LEFT] = engine.event.jhat.value & SDL_HAT_LEFT;
|
engine.keyState[KEY_UP] = (engine.event.jhat.value & SDL_HAT_UP ? 1 : 0);
|
||||||
engine.keyState[KEY_RIGHT] = engine.event.jhat.value & SDL_HAT_RIGHT;
|
engine.keyState[KEY_DOWN] = (engine.event.jhat.value & SDL_HAT_DOWN ? 1 : 0);
|
||||||
|
engine.keyState[KEY_LEFT] = (engine.event.jhat.value & SDL_HAT_LEFT ? 1 : 0);
|
||||||
|
engine.keyState[KEY_RIGHT] = (engine.event.jhat.value & SDL_HAT_RIGHT ? 1 : 0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_JOYAXISMOTION:
|
case SDL_JOYAXISMOTION:
|
||||||
if (engine.event.jaxis.axis & 1) {
|
if (!engine.useController)
|
||||||
joyup = engine.event.jaxis.value < -16384;
|
{
|
||||||
joydown = engine.event.jaxis.value >= 16384;
|
if (engine.gameSection == SECTION_TITLE) {
|
||||||
if (joyup != prevjoyup)
|
if (engine.event.jaxis.axis == 0) {
|
||||||
engine.keyState[KEY_UP] = prevjoyup = joyup;
|
joyleft = engine.event.jaxis.value < -16384;
|
||||||
if (joydown != prevjoydown)
|
joyright = engine.event.jaxis.value >= 16384;
|
||||||
engine.keyState[KEY_DOWN] = prevjoydown = joydown;
|
if (joyleft != prevjoyleft)
|
||||||
} else {
|
engine.keyState[KEY_LEFT] = prevjoyleft = joyleft;
|
||||||
joyleft = engine.event.jaxis.value < -16384;
|
if (joyright != prevjoyright)
|
||||||
joyright = engine.event.jaxis.value >= 16384;
|
engine.keyState[KEY_RIGHT] = prevjoyright = joyright;
|
||||||
if (joyleft != prevjoyleft)
|
} else if (engine.event.jaxis.axis == 1) {
|
||||||
engine.keyState[KEY_LEFT] = prevjoyleft = joyleft;
|
joyup = engine.event.jaxis.value < -16384;
|
||||||
if (joyright != prevjoyright)
|
joydown = engine.event.jaxis.value >= 16384;
|
||||||
engine.keyState[KEY_RIGHT] = prevjoyright = joyright;
|
if (joyup != prevjoyup)
|
||||||
|
engine.keyState[KEY_UP] = prevjoyup = joyup;
|
||||||
|
if (joydown != prevjoydown)
|
||||||
|
engine.keyState[KEY_DOWN] = prevjoydown = joydown;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
val = MIN(1, (double)(abs(engine.event.jaxis.value)) / JS_MAX);
|
||||||
|
if (val < JS_DEADZONE)
|
||||||
|
val = 0;
|
||||||
|
|
||||||
|
if (engine.event.jaxis.axis == 0)
|
||||||
|
engine.xaxis = copysign(val, engine.event.jaxis.value);
|
||||||
|
else if (engine.event.jaxis.axis == 1)
|
||||||
|
engine.yaxis = copysign(val, engine.event.jaxis.value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_CONTROLLERAXISMOTION:
|
||||||
|
if (engine.useController)
|
||||||
|
{
|
||||||
|
if (engine.gameSection == SECTION_TITLE) {
|
||||||
|
if (engine.event.caxis.axis == SDL_CONTROLLER_AXIS_LEFTX)
|
||||||
|
{
|
||||||
|
joyleft = engine.event.caxis.value < -16384;
|
||||||
|
joyright = engine.event.caxis.value >= 16384;
|
||||||
|
if (joyleft != prevjoyleft)
|
||||||
|
engine.keyState[KEY_LEFT] = prevjoyleft = joyleft;
|
||||||
|
if (joyright != prevjoyright)
|
||||||
|
engine.keyState[KEY_RIGHT] = prevjoyright = joyright;
|
||||||
|
}
|
||||||
|
else if (engine.event.caxis.axis == SDL_CONTROLLER_AXIS_LEFTY)
|
||||||
|
{
|
||||||
|
joyup = engine.event.caxis.value < -16384;
|
||||||
|
joydown = engine.event.caxis.value >= 16384;
|
||||||
|
if (joyup != prevjoyup)
|
||||||
|
engine.keyState[KEY_UP] = prevjoyup = joyup;
|
||||||
|
if (joydown != prevjoydown)
|
||||||
|
engine.keyState[KEY_DOWN] = prevjoydown = joydown;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
val = MIN(1, (double)(abs(engine.event.caxis.value)) / JS_MAX);
|
||||||
|
if (val < JS_DEADZONE)
|
||||||
|
val = 0;
|
||||||
|
|
||||||
|
if (engine.event.caxis.axis == SDL_CONTROLLER_AXIS_LEFTX)
|
||||||
|
engine.xaxis = copysign(val, engine.event.caxis.value);
|
||||||
|
else if (engine.event.caxis.axis == SDL_CONTROLLER_AXIS_LEFTY)
|
||||||
|
engine.yaxis = copysign(val, engine.event.caxis.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_WINDOWEVENT:
|
case SDL_WINDOWEVENT:
|
||||||
if (engine.event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED)
|
if (engine.event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED)
|
||||||
{
|
{
|
||||||
screen_adjustDimensions(engine.event.window.data1, engine.event.window.data2);
|
screen_adjustDimensions(engine.event.window.data1, engine.event.window.data2);
|
||||||
|
game_setStars();
|
||||||
renderer_reset();
|
renderer_reset();
|
||||||
gfx_scaleBackground();
|
gfx_scaleBackground();
|
||||||
screen_clear(black);
|
screen_clear(black);
|
||||||
|
@ -346,8 +467,8 @@ void player_getInput()
|
||||||
screen_addBuffer(0, 0, screen->w, screen->h);
|
screen_addBuffer(0, 0, screen->w, screen->h);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (engine.autoPause &&
|
if (engine.autoPause
|
||||||
(engine.event.window.event == SDL_WINDOWEVENT_FOCUS_LOST))
|
&& (engine.event.window.event == SDL_WINDOWEVENT_FOCUS_LOST))
|
||||||
engine.paused = 1;
|
engine.paused = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -367,14 +488,18 @@ void player_getInput()
|
||||||
x = screen->w * x / w;
|
x = screen->w * x / w;
|
||||||
y = screen->h * y / h;
|
y = screen->h * y / h;
|
||||||
if (px == x && py == y) {
|
if (px == x && py == y) {
|
||||||
if(engine.keyState[KEY_UP] && engine.cursor_y > 0)
|
if (engine.keyState[KEY_UP])
|
||||||
engine.cursor_y -= 4;
|
engine.cursor_y -= 4;
|
||||||
if(engine.keyState[KEY_DOWN] && engine.cursor_y < screen->h - 4)
|
if (engine.keyState[KEY_DOWN])
|
||||||
engine.cursor_y += 4;
|
engine.cursor_y += 4;
|
||||||
if(engine.keyState[KEY_LEFT] && engine.cursor_x > 0)
|
if (engine.keyState[KEY_LEFT])
|
||||||
engine.cursor_x -= 4;
|
engine.cursor_x -= 4;
|
||||||
if(engine.keyState[KEY_RIGHT] && engine.cursor_x < screen->w - 4)
|
if (engine.keyState[KEY_RIGHT])
|
||||||
engine.cursor_x += 4;
|
engine.cursor_x += 4;
|
||||||
|
if (engine.xaxis)
|
||||||
|
engine.cursor_x += 10 * engine.xaxis;
|
||||||
|
if (engine.yaxis)
|
||||||
|
engine.cursor_y += 10 * engine.yaxis;
|
||||||
} else {
|
} else {
|
||||||
engine.cursor_x = px = x;
|
engine.cursor_x = px = x;
|
||||||
engine.cursor_y = py = y;
|
engine.cursor_y = py = y;
|
||||||
|
@ -391,11 +516,13 @@ void player_leaveSector()
|
||||||
engine.keyState[KEY_RIGHT] = 0;
|
engine.keyState[KEY_RIGHT] = 0;
|
||||||
engine.keyState[KEY_FIRE] = 0;
|
engine.keyState[KEY_FIRE] = 0;
|
||||||
engine.keyState[KEY_ALTFIRE] = 0;
|
engine.keyState[KEY_ALTFIRE] = 0;
|
||||||
|
engine.xaxis = 0;
|
||||||
|
engine.yaxis = 0;
|
||||||
|
|
||||||
if (engine.done == 0)
|
if (engine.done == ENGINE_RUNNING)
|
||||||
engine.done = 3;
|
engine.done = ENGINE_FORMATION;
|
||||||
|
|
||||||
if (engine.done == 3)
|
if (engine.done == ENGINE_FORMATION)
|
||||||
{
|
{
|
||||||
player.face = 0;
|
player.face = 0;
|
||||||
if (player.x > -100)
|
if (player.x > -100)
|
||||||
|
@ -410,18 +537,18 @@ void player_leaveSector()
|
||||||
|
|
||||||
if (player.x <= -100)
|
if (player.x <= -100)
|
||||||
{
|
{
|
||||||
engine.done = 2;
|
engine.done = ENGINE_SYSEXIT;
|
||||||
audio_playSound(SFX_FLY, screen->w / 2, screen->h / 2);
|
audio_playSound(SFX_FLY, screen->w / 2, screen->h / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (engine.done == 2)
|
if (engine.done == ENGINE_SYSEXIT)
|
||||||
{
|
{
|
||||||
player.face = 0;
|
player.face = 0;
|
||||||
player.x += WARP_SPEED;
|
player.x += WARP_SPEED;
|
||||||
engine.ssx -= 0.2;
|
engine.ssx -= 0.2;
|
||||||
if (player.x > (2 * screen->w))
|
if (player.x > (2 * screen->w))
|
||||||
engine.done = 1;
|
engine.done = ENGINE_CLOSING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -41,7 +41,7 @@ void radio_setMessage(int face, const char *in, int priority)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gfx_createTextObject(TS_RADIO, in, -1, 50, FONT_WHITE);
|
gfx_createTextObject(TS_RADIO, in, -1, 50, FONT_WHITE);
|
||||||
gfx_textSprites[TS_RADIO].life = 240;
|
gfx_textSprites[TS_RADIO].life = engine.radioLife;
|
||||||
|
|
||||||
if (face > -1)
|
if (face > -1)
|
||||||
faceShape = gfx_faceSprites[face];
|
faceShape = gfx_faceSprites[face];
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
164
src/save.c
164
src/save.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -48,9 +48,10 @@ int save_initSlots()
|
||||||
{
|
{
|
||||||
char fileName[PATH_MAX];
|
char fileName[PATH_MAX];
|
||||||
int system;
|
int system;
|
||||||
char stationedName[STRMAX];
|
char stationedName[STRMAX_SHORT];
|
||||||
|
int difficulty;
|
||||||
|
char difficulty_text[STRMAX_SHORT];
|
||||||
int imagePos = 0;
|
int imagePos = 0;
|
||||||
Game tempGame;
|
|
||||||
struct stat fileInfo;
|
struct stat fileInfo;
|
||||||
int modTime = 0;
|
int modTime = 0;
|
||||||
int continueSaveIndex = -1;
|
int continueSaveIndex = -1;
|
||||||
|
@ -78,15 +79,33 @@ int save_initSlots()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (fscanf(fp, "%*[^\n]%*c%*[^\n]%*c%d %*d %*d%*c%[^\n]%*c", &system,
|
switch (game.saveFormat)
|
||||||
stationedName) < 2)
|
|
||||||
{
|
{
|
||||||
strcpy(saveSlot[i], _("Corrupt Game Data"));
|
case 4:
|
||||||
}
|
case 5:
|
||||||
else
|
if (fscanf(fp,
|
||||||
{
|
"%d%*c"
|
||||||
snprintf(saveSlot[i], STRMAX_SHORT, "%s, %s", game_systemNames[system],
|
"%*[^\n]%*c"
|
||||||
stationedName);
|
"%d %*d %*d%*c%"
|
||||||
|
"[^\n]%*c",
|
||||||
|
&difficulty, &system,
|
||||||
|
stationedName) < 2)
|
||||||
|
{
|
||||||
|
strcpy(saveSlot[i], _("Corrupt Game Data"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (game.saveFormat == 4)
|
||||||
|
difficulty += DIFFICULTY_EASY;
|
||||||
|
|
||||||
|
game_getDifficultyText(difficulty_text, difficulty);
|
||||||
|
snprintf(saveSlot[i], STRMAX_SHORT,
|
||||||
|
"%s, %s (%s)", game_systemNames[system],
|
||||||
|
stationedName, difficulty_text);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
strcpy(saveSlot[i], _("Corrupt Game Data"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,49 +123,11 @@ int save_initSlots()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(fileName, PATH_MAX, "%ssave%.2d.dat", engine.configDirectory, i);
|
/// Used for empty save slots.
|
||||||
|
strcpy(saveSlot[i], (i == 0 ? _("AUTOSAVE (Empty)") : _("Empty")));
|
||||||
fp = fopen(fileName, "r");
|
if (engine.gameSection == SECTION_TITLE)
|
||||||
if (fp == NULL)
|
gfx_createTextObject(TS_SAVESLOT_0 + i, saveSlot[i],
|
||||||
{
|
0, imagePos, FONT_WHITE);
|
||||||
/// Used for empty save slots.
|
|
||||||
strcpy(saveSlot[i], (i == 0 ? _("AUTOSAVE (Empty)") : _("Empty")));
|
|
||||||
if (engine.gameSection == SECTION_TITLE)
|
|
||||||
gfx_createTextObject(TS_SAVESLOT_0 + i, saveSlot[i],
|
|
||||||
0, imagePos, FONT_WHITE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (i == 0)
|
|
||||||
{
|
|
||||||
strcpy(saveSlot[i], _("AUTOSAVE"));
|
|
||||||
continueSaveIndex = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (fread(&tempGame, sizeof(Game), 1, fp) != 1)
|
|
||||||
{
|
|
||||||
strcpy(saveSlot[i], _("Corrupt Game Data"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
snprintf(saveSlot[i], STRMAX_SHORT, "%s, %s", game_systemNames[tempGame.system],
|
|
||||||
tempGame.stationedName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (engine.gameSection == SECTION_TITLE)
|
|
||||||
gfx_createTextObject(TS_SAVESLOT_0 + i, saveSlot[i], 0,
|
|
||||||
imagePos, FONT_WHITE);
|
|
||||||
|
|
||||||
if (stat(fileName, &fileInfo) != -1)
|
|
||||||
{
|
|
||||||
if (fileInfo.st_mtime > modTime)
|
|
||||||
{modTime = fileInfo.st_mtime; continueSaveIndex = i;}
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(fp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
imagePos += 20;
|
imagePos += 20;
|
||||||
}
|
}
|
||||||
|
@ -178,48 +159,51 @@ int save_load(int slot)
|
||||||
switch (game.saveFormat)
|
switch (game.saveFormat)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
if ((fscanf(fp, "%d%*c", &game.difficulty) < 1) ||
|
case 5:
|
||||||
(fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
|
if ((fscanf(fp, "%d%*c", &game.difficulty) < 1)
|
||||||
|
|| (fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
|
||||||
&game.minPlasmaRateLimit, &game.minPlasmaDamageLimit,
|
&game.minPlasmaRateLimit, &game.minPlasmaDamageLimit,
|
||||||
&game.minPlasmaOutputLimit, &game.maxPlasmaRateLimit,
|
&game.minPlasmaOutputLimit, &game.maxPlasmaRateLimit,
|
||||||
&game.maxPlasmaDamageLimit, &game.maxPlasmaOutputLimit,
|
&game.maxPlasmaDamageLimit, &game.maxPlasmaOutputLimit,
|
||||||
&game.maxPlasmaAmmoLimit, &game.maxRocketAmmoLimit) < 8) ||
|
&game.maxPlasmaAmmoLimit, &game.maxRocketAmmoLimit) < 8)
|
||||||
(fscanf(fp, "%d %d %d%*c%*[^\n]%*c", &game.system, &game.area,
|
|| (fscanf(fp, "%d %d %d%*c%*[^\n]%*c", &game.system, &game.area,
|
||||||
&game.stationedPlanet) < 3) ||
|
&game.stationedPlanet) < 3)
|
||||||
(fscanf(fp, "%d %d%*c", &game.hasWingMate1, &game.hasWingMate2) < 2) ||
|
|| (fscanf(fp, "%d %d%*c", &game.hasWingMate1, &game.hasWingMate2) < 2)
|
||||||
(fscanf(fp, "%d %d %d %d%*c", &player.maxShield,
|
|| (fscanf(fp, "%d %d %d %d%*c", &player.maxShield,
|
||||||
&player.ammo[0], &player.ammo[1], &player.weaponType[1]) < 4) ||
|
&player.ammo[0], &player.ammo[1], &player.weaponType[1]) < 4)
|
||||||
(fscanf(fp, "%d %d %d%*c",
|
|| (fscanf(fp, "%d %d %d%*c",
|
||||||
&weapons[W_PLAYER_WEAPON].ammo[0],
|
&weapons[W_PLAYER_WEAPON].ammo[0],
|
||||||
&weapons[W_PLAYER_WEAPON].damage,
|
&weapons[W_PLAYER_WEAPON].damage,
|
||||||
&weapons[W_PLAYER_WEAPON].reload[0]) < 3) ||
|
&weapons[W_PLAYER_WEAPON].reload[0]) < 3)
|
||||||
(fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
|
|| (fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
|
||||||
&game.minPlasmaRate, &game.minPlasmaDamage,
|
&game.minPlasmaRate, &game.minPlasmaDamage,
|
||||||
&game.minPlasmaOutput, &game.maxPlasmaRate,
|
&game.minPlasmaOutput, &game.maxPlasmaRate,
|
||||||
&game.maxPlasmaDamage, &game.maxPlasmaOutput,
|
&game.maxPlasmaDamage, &game.maxPlasmaOutput,
|
||||||
&game.maxPlasmaAmmo, &game.maxRocketAmmo) < 8) ||
|
&game.maxPlasmaAmmo, &game.maxRocketAmmo) < 8)
|
||||||
(fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d%*c",
|
|| (fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d%*c",
|
||||||
&game.missionCompleted[0], &game.missionCompleted[1],
|
&game.missionCompleted[0], &game.missionCompleted[1],
|
||||||
&game.missionCompleted[2], &game.missionCompleted[3],
|
&game.missionCompleted[2], &game.missionCompleted[3],
|
||||||
&game.missionCompleted[4], &game.missionCompleted[5],
|
&game.missionCompleted[4], &game.missionCompleted[5],
|
||||||
&game.missionCompleted[6], &game.missionCompleted[7],
|
&game.missionCompleted[6], &game.missionCompleted[7],
|
||||||
&game.missionCompleted[8], &game.missionCompleted[9]) < 10) ||
|
&game.missionCompleted[8], &game.missionCompleted[9]) < 10)
|
||||||
(fscanf(fp, "%d%*c", &game.experimentalShield) < 1) ||
|
|| (fscanf(fp, "%d%*c", &game.experimentalShield) < 1)
|
||||||
(fscanf(fp, "%d %d%*c", &game.cash, &game.cashEarned) < 2) ||
|
|| (fscanf(fp, "%d %d%*c", &game.cash, &game.cashEarned) < 2)
|
||||||
(fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d%*c",
|
|| (fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d%*c",
|
||||||
&game.shots, &game.hits, &game.accuracy, &game.totalKills,
|
&game.shots, &game.hits, &game.accuracy, &game.totalKills,
|
||||||
&game.wingMate1Kills, &game.wingMate2Kills,
|
&game.wingMate1Kills, &game.wingMate2Kills,
|
||||||
&game.wingMate1Ejects, &game.wingMate2Ejects,
|
&game.wingMate1Ejects, &game.wingMate2Ejects,
|
||||||
&game.totalOtherKills, &game.shieldPickups,
|
&game.totalOtherKills, &game.shieldPickups,
|
||||||
&game.rocketPickups, &game.cellPickups, &game.powerups,
|
&game.rocketPickups, &game.cellPickups, &game.powerups,
|
||||||
&game.minesKilled, &game.slavesRescued) < 15) ||
|
&game.minesKilled, &game.slavesRescued) < 15)
|
||||||
(fscanf(fp, "%lu%*c", &timeTaken) < 1))
|
|| (fscanf(fp, "%lu%*c", &timeTaken) < 1))
|
||||||
{
|
{
|
||||||
printf("Warning: Save data is not correctly formatted. Some data may be lost.\n");
|
printf("Warning: Save data is not correctly formatted. Some data may be lost.\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
game.timeTaken = (Uint32)(timeTaken);
|
game.timeTaken = (Uint32)(timeTaken);
|
||||||
|
if (game.saveFormat == 4)
|
||||||
|
game.difficulty += DIFFICULTY_EASY;
|
||||||
}
|
}
|
||||||
game.destinationPlanet = game.stationedPlanet;
|
game.destinationPlanet = game.stationedPlanet;
|
||||||
break;
|
break;
|
||||||
|
@ -233,31 +217,7 @@ int save_load(int slot)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(filename, PATH_MAX, "%ssave%.2d.dat", engine.configDirectory, slot);
|
return 0;
|
||||||
fp = fopen(filename, "rb");
|
|
||||||
|
|
||||||
if (fp == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (fread(&game, sizeof(Game), 1, fp) != 1)
|
|
||||||
{
|
|
||||||
printf("Save game error. The file was not of the expected format.\n");
|
|
||||||
fclose(fp);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(fp);
|
|
||||||
|
|
||||||
if (game.saveFormat < 2)
|
|
||||||
game.difficulty = DIFFICULTY_NORMAL;
|
|
||||||
|
|
||||||
weapons[W_PLAYER_WEAPON] = game.playerWeapon;
|
|
||||||
weapons[W_PLAYER_WEAPON].imageIndex[0] = SP_PLASMA_GREEN;
|
|
||||||
weapons[W_PLAYER_WEAPON].imageIndex[1] = SP_PLASMA_GREEN;
|
|
||||||
player = game.thePlayer;
|
|
||||||
|
|
||||||
save(slot);
|
|
||||||
remove(filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-init all the planets in this system...
|
// Re-init all the planets in this system...
|
||||||
|
@ -285,7 +245,7 @@ void save(int slot)
|
||||||
fp = fopen(fileName, "w");
|
fp = fopen(fileName, "w");
|
||||||
|
|
||||||
|
|
||||||
game.saveFormat = 4;
|
game.saveFormat = 5;
|
||||||
for (int i = 0 ; i < MAX_PLANETS ; i++)
|
for (int i = 0 ; i < MAX_PLANETS ; i++)
|
||||||
game.missionCompleted[i] = intermission_planets[i].missionCompleted;
|
game.missionCompleted[i] = intermission_planets[i].missionCompleted;
|
||||||
|
|
||||||
|
@ -392,9 +352,9 @@ void save_createSurface(SDL_Surface *savesSurface, int clickedSlot)
|
||||||
gfx_drawRect(savesSurface, 5, 265, 100, 25, 0x00, 0x99, 0x00);
|
gfx_drawRect(savesSurface, 5, 265, 100, 25, 0x00, 0x99, 0x00);
|
||||||
gfx_drawRect(savesSurface, 125, 265, 100, 25, 0x99, 0x99, 0x00);
|
gfx_drawRect(savesSurface, 125, 265, 100, 25, 0x99, 0x99, 0x00);
|
||||||
gfx_drawRect(savesSurface, 243, 265, 100, 25, 0x99, 0x00, 0x00);
|
gfx_drawRect(savesSurface, 243, 265, 100, 25, 0x99, 0x00, 0x00);
|
||||||
gfx_renderUnicode(_("SAVE"), 40, 270, FONT_WHITE, 0, savesSurface);
|
gfx_renderUnicode(_("SAVE"), 10, 270, FONT_WHITE, 0, savesSurface);
|
||||||
gfx_renderUnicode(_("CANCEL"), 150, 270, FONT_WHITE, 0, savesSurface);
|
gfx_renderUnicode(_("CANCEL"), 130, 270, FONT_WHITE, 0, savesSurface);
|
||||||
gfx_renderUnicode(_("DELETE"), 270, 270, FONT_WHITE, 0, savesSurface);
|
gfx_renderUnicode(_("DELETE"), 248, 270, FONT_WHITE, 0, savesSurface);
|
||||||
gfx_renderUnicode(_("SAVE will save the game"), 17, 200, FONT_WHITE, 0, savesSurface);
|
gfx_renderUnicode(_("SAVE will save the game"), 17, 200, FONT_WHITE, 0, savesSurface);
|
||||||
gfx_renderUnicode(_("CANCEL will unselect that slot"), 17, 220, FONT_WHITE, 0, savesSurface);
|
gfx_renderUnicode(_("CANCEL will unselect that slot"), 17, 220, FONT_WHITE, 0, savesSurface);
|
||||||
gfx_renderUnicode(_("DELETE will remove the save"), 17, 240, FONT_WHITE, 0, savesSurface);
|
gfx_renderUnicode(_("DELETE will remove the save"), 17, 240, FONT_WHITE, 0, savesSurface);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
43
src/ship.c
43
src/ship.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012 Guus Sliepen
|
Copyright (C) 2011, 2012 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -68,8 +68,8 @@ void ship_fireBullet(Object *ship, int weaponIndex)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Remove some ammo from the player
|
// Remove some ammo from the player
|
||||||
if ((ship == &player) && (player.weaponType[weaponIndex] != W_LASER) &&
|
if ((ship == &player) && (player.weaponType[weaponIndex] != W_LASER)
|
||||||
(player.ammo[weaponIndex] > 0) && (!engine.cheatAmmo))
|
&& (player.ammo[weaponIndex] > 0) && (!engine.cheatAmmo))
|
||||||
player.ammo[weaponIndex]--;
|
player.ammo[weaponIndex]--;
|
||||||
|
|
||||||
switch(theWeapon->id)
|
switch(theWeapon->id)
|
||||||
|
@ -92,16 +92,8 @@ void ship_fireBullet(Object *ship, int weaponIndex)
|
||||||
|
|
||||||
if (theWeapon->flags & WF_SPREAD && theWeapon->ammo[0] >= 3)
|
if (theWeapon->flags & WF_SPREAD && theWeapon->ammo[0] >= 3)
|
||||||
{
|
{
|
||||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
bullet_add(theWeapon, ship, y * 2, -1);
|
||||||
{
|
bullet_add(theWeapon, ship, y * 4, 1);
|
||||||
bullet_add(theWeapon, ship, y * 1, -2);
|
|
||||||
bullet_add(theWeapon, ship, y * 5, 2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bullet_add(theWeapon, ship, y * 2, -1);
|
|
||||||
bullet_add(theWeapon, ship, y * 4, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (theWeapon->ammo[0] != 4)
|
if (theWeapon->ammo[0] != 4)
|
||||||
bullet_add(theWeapon, ship, y * 3, 0);
|
bullet_add(theWeapon, ship, y * 3, 0);
|
||||||
|
@ -113,16 +105,8 @@ void ship_fireBullet(Object *ship, int weaponIndex)
|
||||||
|
|
||||||
if (theWeapon->ammo[0] == 5)
|
if (theWeapon->ammo[0] == 5)
|
||||||
{
|
{
|
||||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
bullet_add(theWeapon, ship, y * 1, -2);
|
||||||
{
|
bullet_add(theWeapon, ship, y * 5, 2);
|
||||||
bullet_add(theWeapon, ship, y * 2, -1);
|
|
||||||
bullet_add(theWeapon, ship, y * 4, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bullet_add(theWeapon, ship, y * 1, -2);
|
|
||||||
bullet_add(theWeapon, ship, y * 5, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -146,8 +130,8 @@ void ship_fireBullet(Object *ship, int weaponIndex)
|
||||||
// Reset the weapon reload time. Double it if it is not friendly or
|
// Reset the weapon reload time. Double it if it is not friendly or
|
||||||
// a boss or Kline
|
// a boss or Kline
|
||||||
ship->reload[weaponIndex] = theWeapon->reload[0];
|
ship->reload[weaponIndex] = theWeapon->reload[0];
|
||||||
if ((ship->flags & FL_WEAPCO) && (ship != &aliens[ALIEN_BOSS]) &&
|
if ((ship->flags & FL_WEAPCO) && (ship != &aliens[ALIEN_BOSS])
|
||||||
(ship != &aliens[ALIEN_KLINE]) && (theWeapon->id != W_LASER))
|
&& (ship != &aliens[ALIEN_KLINE]) && (theWeapon->id != W_LASER))
|
||||||
ship->reload[weaponIndex] *= 2;
|
ship->reload[weaponIndex] *= 2;
|
||||||
|
|
||||||
if ((ship == &player) && (weaponIndex == 0))
|
if ((ship == &player) && (weaponIndex == 0))
|
||||||
|
@ -189,8 +173,9 @@ void ship_fireRay(Object *ship)
|
||||||
if (player.shield > 0)
|
if (player.shield > 0)
|
||||||
{
|
{
|
||||||
if (game_collision(player.x, player.y, player.image[0]->w,
|
if (game_collision(player.x, player.y, player.image[0]->w,
|
||||||
player.image[0]->h, ray.x, ray.y, ray.w, ray.h) &&
|
player.image[0]->h, ray.x, ray.y, ray.w, ray.h)
|
||||||
(!engine.cheatShield) && (engine.missionCompleteTimer == 0))
|
&& (!engine.cheatShield)
|
||||||
|
&& (engine.missionCompleteTimer == 0))
|
||||||
{
|
{
|
||||||
player_damage(1, RAY_DAMAGE_DELAY);
|
player_damage(1, RAY_DAMAGE_DELAY);
|
||||||
explosion_add(player.x, player.y, SP_SMALL_EXPLOSION);
|
explosion_add(player.x, player.y, SP_SMALL_EXPLOSION);
|
||||||
|
@ -203,8 +188,8 @@ void ship_fireRay(Object *ship)
|
||||||
if (aliens[i].flags & FL_IMMORTAL)
|
if (aliens[i].flags & FL_IMMORTAL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((aliens[i].shield > 0) && (ship != &aliens[i]) &&
|
if ((aliens[i].shield > 0) && (ship != &aliens[i])
|
||||||
(ship->classDef != aliens[i].classDef))
|
&& (ship->classDef != aliens[i].classDef))
|
||||||
{
|
{
|
||||||
if (game_collision(aliens[i].x, aliens[i].y, aliens[i].image[0]->w,
|
if (game_collision(aliens[i].x, aliens[i].y, aliens[i].image[0]->w,
|
||||||
aliens[i].image[0]->h, ray.x, ray.y, ray.w, ray.h))
|
aliens[i].image[0]->h, ray.x, ray.y, ray.w, ray.h))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
97
src/shop.c
97
src/shop.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -97,8 +97,9 @@ static void drawSecondaryWeaponSurface()
|
||||||
}
|
}
|
||||||
gfx_renderUnicode(description, 10, 22, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_SECONDARY]);
|
gfx_renderUnicode(description, 10, 22, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_SECONDARY]);
|
||||||
|
|
||||||
if ((player.weaponType[1] != W_LASER) &&
|
if ((player.weaponType[1] != W_LASER)
|
||||||
(player.weaponType[1] != W_CHARGER) && (player.weaponType[1] != W_NONE))
|
&& (player.weaponType[1] != W_CHARGER)
|
||||||
|
&& (player.weaponType[1] != W_NONE))
|
||||||
{
|
{
|
||||||
/// Retain "%d" as-is. It is replaced with the rocket capacity of the Firefly.
|
/// Retain "%d" as-is. It is replaced with the rocket capacity of the Firefly.
|
||||||
snprintf(description, STRMAX_SHORT, _("Capacity : %d"), game.maxRocketAmmo);
|
snprintf(description, STRMAX_SHORT, _("Capacity : %d"), game.maxRocketAmmo);
|
||||||
|
@ -234,16 +235,16 @@ static void drawShop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_shopSprites[SHOP_S_PRIMARY] = gfx_createSurface(190, 91);
|
gfx_shopSprites[SHOP_S_PRIMARY] = gfx_createSurface(194, 91);
|
||||||
gfx_shopSprites[SHOP_S_POWERUP] = gfx_createSurface(190, 91);
|
gfx_shopSprites[SHOP_S_POWERUP] = gfx_createSurface(203, 91);
|
||||||
gfx_shopSprites[SHOP_S_SECONDARY] = gfx_createSurface(190, 91);
|
gfx_shopSprites[SHOP_S_SECONDARY] = gfx_createSurface(194, 91);
|
||||||
|
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 189, 90, 0x00, 0x00, 0x55);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 193, 90, 0x00, 0x00, 0x55);
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 189, 20, 0x00, 0x00, 0x99);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 193, 20, 0x00, 0x00, 0x99);
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 189, 90, 0x00, 0x00, 0x55);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 202, 90, 0x00, 0x00, 0x55);
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 189, 20, 0x00, 0x00, 0x99);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 202, 20, 0x00, 0x00, 0x99);
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 189, 90, 0x00, 0x00, 0x55);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 193, 90, 0x00, 0x00, 0x55);
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 189, 20, 0x00, 0x00, 0x99);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 193, 20, 0x00, 0x00, 0x99);
|
||||||
|
|
||||||
gfx_shopSprites[SHOP_S_SHIP_INFO] = gfx_createAlphaRect(SHOP_WIDTH + 1, 41, 0x00, 0x00, 0x00);
|
gfx_shopSprites[SHOP_S_SHIP_INFO] = gfx_createAlphaRect(SHOP_WIDTH + 1, 41, 0x00, 0x00, 0x00);
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_SHIP_INFO], 0, 0, SHOP_WIDTH, 40, 0x00, 0x00, 0x33);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_SHIP_INFO], 0, 0, SHOP_WIDTH, 40, 0x00, 0x00, 0x33);
|
||||||
|
@ -261,22 +262,22 @@ static void drawShop()
|
||||||
case SHOP_PLASMA_MAX_DAMAGE:
|
case SHOP_PLASMA_MAX_DAMAGE:
|
||||||
case SHOP_PLASMA_MAX_RATE:
|
case SHOP_PLASMA_MAX_RATE:
|
||||||
case SHOP_PLASMA_MAX_AMMO:
|
case SHOP_PLASMA_MAX_AMMO:
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 189, 90, 0x55, 0x00, 0x00);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 202, 90, 0x55, 0x00, 0x00);
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 189, 20, 0x99, 0x00, 0x00);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 202, 20, 0x99, 0x00, 0x00);
|
||||||
break;
|
break;
|
||||||
case SHOP_PLASMA_MIN_OUTPUT:
|
case SHOP_PLASMA_MIN_OUTPUT:
|
||||||
case SHOP_PLASMA_MIN_DAMAGE:
|
case SHOP_PLASMA_MIN_DAMAGE:
|
||||||
case SHOP_PLASMA_MIN_RATE:
|
case SHOP_PLASMA_MIN_RATE:
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 189, 90, 0x55, 0x00, 0x00);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 193, 90, 0x55, 0x00, 0x00);
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 189, 20, 0x99, 0x00, 0x00);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 193, 20, 0x99, 0x00, 0x00);
|
||||||
break;
|
break;
|
||||||
case SHOP_PLASMA_AMMO:
|
case SHOP_PLASMA_AMMO:
|
||||||
case SHOP_ROCKET_AMMO:
|
case SHOP_ROCKET_AMMO:
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_SHIP_INFO], 0, 0, SHOP_WIDTH, 40, 0x33, 0x00, 0x00);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_SHIP_INFO], 0, 0, SHOP_WIDTH, 40, 0x33, 0x00, 0x00);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 189, 90, 0x55, 0x00, 0x00);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 193, 90, 0x55, 0x00, 0x00);
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 189, 20, 0x99, 0x00, 0x00);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 193, 20, 0x99, 0x00, 0x00);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,7 +366,7 @@ static void drawShop()
|
||||||
gfx_shopSprites[SHOP_S_ITEM_INFO] = gfx_createSurface(SHOP_WIDTH + 1, 56);
|
gfx_shopSprites[SHOP_S_ITEM_INFO] = gfx_createSurface(SHOP_WIDTH + 1, 56);
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_ITEM_INFO], 0, 0, SHOP_WIDTH, 35, 0x00, 0x99, 0x00);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_ITEM_INFO], 0, 0, SHOP_WIDTH, 35, 0x00, 0x99, 0x00);
|
||||||
gfx_drawRect(gfx_shopSprites[SHOP_S_ITEM_INFO], 0, 20, SHOP_WIDTH, 35, 0x00, 0x33, 0x00);
|
gfx_drawRect(gfx_shopSprites[SHOP_S_ITEM_INFO], 0, 20, SHOP_WIDTH, 35, 0x00, 0x33, 0x00);
|
||||||
gfx_renderUnicode(_("Information"), 5, 4, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
gfx_renderUnicode(_("Information"), 10, 4, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
|
|
||||||
switch (shopSelectedItem)
|
switch (shopSelectedItem)
|
||||||
{
|
{
|
||||||
|
@ -373,40 +374,40 @@ static void drawShop()
|
||||||
break;
|
break;
|
||||||
case SHOP_ERROR_INSUFFICIENT_FUNDS:
|
case SHOP_ERROR_INSUFFICIENT_FUNDS:
|
||||||
/// For when the player attempts to buy something they can't afford.
|
/// For when the player attempts to buy something they can't afford.
|
||||||
gfx_renderUnicode(_("You don't have enough money"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
gfx_renderUnicode(_("You don't have enough money"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
break;
|
break;
|
||||||
case SHOP_ERROR_CANNOT_UPGRADE:
|
case SHOP_ERROR_CANNOT_UPGRADE:
|
||||||
/// For when the player attempts an upgrade beyond the maximum (line 1 of 2).
|
/// For when the player attempts an upgrade beyond the maximum (line 1 of 2).
|
||||||
gfx_renderUnicode(_("Cannot upgrade ship"), 5, 22, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
gfx_renderUnicode(_("Cannot upgrade ship"), 10, 22, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
|
|
||||||
/// For when the player attempts an upgrade beyond the maximum (line 2 of 2).
|
/// For when the player attempts an upgrade beyond the maximum (line 2 of 2).
|
||||||
gfx_renderUnicode(_("Hardware capacity has been reached"), 20, 38, FONT_CYAN, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
gfx_renderUnicode(_("Hardware capacity has been reached"), 10, 38, FONT_CYAN, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
break;
|
break;
|
||||||
case SHOP_ERROR_AMMO_LIMIT:
|
case SHOP_ERROR_AMMO_LIMIT:
|
||||||
/// For when the player attempts to buy more ammo than the ship can hold.
|
/// For when the player attempts to buy more ammo than the ship can hold.
|
||||||
gfx_renderUnicode(_("Ammunition limit reached"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
gfx_renderUnicode(_("Ammunition limit reached"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
break;
|
break;
|
||||||
case SHOP_ERROR_CANNOT_SELL:
|
case SHOP_ERROR_CANNOT_SELL:
|
||||||
/// For when the player attempts to sell an item they aren't allowed to sell.
|
/// For when the player attempts to sell an item they aren't allowed to sell.
|
||||||
gfx_renderUnicode(_("You cannot sell that item"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
gfx_renderUnicode(_("You cannot sell that item"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
break;
|
break;
|
||||||
case SHOP_ERROR_NOTHING_TO_SELL:
|
case SHOP_ERROR_NOTHING_TO_SELL:
|
||||||
/// For when the player attempts to sell an item they don't have any of.
|
/// For when the player attempts to sell an item they don't have any of.
|
||||||
gfx_renderUnicode(_("Nothing to sell"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
gfx_renderUnicode(_("Nothing to sell"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
break;
|
break;
|
||||||
case SHOP_ERROR_IS_NOT_ROCKETS:
|
case SHOP_ERROR_IS_NOT_ROCKETS:
|
||||||
/// For when the player attempts to buy rockets or rocket capacity
|
/// For when the player attempts to buy rockets or rocket capacity
|
||||||
/// while secondary weapon is either laser or charge cannon.
|
/// while secondary weapon is either laser or charge cannon.
|
||||||
gfx_renderUnicode(_("Rockets cannot be bought for Laser or Charger Cannon"), 5, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
gfx_renderUnicode(_("Rockets cannot be bought for Laser or Charger Cannon"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
break;
|
break;
|
||||||
case SHOP_ERROR_ALREADY_OWNED:
|
case SHOP_ERROR_ALREADY_OWNED:
|
||||||
/// For when the player attempts to buy a weapon they already have.
|
/// For when the player attempts to buy a weapon they already have.
|
||||||
gfx_renderUnicode(_("You already have that weapon"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
gfx_renderUnicode(_("You already have that weapon"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
break;
|
break;
|
||||||
case SHOP_ERROR_WEAPON_CAPACITY:
|
case SHOP_ERROR_WEAPON_CAPACITY:
|
||||||
/// For when the player attempts to increase rocket capacity beyond
|
/// For when the player attempts to increase rocket capacity beyond
|
||||||
/// what is allowed for the weapon (used for homing missiles).
|
/// what is allowed for the weapon (used for homing missiles).
|
||||||
gfx_renderUnicode(_("This weapon's ammo limit has been reached"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
gfx_renderUnicode(_("This weapon's ammo limit has been reached"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (shopItems[shopSelectedItem].price != 0)
|
if (shopItems[shopSelectedItem].price != 0)
|
||||||
|
@ -425,9 +426,9 @@ static void drawShop()
|
||||||
snprintf(description, STRMAX, _("%s (N/A)"),
|
snprintf(description, STRMAX, _("%s (N/A)"),
|
||||||
shopItems[shopSelectedItem].description);
|
shopItems[shopSelectedItem].description);
|
||||||
}
|
}
|
||||||
gfx_renderUnicode(shopItems[shopSelectedItem].name, 5, 22,
|
gfx_renderUnicode(shopItems[shopSelectedItem].name, 20, 22,
|
||||||
FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
gfx_renderUnicode(description, 20, 38, FONT_CYAN, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
gfx_renderUnicode(description, 10, 38, FONT_CYAN, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -645,8 +646,8 @@ static void buy(int i)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SHOP_ROCKET_AMMO:
|
case SHOP_ROCKET_AMMO:
|
||||||
if ((player.weaponType[1] == W_CHARGER) ||
|
if ((player.weaponType[1] == W_CHARGER)
|
||||||
(player.weaponType[1] == W_LASER))
|
|| (player.weaponType[1] == W_LASER))
|
||||||
{
|
{
|
||||||
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
|
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
|
||||||
return;
|
return;
|
||||||
|
@ -656,20 +657,20 @@ static void buy(int i)
|
||||||
shopSelectedItem = SHOP_ERROR_AMMO_LIMIT;
|
shopSelectedItem = SHOP_ERROR_AMMO_LIMIT;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((player.weaponType[1] == W_HOMING_MISSILE) &&
|
if ((player.weaponType[1] == W_HOMING_MISSILE)
|
||||||
(player.ammo[1] >= MAX_HOMING))
|
&& (player.ammo[1] >= MAX_HOMING))
|
||||||
{
|
{
|
||||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES) &&
|
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES)
|
||||||
(player.ammo[1] >= MAX_DOUBLE_HOMING))
|
&& (player.ammo[1] >= MAX_DOUBLE_HOMING))
|
||||||
{
|
{
|
||||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES) &&
|
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES)
|
||||||
(player.ammo[1] >= MAX_MICRO_HOMING))
|
&& (player.ammo[1] >= MAX_MICRO_HOMING))
|
||||||
{
|
{
|
||||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||||
return;
|
return;
|
||||||
|
@ -723,26 +724,26 @@ static void buy(int i)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SHOP_ROCKET_MAX_AMMO:
|
case SHOP_ROCKET_MAX_AMMO:
|
||||||
if ((player.weaponType[1] == W_CHARGER) ||
|
if ((player.weaponType[1] == W_CHARGER)
|
||||||
(player.weaponType[1] == W_LASER))
|
|| (player.weaponType[1] == W_LASER))
|
||||||
{
|
{
|
||||||
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
|
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((player.weaponType[1] == W_HOMING_MISSILE) &&
|
if ((player.weaponType[1] == W_HOMING_MISSILE)
|
||||||
(game.maxRocketAmmo >= MAX_HOMING))
|
&& (game.maxRocketAmmo >= MAX_HOMING))
|
||||||
{
|
{
|
||||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES) &&
|
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES)
|
||||||
(game.maxRocketAmmo >= MAX_DOUBLE_HOMING))
|
&& (game.maxRocketAmmo >= MAX_DOUBLE_HOMING))
|
||||||
{
|
{
|
||||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES) &&
|
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES)
|
||||||
(game.maxRocketAmmo >= MAX_MICRO_HOMING))
|
&& (game.maxRocketAmmo >= MAX_MICRO_HOMING))
|
||||||
{
|
{
|
||||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||||
return;
|
return;
|
||||||
|
@ -1113,8 +1114,8 @@ void shop_show()
|
||||||
screen_blit(gfx_shopSprites[SHOP_S_CATALOG], SHOP_X, SHOP_Y + 50);
|
screen_blit(gfx_shopSprites[SHOP_S_CATALOG], SHOP_X, SHOP_Y + 50);
|
||||||
screen_blit(gfx_shopSprites[SHOP_S_ITEM_INFO], SHOP_X, SHOP_Y + 180);
|
screen_blit(gfx_shopSprites[SHOP_S_ITEM_INFO], SHOP_X, SHOP_Y + 180);
|
||||||
screen_blit(gfx_shopSprites[SHOP_S_PRIMARY], SHOP_X, SHOP_Y + 245);
|
screen_blit(gfx_shopSprites[SHOP_S_PRIMARY], SHOP_X, SHOP_Y + 245);
|
||||||
screen_blit(gfx_shopSprites[SHOP_S_POWERUP], SHOP_X + 203, SHOP_Y + 245);
|
screen_blit(gfx_shopSprites[SHOP_S_POWERUP], SHOP_X + 199, SHOP_Y + 245);
|
||||||
screen_blit(gfx_shopSprites[SHOP_S_SECONDARY], SHOP_X + 406, SHOP_Y + 245);
|
screen_blit(gfx_shopSprites[SHOP_S_SECONDARY], SHOP_X + 407, SHOP_Y + 245);
|
||||||
|
|
||||||
if (shopSelectedItem > SHOP_NOTHING)
|
if (shopSelectedItem > SHOP_NOTHING)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
101
src/title.c
101
src/title.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2012, 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -131,6 +131,19 @@ static void createOptionsMenu()
|
||||||
gfx_createTextObject(TS_AUTOPAUSE, _("AUTOPAUSE - ON"), 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_AUTOPAUSE, _("AUTOPAUSE - ON"), 0, 0, FONT_WHITE);
|
||||||
else
|
else
|
||||||
gfx_createTextObject(TS_AUTOPAUSE, _("AUTOPAUSE - OFF"), 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_AUTOPAUSE, _("AUTOPAUSE - OFF"), 0, 0, FONT_WHITE);
|
||||||
|
|
||||||
|
if (engine.radioLife == RADIO_LIFE_INSTANT)
|
||||||
|
gfx_createTextObject(TS_RADIO_SPEED, _("MESSAGE SPEED - INSTANT"), 0, 0, FONT_WHITE);
|
||||||
|
else if (engine.radioLife == RADIO_LIFE_FAST)
|
||||||
|
gfx_createTextObject(TS_RADIO_SPEED, _("MESSAGE SPEED - FAST"), 0, 0, FONT_WHITE);
|
||||||
|
else if (engine.radioLife == RADIO_LIFE_NORMAL)
|
||||||
|
gfx_createTextObject(TS_RADIO_SPEED, _("MESSAGE SPEED - NORMAL"), 0, 0, FONT_WHITE);
|
||||||
|
else if (engine.radioLife == RADIO_LIFE_SLOW)
|
||||||
|
gfx_createTextObject(TS_RADIO_SPEED, _("MESSAGE SPEED - SLOW"), 0, 0, FONT_WHITE);
|
||||||
|
else if (engine.radioLife == RADIO_LIFE_SLOTH)
|
||||||
|
gfx_createTextObject(TS_RADIO_SPEED, _("MESSAGE SPEED - SLOTH"), 0, 0, FONT_WHITE);
|
||||||
|
else // Shouldn't happen, but adding this just in case
|
||||||
|
gfx_createTextObject(TS_RADIO_SPEED, _("MESSAGE SPEED - ERROR"), 0, 0, FONT_WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int showOptionsMenu()
|
static int showOptionsMenu()
|
||||||
|
@ -139,10 +152,11 @@ static int showOptionsMenu()
|
||||||
screen_blitText(TS_MUSIC, -1, MENU_Y + MENU_SPACING);
|
screen_blitText(TS_MUSIC, -1, MENU_Y + MENU_SPACING);
|
||||||
screen_blitText(TS_FULLSCREEN, -1, MENU_Y + 2 * MENU_SPACING);
|
screen_blitText(TS_FULLSCREEN, -1, MENU_Y + 2 * MENU_SPACING);
|
||||||
screen_blitText(TS_AUTOPAUSE, -1, MENU_Y + 3 * MENU_SPACING);
|
screen_blitText(TS_AUTOPAUSE, -1, MENU_Y + 3 * MENU_SPACING);
|
||||||
|
screen_blitText(TS_RADIO_SPEED, -1, MENU_Y + 4 * MENU_SPACING);
|
||||||
gfx_textSprites[TS_BACK_TO_MAIN_MENU].y = 0;
|
gfx_textSprites[TS_BACK_TO_MAIN_MENU].y = 0;
|
||||||
screen_blitText(TS_BACK_TO_MAIN_MENU, -1, MENU_Y + 5 * MENU_SPACING);
|
screen_blitText(TS_BACK_TO_MAIN_MENU, -1, MENU_Y + 6 * MENU_SPACING);
|
||||||
|
|
||||||
return 5;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void createCheatMenu()
|
static void createCheatMenu()
|
||||||
|
@ -231,8 +245,10 @@ int title_show()
|
||||||
prlogo = gfx_loadImage("gfx/prlogo.png");
|
prlogo = gfx_loadImage("gfx/prlogo.png");
|
||||||
sflogo = gfx_loadImage("gfx/sflogo.png");
|
sflogo = gfx_loadImage("gfx/sflogo.png");
|
||||||
|
|
||||||
|
gfx_createTextObject(TS_DILIGENTCIRCLE, "THE DILIGENT CIRCLE", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_PRESENTS, "PRESENTS", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_PRESENTS, "PRESENTS", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_AN_SDL_GAME, "AN SDL GAME", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_AN_SDL_GAME, "AN SDL GAME", 0, 0, FONT_WHITE);
|
||||||
|
gfx_createTextObject(TS_ORIGINALLY_BY, "ORIGINALLY BY", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_START_NEW_GAME, _("START NEW GAME"), 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_START_NEW_GAME, _("START NEW GAME"), 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_LOAD_GAME, _("LOAD GAME"), 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_LOAD_GAME, _("LOAD GAME"), 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_CONTINUE_CURRENT_GAME, _("CONTINUE CURRENT GAME"), 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_CONTINUE_CURRENT_GAME, _("CONTINUE CURRENT GAME"), 0, 0, FONT_WHITE);
|
||||||
|
@ -252,7 +268,7 @@ int title_show()
|
||||||
5, 0, FONT_WHITE, 0, copyrightText);
|
5, 0, FONT_WHITE, 0, copyrightText);
|
||||||
gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012",
|
gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012",
|
||||||
5, MENU_SPACING, FONT_WHITE, 0, copyrightText);
|
5, MENU_SPACING, FONT_WHITE, 0, copyrightText);
|
||||||
gfx_renderString("Copyright 2015-2019 Layla Marchant",
|
gfx_renderString("Copyright 2015-2020 The Diligent Circle",
|
||||||
5, 2 * MENU_SPACING, FONT_WHITE, 0, copyrightText);
|
5, 2 * MENU_SPACING, FONT_WHITE, 0, copyrightText);
|
||||||
|
|
||||||
snprintf(buildVersion, STRMAX_SHORT, "Version %s", VERSION );
|
snprintf(buildVersion, STRMAX_SHORT, "Version %s", VERSION );
|
||||||
|
@ -295,11 +311,15 @@ int title_show()
|
||||||
|
|
||||||
screen_drawBackground();
|
screen_drawBackground();
|
||||||
|
|
||||||
engine.done = 0;
|
engine.done = ENGINE_RUNNING;
|
||||||
player_flushInput();
|
player_flushInput();
|
||||||
engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
|
engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
|
||||||
|
|
||||||
audio_playMusic("music/walking_among_androids.ogg", 1);
|
#ifdef OLD_MUSIC
|
||||||
|
audio_playMusic("music/Platinum.mod", 1);
|
||||||
|
#else
|
||||||
|
audio_playMusic("music/android_oppression.ogg", 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
while (!engine.done)
|
while (!engine.done)
|
||||||
{
|
{
|
||||||
|
@ -324,23 +344,28 @@ int title_show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((now - then > 2000) && (now - then < 8000) && (!skip))
|
if ((now - then > 2000) && (now - then < 7000) && (!skip))
|
||||||
{
|
{
|
||||||
screen_blit(prlogo, ((screen->w - prlogo->w) / 2), ((screen->h - prlogo->h) / 2));
|
screen_blitText(TS_DILIGENTCIRCLE, -1, screen->h / 2);
|
||||||
}
|
}
|
||||||
else if ((now - then > 9000) && (now - then < 15000) && (!skip))
|
else if ((now - then > 7500) && (now - then < 14250) && (!skip))
|
||||||
{
|
{
|
||||||
screen_blitText(TS_PRESENTS, -1, screen->h / 2);
|
screen_blitText(TS_PRESENTS, -1, screen->h / 2);
|
||||||
}
|
}
|
||||||
else if ((now - then > 16000) && (now - then < 21000) && (!skip))
|
else if ((now - then > 14750) && (now - then < 21500) && (!skip))
|
||||||
{
|
{
|
||||||
screen_blitText(TS_AN_SDL_GAME, -1, screen->h / 2);
|
screen_blitText(TS_AN_SDL_GAME, -1, screen->h / 2);
|
||||||
}
|
}
|
||||||
else if ((now - then > 25500) || (skip))
|
else if ((now - then > 22000) && (now - then < 29000) && (!skip))
|
||||||
|
{
|
||||||
|
screen_blitText(TS_ORIGINALLY_BY, -1, screen->h / 2 - MENU_SPACING);
|
||||||
|
screen_blit(prlogo, ((screen->w - prlogo->w) / 2), screen->h / 2);
|
||||||
|
}
|
||||||
|
else if ((now - then > 29500) || (skip))
|
||||||
{
|
{
|
||||||
screen_blit(sflogo, ((screen->w - sflogo->w) / 2), ((screen->h - sflogo->h) / 3));
|
screen_blit(sflogo, ((screen->w - sflogo->w) / 2), ((screen->h - sflogo->h) / 3));
|
||||||
|
|
||||||
if ((now - then >= 27500) || (skip))
|
if ((now - then >= 33250) || (skip))
|
||||||
{
|
{
|
||||||
optionRec.x = screen->w / 2 - optionRec.w / 2;
|
optionRec.x = screen->w / 2 - optionRec.w / 2;
|
||||||
optionRec.y = (MENU_Y - 4 - MENU_SPACING) + MENU_SPACING * selectedOption;
|
optionRec.y = (MENU_Y - 4 - MENU_SPACING) + MENU_SPACING * selectedOption;
|
||||||
|
@ -431,15 +456,15 @@ int title_show()
|
||||||
selectedOption = 1;
|
selectedOption = 1;
|
||||||
}
|
}
|
||||||
else if (selectedOption == 3)
|
else if (selectedOption == 3)
|
||||||
engine.done = 1;
|
engine.done = ENGINE_CLOSING;
|
||||||
else if (selectedOption == 4)
|
else if (selectedOption == 4)
|
||||||
{
|
{
|
||||||
menuType = MENU_OPTIONS;
|
menuType = MENU_OPTIONS;
|
||||||
selectedOption = 5;
|
selectedOption = 6;
|
||||||
}
|
}
|
||||||
else if (selectedOption == 5)
|
else if (selectedOption == 5)
|
||||||
{
|
{
|
||||||
engine.done = 1;
|
engine.done = ENGINE_CLOSING;
|
||||||
}
|
}
|
||||||
else if (selectedOption == 6)
|
else if (selectedOption == 6)
|
||||||
{
|
{
|
||||||
|
@ -449,15 +474,15 @@ int title_show()
|
||||||
selectedOption = 1;
|
selectedOption = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
engine.done = 1;
|
engine.done = ENGINE_CLOSING;
|
||||||
}
|
}
|
||||||
else if (selectedOption == 7)
|
else if (selectedOption == 7)
|
||||||
engine.done = 1;
|
engine.done = ENGINE_CLOSING;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_DIFFICULTY:
|
case MENU_DIFFICULTY:
|
||||||
if (selectedOption == 1)
|
if (selectedOption == 1)
|
||||||
engine.done = 1;
|
engine.done = ENGINE_CLOSING;
|
||||||
else if (selectedOption == 2)
|
else if (selectedOption == 2)
|
||||||
{
|
{
|
||||||
game.difficulty++;
|
game.difficulty++;
|
||||||
|
@ -474,7 +499,7 @@ int title_show()
|
||||||
case MENU_LOAD:
|
case MENU_LOAD:
|
||||||
if (selectedOption != listLength)
|
if (selectedOption != listLength)
|
||||||
{
|
{
|
||||||
engine.done = 1;
|
engine.done = ENGINE_CLOSING;
|
||||||
continueSaveSlot = selectedOption - 1;
|
continueSaveSlot = selectedOption - 1;
|
||||||
selectedOption = 3;
|
selectedOption = 3;
|
||||||
}
|
}
|
||||||
|
@ -496,7 +521,11 @@ int title_show()
|
||||||
|
|
||||||
if (engine.useMusic)
|
if (engine.useMusic)
|
||||||
{
|
{
|
||||||
audio_playMusic("music/walking_among_androids.ogg", 1);
|
#ifdef OLD_MUSIC
|
||||||
|
audio_playMusic("music/Platinum.mod", 1);
|
||||||
|
#else
|
||||||
|
audio_playMusic("music/android_oppression.ogg", 1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -513,6 +542,21 @@ int title_show()
|
||||||
{
|
{
|
||||||
engine.autoPause = !engine.autoPause;
|
engine.autoPause = !engine.autoPause;
|
||||||
}
|
}
|
||||||
|
else if (selectedOption == 5)
|
||||||
|
{
|
||||||
|
if (engine.radioLife == RADIO_LIFE_INSTANT)
|
||||||
|
engine.radioLife = RADIO_LIFE_FAST;
|
||||||
|
else if (engine.radioLife == RADIO_LIFE_FAST)
|
||||||
|
engine.radioLife = RADIO_LIFE_NORMAL;
|
||||||
|
else if (engine.radioLife == RADIO_LIFE_NORMAL)
|
||||||
|
engine.radioLife = RADIO_LIFE_SLOW;
|
||||||
|
else if (engine.radioLife == RADIO_LIFE_SLOW)
|
||||||
|
engine.radioLife = RADIO_LIFE_SLOTH;
|
||||||
|
else if (engine.radioLife == RADIO_LIFE_SLOTH)
|
||||||
|
engine.radioLife = RADIO_LIFE_INSTANT;
|
||||||
|
else // Just in case
|
||||||
|
engine.radioLife = RADIO_LIFE_NORMAL;
|
||||||
|
}
|
||||||
else if (selectedOption == listLength)
|
else if (selectedOption == listLength)
|
||||||
{
|
{
|
||||||
menuType = MENU_MAIN;
|
menuType = MENU_MAIN;
|
||||||
|
@ -614,7 +658,11 @@ void title_showCredits()
|
||||||
|
|
||||||
screen_drawBackground();
|
screen_drawBackground();
|
||||||
|
|
||||||
|
#ifdef OLD_MUSIC
|
||||||
|
audio_playMusic("music/Solace.s3m", 1);
|
||||||
|
#else
|
||||||
audio_playMusic("music/rise_of_spirit.ogg", 1);
|
audio_playMusic("music/rise_of_spirit.ogg", 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
fp = fopen("data/credits.txt", "rb");
|
fp = fopen("data/credits.txt", "rb");
|
||||||
|
|
||||||
|
@ -653,7 +701,7 @@ void title_showCredits()
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
engine.done = 0;
|
engine.done = ENGINE_RUNNING;
|
||||||
|
|
||||||
engine.keyState[KEY_ESCAPE] = 0;
|
engine.keyState[KEY_ESCAPE] = 0;
|
||||||
engine.keyState[KEY_FIRE] = 0;
|
engine.keyState[KEY_FIRE] = 0;
|
||||||
|
@ -666,10 +714,17 @@ void title_showCredits()
|
||||||
screen_unBuffer();
|
screen_unBuffer();
|
||||||
|
|
||||||
player_getInput();
|
player_getInput();
|
||||||
if (engine.keyState[KEY_ESCAPE] || engine.keyState[KEY_FIRE] ||
|
if (engine.keyState[KEY_ESCAPE] || engine.keyState[KEY_FIRE]
|
||||||
engine.keyState[KEY_ALTFIRE])
|
|| engine.keyState[KEY_ALTFIRE])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Check to see if we need to reposition credits
|
||||||
|
if (credit[0].x != (screen->w - credit[0].image->w) / 2) {
|
||||||
|
for (i=0; i< nCredit; i++) {
|
||||||
|
credit[i].x = (screen->w - credit[i].image->w) / 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
float speed = 0.5;
|
float speed = 0.5;
|
||||||
if (engine.keyState[KEY_DOWN])
|
if (engine.keyState[KEY_DOWN])
|
||||||
speed = 2;
|
speed = 2;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2013 Guus Sliepen
|
Copyright (C) 2011, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Object weapons[W_MAX];
|
Object weapons[W_MAX];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A list of predefined weaponary.
|
A list of predefined weaponry.
|
||||||
*/
|
*/
|
||||||
void weapons_init()
|
void weapons_init()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Parallel Realities
|
Copyright (C) 2003 Parallel Realities
|
||||||
Copyright (C) 2011 Guus Sliepen
|
Copyright (C) 2011 Guus Sliepen
|
||||||
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@riseup.net>
|
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -7,6 +7,6 @@
|
||||||
# Helper script to cross-compile for Windows with MXE.
|
# Helper script to cross-compile for Windows with MXE.
|
||||||
# Note: Before running, be sure to add the MXE usr/bin location to PATH.
|
# Note: Before running, be sure to add the MXE usr/bin location to PATH.
|
||||||
|
|
||||||
./configure --host=i686-w64-mingw32.static SF_RUN_IN_PLACE=1 SF_NOWARN=1
|
./configure --host=i686-w64-mingw32.static SF_RUN_IN_PLACE=1 SF_UNHARDEN=1
|
||||||
make
|
make
|
||||||
mv src/starfighter.exe .
|
mv src/starfighter.exe .
|
||||||
|
|
Loading…
Reference in New Issue