Compare commits
113 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 |
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>
|
||||
License: CC BY 3.0 <http://creativecommons.org/licenses/by/3.0/>
|
||||
Source: http://opengameart.org/content/walking-among-androids-20
|
||||
Author: The Diligent Circle <https://onpon4.github.io>
|
||||
License: CC0 <http://creativecommons.org/publicdomain/zero/1.0/>
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
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>
|
||||
License: CC BY-SA 3.0 <http://creativecommons.org/licenses/by-sa/3.0/>
|
||||
Source: http://opengameart.org/content/fast-high-music
|
||||
Changes: Amplified -1 dB and slowed down 5% with Audacity
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
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
|
||||
Authors:
|
||||
The Diligent Circle <https://onpon4.github.io>
|
||||
Sweetpea
|
||||
License: CC BY 4.0 <https://creativecommons.org/licenses/by/4.0/>
|
||||
Details:
|
||||
Remix of Last Cyber Dance. Last Cyber Dance is by neocrey.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -13,3 +13,4 @@ nobase_dist_pkgdata_DATA = \
|
|||
data/TakaoPGothic.ttf
|
||||
|
||||
EXTRA_DIST = autogen.sh win32build.sh misc
|
||||
|
||||
|
|
26
README.txt
26
README.txt
|
@ -24,19 +24,16 @@ compared to the original:
|
|||
project completed that work by adding music and replacing one
|
||||
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
|
||||
this; some of these include fixing bad writing, making the dialog
|
||||
match new music queues, and giving the characters more personality.
|
||||
|
||||
* In many places, the interface has been considerably improved. As an
|
||||
example, the simplistic target arrow of the original has been replaced
|
||||
with a system of several arrows, one for each ship.
|
||||
|
||||
* Unicode and gettext translation support have been added.
|
||||
* There are several gameplay changes. These changes were mostly done to
|
||||
balance the game better. The original game is contained in the Classic
|
||||
difficulty option, which is nearly identical to the original
|
||||
experience. A few small differences (mainly old bugs that were not
|
||||
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
|
||||
cheats. This is actually because the switch to SDL2 broke the original
|
||||
|
@ -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
|
||||
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.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
|
23
configure.ac
23
configure.ac
|
@ -7,7 +7,7 @@
|
|||
# information. This file is offered as-is, without any warranty.
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([Project: Starfighter], [2.3.3], [diligentcircle@riseup.net], [starfighter])
|
||||
AC_INIT([Project: Starfighter], [2.4], [diligentcircle@riseup.net], [starfighter])
|
||||
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
|
||||
AC_CONFIG_SRCDIR([src/Starfighter.c])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
@ -18,7 +18,6 @@ AC_PROG_CC
|
|||
AC_PROG_INSTALL
|
||||
|
||||
STARFIGHTER_CPPFLAGS="-DVERSION=\\\"$PACKAGE_VERSION\\\""
|
||||
STARFIGHTER_LDADD=""
|
||||
|
||||
# Detect MacOS
|
||||
AC_CANONICAL_HOST
|
||||
|
@ -39,7 +38,7 @@ PKG_CHECK_EXISTS([SDL2_mixer], [
|
|||
], [
|
||||
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image SDL2_mixer])
|
||||
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], [
|
||||
|
@ -47,25 +46,32 @@ PKG_CHECK_EXISTS([SDL2_mixer], [
|
|||
], [
|
||||
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image])
|
||||
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"
|
||||
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], [
|
||||
], [
|
||||
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_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_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_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)])
|
||||
AS_IF([test -n "$SF_WARN"], [
|
||||
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"], [
|
||||
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DSCREEN_WIDTH=$SF_SCREEN_WIDTH"
|
||||
echo "Using default screen width of $SF_SCREEN_WIDTH"
|
||||
|
@ -84,6 +90,11 @@ AS_IF([test -n "$SF_NOFONT"], [
|
|||
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"], [
|
||||
echo "Preparing a run-in-place build"
|
||||
])
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
030 +++ ADDITIONAL PROGRAMMING +++
|
||||
020 Richard Sweeney
|
||||
020 Guus Sliepen
|
||||
020 Layla Marchant
|
||||
020 The Diligent Circle
|
||||
050 +++ QUALITY ASSURANCE AND ADVICE +++
|
||||
030 Sam Lantinga Ian Bissett
|
||||
020 Chris Taylor Xan Christoph Reichenbach
|
||||
|
@ -45,15 +45,14 @@
|
|||
020 p0ss
|
||||
020 Berklee
|
||||
050 +++ MUSIC +++
|
||||
030 Zander Noriega
|
||||
020 maxstack
|
||||
020 Deceased Superior Technician
|
||||
020 matthew.pablo
|
||||
020 tgfcoder
|
||||
020 JunglistMilitia
|
||||
020 neocrey
|
||||
020 WeskerHunter
|
||||
020 Jan125
|
||||
020 The Diligent Circle
|
||||
020 Sweetpea
|
||||
020 Alexandr Zhelanov
|
||||
050 +++ SPECIAL THANKS +++
|
||||
030 Wes Whitmore Ceri Done
|
||||
|
@ -65,5 +64,5 @@
|
|||
350 Project: Starfighter
|
||||
020 Copyright 2003 Parallel Realities
|
||||
020 Copyright 2012 Guus Sliepen, Astrid S. de Wijn and others
|
||||
020 Copyright 2015-2020 Layla Marchant
|
||||
020 Copyright 2015-2020 The Diligent Circle
|
||||
120 pr-starfighter.github.io
|
||||
|
|
|
@ -14,5 +14,7 @@ nobase_dist_loc_DATA = \
|
|||
pr-starfighter.pot \
|
||||
en.po \
|
||||
ja.po \
|
||||
nl.po \
|
||||
en/LC_MESSAGES/pr-starfighter.mo \
|
||||
ja/LC_MESSAGES/pr-starfighter.mo
|
||||
ja/LC_MESSAGES/pr-starfighter.mo \
|
||||
nl/LC_MESSAGES/pr-starfighter.mo
|
||||
|
|
682
locale/en.po
682
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
677
locale/ja.po
677
locale/ja.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
|
@ -4,9 +4,12 @@
|
|||
# information. This file is offered as-is, without any warranty.
|
||||
|
||||
desktopdir = $(datarootdir)/applications
|
||||
desktop_DATA = starfighter.desktop
|
||||
desktop_DATA = io.github.pr_starfighter.starfighter.desktop
|
||||
|
||||
icondir = $(datarootdir)/pixmaps
|
||||
icon_DATA = starfighter.png
|
||||
|
||||
dist_man6_MANS = starfighter.6
|
||||
|
||||
appdatadir = $(datarootdir)/metainfo
|
||||
appdata_DATA = io.github.pr_starfighter.starfighter.metainfo.xml
|
||||
|
|
|
@ -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,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 "$@"
|
|
@ -6,15 +6,18 @@
|
|||
musicdir = $(pkgdatadir)/music
|
||||
|
||||
nobase_dist_music_DATA = \
|
||||
death.ogg \
|
||||
android_oppression.ogg \
|
||||
androids_last_dance.ogg \
|
||||
first_cyber_dance.ogg \
|
||||
frozen_jam.ogg \
|
||||
last_cyber_dance.ogg \
|
||||
orbital_colossus.ogg \
|
||||
railjet_short.ogg \
|
||||
RE.ogg \
|
||||
rise_of_spirit.ogg \
|
||||
sleeping_with_androids.ogg \
|
||||
sound_and_silence.ogg \
|
||||
space_dimensions.ogg \
|
||||
through_space.ogg \
|
||||
walking_among_androids.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.
|
@ -3,7 +3,7 @@
|
|||
# http://creativecommons.org/publicdomain/zero/1.0/ for more
|
||||
# information. This file is offered as-is, without any warranty.
|
||||
|
||||
sounddir = $(pkgdatadir)/music
|
||||
sounddir = $(pkgdatadir)/sound
|
||||
|
||||
nobase_dist_sound_DATA = \
|
||||
beamLaser.ogg \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Project: Starfighter
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -114,8 +114,8 @@ int main(int argc, char **argv)
|
|||
cheatCount = 2;
|
||||
if ((strcmp(argv[i], "it") == 0) && (cheatCount == 2))
|
||||
cheatCount = 3;
|
||||
if (((strcmp(argv[i], "better") == 0) && (cheatCount == 3)) ||
|
||||
(strcmp(argv[i], "humansdoitbetter") == 0))
|
||||
if (((strcmp(argv[i], "better") == 0) && (cheatCount == 3))
|
||||
|| (strcmp(argv[i], "humansdoitbetter") == 0))
|
||||
{
|
||||
printf("Humans do it better! Cheats enabled.\n");
|
||||
engine.cheat = 1;
|
||||
|
|
150
src/alien.c
150
src/alien.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012 Guus Sliepen
|
||||
Copyright (C) 2012, 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -84,6 +84,15 @@ void alien_nerf(int index)
|
|||
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()
|
||||
|
@ -1110,8 +1119,8 @@ void aliens_init()
|
|||
barrierSpeed++;
|
||||
}
|
||||
|
||||
if ((game.area == MISN_POSWIC) &&
|
||||
(aliens[i].classDef == CD_BOSS))
|
||||
if ((game.area == MISN_POSWIC)
|
||||
&& (aliens[i].classDef == CD_BOSS))
|
||||
{
|
||||
aliens[i].flags |= FL_IMMORTAL;
|
||||
}
|
||||
|
@ -1144,8 +1153,8 @@ void aliens_init()
|
|||
aliens[ALIEN_BOSS_PART2].dx = -20;
|
||||
aliens[ALIEN_BOSS_PART2].dy = 37;
|
||||
}
|
||||
else if ((game.area == MISN_ELAMALE) ||
|
||||
(game.area == MISN_FELLON))
|
||||
else if ((game.area == MISN_ELAMALE)
|
||||
|| (game.area == MISN_FELLON))
|
||||
{
|
||||
aliens[ALIEN_BOSS].target = &player;
|
||||
aliens[ALIEN_BOSS].x = -screen->w / 2;
|
||||
|
@ -1190,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();
|
||||
|
||||
if ((index == -1) || (game.area == MISN_JUPITER) ||
|
||||
(game.area == MISN_VENUS))
|
||||
if ((index == -1) || (game.area == MISN_JUPITER)
|
||||
|| (game.area == MISN_VENUS))
|
||||
return 0;
|
||||
|
||||
int *alienArray;
|
||||
|
@ -1315,10 +1328,19 @@ int alien_add()
|
|||
&& (game.area != MISN_SIVEDI)
|
||||
&& (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;
|
||||
game.forceMisnTarget = 0;
|
||||
|
||||
if (spawnedMisnTarget != NULL)
|
||||
*spawnedMisnTarget = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (CHANCE(1. / 6.))
|
||||
|
@ -1663,8 +1685,8 @@ void alien_setKlineAI(Object *alien)
|
|||
switch(RANDRANGE(0, 9))
|
||||
{
|
||||
case 0:
|
||||
if ((alien->weaponType[0] != W_DIRSHOCKMISSILE) &&
|
||||
(alien->weaponType[1] != W_MICRO_HOMING_MISSILES))
|
||||
if ((alien->weaponType[0] != W_DIRSHOCKMISSILE)
|
||||
&& (alien->weaponType[1] != W_MICRO_HOMING_MISSILES))
|
||||
alien->flags |= FL_CONTINUOUS_FIRE;
|
||||
alien->dx = ((alien->x - alien->target->x) /
|
||||
((300 / alien->speed) + RANDRANGE(0, 100)));
|
||||
|
@ -1674,9 +1696,9 @@ void alien_setKlineAI(Object *alien)
|
|||
case 1:
|
||||
case 2:
|
||||
// Kline only attacks when he is ready!
|
||||
if ((!(alien->flags & FL_NOFIRE)) &&
|
||||
((game.area == MISN_ELAMALE) ||
|
||||
game.difficulty != DIFFICULTY_ORIGINAL))
|
||||
if ((!(alien->flags & FL_NOFIRE))
|
||||
&& ((game.area == MISN_ELAMALE)
|
||||
|| game.difficulty != DIFFICULTY_ORIGINAL))
|
||||
alien->flags |= FL_DROPMINES;
|
||||
break;
|
||||
case 3:
|
||||
|
@ -1726,8 +1748,8 @@ void alien_searchForTarget(Object *alien)
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((targetEnemy->classDef != CD_CARGOSHIP) &&
|
||||
(targetEnemy->classDef != CD_BOSS))
|
||||
if ((targetEnemy->classDef != CD_CARGOSHIP)
|
||||
&& (targetEnemy->classDef != CD_BOSS))
|
||||
{
|
||||
badTarget = 1;
|
||||
}
|
||||
|
@ -1743,8 +1765,8 @@ void alien_searchForTarget(Object *alien)
|
|||
if (targetEnemy->classDef == CD_BOSS)
|
||||
return;
|
||||
|
||||
if ((targetEnemy->flags & FL_DISABLED) ||
|
||||
(targetEnemy->flags & FL_NOFIRE))
|
||||
if ((targetEnemy->flags & FL_DISABLED)
|
||||
|| (targetEnemy->flags & FL_NOFIRE))
|
||||
badTarget = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1815,8 +1837,8 @@ int alien_checkTarget(Object *alien)
|
|||
return 1;
|
||||
|
||||
// Not at the correct vertical height
|
||||
if ((alien->y < alien->target->y - 15) ||
|
||||
(alien->y > alien->target->y + alien->target->image[0]->h + 15))
|
||||
if ((alien->y < alien->target->y - 15)
|
||||
|| (alien->y > alien->target->y + alien->target->image[0]->h + 15))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
|
@ -1830,11 +1852,11 @@ int alien_enemiesInFront(Object *alien)
|
|||
{
|
||||
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
||||
{
|
||||
if ((alien != &aliens[i]) && (aliens[i].flags & FL_WEAPCO) &&
|
||||
(aliens[i].shield > 0))
|
||||
if ((alien != &aliens[i]) && (aliens[i].flags & FL_WEAPCO)
|
||||
&& (aliens[i].shield > 0))
|
||||
{
|
||||
if ((alien->y > aliens[i].y - 15) &&
|
||||
(alien->y < aliens[i].y + aliens[i].image[0]->h + 15))
|
||||
if ((alien->y > aliens[i].y - 15)
|
||||
&& (alien->y < aliens[i].y + aliens[i].image[0]->h + 15))
|
||||
{
|
||||
if ((alien->face == 1) && (aliens[i].x < alien->x))
|
||||
return 1;
|
||||
|
@ -1859,7 +1881,7 @@ void alien_move(Object *alien)
|
|||
|
||||
if (alien->owner == alien)
|
||||
{
|
||||
if (alien->flags & FL_CIRCLES)
|
||||
if ((alien->flags & FL_CIRCLES) && (!(alien->flags & FL_LEAVESECTOR)))
|
||||
{
|
||||
if (alien->face == 0)
|
||||
{
|
||||
|
@ -1886,14 +1908,18 @@ void alien_move(Object *alien)
|
|||
{
|
||||
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
||||
{
|
||||
if ((aliens[i].owner != alien) && (aliens[i].active) &&
|
||||
(aliens[i].shield > 0) && (!(aliens[i].flags & FL_LEAVESECTOR)) &&
|
||||
(alien->classDef != CD_BARRIER) &&
|
||||
ship_collision(alien, &aliens[i]))
|
||||
if ((aliens[i].owner != alien) && (aliens[i].active)
|
||||
&& (aliens[i].shield > 0)
|
||||
&& (!(aliens[i].flags & FL_LEAVESECTOR))
|
||||
&& (alien->classDef != CD_BARRIER)
|
||||
&& ship_collision(alien, &aliens[i]))
|
||||
{
|
||||
if ((game.difficulty == DIFFICULTY_ORIGINAL) && (alien->classDef != CD_DRONE) &&
|
||||
(alien->classDef != CD_ASTEROID) && (alien->classDef != CD_ASTEROID2) &&
|
||||
(alien->owner == alien) && (game.area != MISN_ELLESH))
|
||||
if ((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
&& (alien->classDef != CD_DRONE)
|
||||
&& (alien->classDef != CD_ASTEROID)
|
||||
&& (alien->classDef != CD_ASTEROID2)
|
||||
&& (alien->owner == alien)
|
||||
&& (game.area != MISN_ELLESH))
|
||||
{
|
||||
collided = 1;
|
||||
}
|
||||
|
@ -1978,8 +2004,8 @@ void alien_destroy(Object *alien, Object *attacker)
|
|||
audio_playSound(SFX_EXPLOSION, alien->x, alien->y);
|
||||
|
||||
// Chain reaction damage if needed (Classic Difficulty version)
|
||||
if ((game.difficulty == DIFFICULTY_ORIGINAL) &&
|
||||
(alien->owner != alien) && (alien->flags & FL_DAMAGEOWNER))
|
||||
if ((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
&& (alien->owner != alien) && (alien->flags & FL_DAMAGEOWNER))
|
||||
{
|
||||
alien_hurt(alien->owner, attacker, alien->maxShield, 0);
|
||||
}
|
||||
|
@ -2015,8 +2041,8 @@ void alien_destroy(Object *alien, Object *attacker)
|
|||
}
|
||||
}
|
||||
|
||||
if (CHANCE(1 / 16.) && (alien->flags & FL_WEAPCO) &&
|
||||
(!(alien->flags & FL_NOBANTER)))
|
||||
if (CHANCE(1 / 16.) && (alien->flags & FL_WEAPCO)
|
||||
&& (!(alien->flags & FL_NOBANTER)))
|
||||
{
|
||||
radio_getRandomMessage(msg, _(
|
||||
/// Chris brag messages
|
||||
|
@ -2048,8 +2074,8 @@ void alien_destroy(Object *alien, Object *attacker)
|
|||
else if (attacker->classDef == CD_PHOEBE)
|
||||
{
|
||||
game.wingMate1Kills++;
|
||||
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO) &&
|
||||
(!(alien->flags & FL_NOBANTER)))
|
||||
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO)
|
||||
&& (!(alien->flags & FL_NOBANTER)))
|
||||
{
|
||||
radio_getRandomMessage(msg, _(
|
||||
/// Phoebe brag messages
|
||||
|
@ -2063,7 +2089,7 @@ void alien_destroy(Object *alien, Object *attacker)
|
|||
"Target destroyed!\n"
|
||||
"One more for me!\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"
|
||||
"Take that, WEAPCO!\n"
|
||||
"My kill count is going up!\n"
|
||||
|
@ -2077,8 +2103,8 @@ void alien_destroy(Object *alien, Object *attacker)
|
|||
else if (attacker->classDef == CD_URSULA)
|
||||
{
|
||||
game.wingMate2Kills++;
|
||||
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO) &&
|
||||
(!(alien->flags & FL_NOBANTER)))
|
||||
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO)
|
||||
&& (!(alien->flags & FL_NOBANTER)))
|
||||
{
|
||||
radio_getRandomMessage(msg, _(
|
||||
/// Ursula brag messages
|
||||
|
@ -2169,6 +2195,7 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
|||
int ai_type;
|
||||
double run_chance;
|
||||
int stage1_shield, stage2_shield, stage3_shield;
|
||||
int i;
|
||||
|
||||
ai_type = ((game.difficulty == DIFFICULTY_ORIGINAL) ?
|
||||
alien->AITypeOriginal : alien->AIType);
|
||||
|
@ -2190,15 +2217,14 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
|||
if (game.area == MISN_ELAMALE)
|
||||
{
|
||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
stage1_shield = alien->maxShield * 3 / 8;
|
||||
stage1_shield = KLINE_SHIELD_MEDIUM;
|
||||
else
|
||||
stage1_shield = alien->maxShield / 4;
|
||||
stage1_shield = KLINE_SHIELD_SMALL;
|
||||
|
||||
if ((alien->shield <= alien->maxShield - stage1_shield)
|
||||
&& !(alien->flags & FL_LEAVESECTOR))
|
||||
{
|
||||
alien->flags |= FL_LEAVESECTOR;
|
||||
alien->flags &= ~FL_CIRCLES;
|
||||
/// Dialog (Kline Kethlan)
|
||||
/// Used when Kline is beaten in the Elamale mission.
|
||||
radio_setMessage(FS_KLINE, _("Seems I underestimated you, Bainfield. We'll meet again!"), 1);
|
||||
|
@ -2207,15 +2233,14 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
|||
else if (game.area == MISN_EARTH)
|
||||
{
|
||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
stage1_shield = alien->maxShield / 4;
|
||||
stage1_shield = KLINE_SHIELD_SMALL;
|
||||
else
|
||||
stage1_shield = alien->maxShield * 3 / 8;
|
||||
stage1_shield = KLINE_SHIELD_MEDIUM;
|
||||
|
||||
if ((alien->shield <= alien->maxShield - stage1_shield)
|
||||
&& !(alien->flags & FL_LEAVESECTOR))
|
||||
{
|
||||
alien->flags |= FL_LEAVESECTOR;
|
||||
alien->flags &= ~FL_CIRCLES;
|
||||
/// Dialog (Sid Wilson)
|
||||
/// Used when Kline is beaten in the Earth mission.
|
||||
radio_setMessage(FS_SID, _("Chris, Kethlan is getting away!"), 1);
|
||||
|
@ -2223,9 +2248,9 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
|||
}
|
||||
else if (game.area == MISN_VENUS)
|
||||
{
|
||||
stage1_shield = alien->maxShield * 3 / 4;
|
||||
stage2_shield = alien->maxShield / 2;
|
||||
stage3_shield = alien->maxShield / 4;
|
||||
stage1_shield = KLINE_STAGE1_SHIELD;
|
||||
stage2_shield = KLINE_STAGE2_SHIELD;
|
||||
stage3_shield = KLINE_STAGE3_SHIELD;
|
||||
|
||||
if (alien->shield + damage > stage1_shield
|
||||
&& alien->shield <= stage1_shield)
|
||||
|
@ -2251,23 +2276,32 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
|||
}
|
||||
else
|
||||
{
|
||||
stage1_shield = alien->maxShield / 20;
|
||||
stage1_shield = KLINE_SHIELD_TINY;
|
||||
if ((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||
&& (game.difficulty > DIFFICULTY_EASY))
|
||||
{
|
||||
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
||||
{
|
||||
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))
|
||||
alien->flags |= FL_LEAVESECTOR;
|
||||
alien->flags &= ~FL_CIRCLES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run_chance = (game.difficulty == DIFFICULTY_ORIGINAL) ? 0.02 : damage / 50.;
|
||||
|
||||
if ((alien->flags & FL_RUNSAWAY) && CHANCE(run_chance))
|
||||
{
|
||||
alien->flags |= FL_LEAVESECTOR;
|
||||
}
|
||||
|
||||
audio_playSound(SFX_HIT, alien->x, alien->y);
|
||||
if (ai_type == AI_EVASIVE)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -29,7 +29,7 @@ extern Object aliens[ALIEN_MAX];
|
|||
void alien_nerf(int index);
|
||||
void alien_defs_init();
|
||||
void aliens_init();
|
||||
int alien_add();
|
||||
int alien_add(int *spawnedMisnTarget);
|
||||
void alien_addDrone(Object *hostAlien);
|
||||
void alien_addSmallAsteroid(Object *hostAlien);
|
||||
void alien_addFriendly(int type);
|
||||
|
|
97
src/audio.c
97
src/audio.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
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 "structs.h"
|
||||
|
||||
#include "alien.h"
|
||||
#include "game.h"
|
||||
#include "engine.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 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));
|
||||
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))
|
||||
return;
|
||||
|
@ -109,8 +111,8 @@ void audio_playSound(int sid, float x, float y)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Mix_Playing(channel) && (volume <= MIX_MAX_VOLUME / 4) &&
|
||||
(channelVolume[channel] >= MIX_MAX_VOLUME * 3 / 4))
|
||||
if (Mix_Playing(channel) && (volume <= max_volume / 4)
|
||||
&& (channelVolume[channel] >= max_volume * 3 / 4))
|
||||
return;
|
||||
else
|
||||
channelVolume[channel] = volume;
|
||||
|
@ -169,6 +171,14 @@ void audio_setMusicVolume(int volume)
|
|||
#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)
|
||||
{
|
||||
#ifndef NOSOUND
|
||||
|
@ -176,7 +186,7 @@ void audio_playMusic(const char *filename, int loops)
|
|||
{
|
||||
audio_haltMusic();
|
||||
music = Mix_LoadMUS(filename);
|
||||
audio_setMusicVolume(100);
|
||||
audio_setMusicVolume(MIX_MAX_VOLUME);
|
||||
Mix_PlayMusic(music, loops);
|
||||
}
|
||||
#endif
|
||||
|
@ -188,25 +198,94 @@ void audio_playRandomTrack()
|
|||
if ((!engine.useMusic) || (!engine.useAudio))
|
||||
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;
|
||||
char track[][64] = {
|
||||
char track[][PATH_MAX] = {
|
||||
"music/railjet_short.ogg", "music/space_dimensions.ogg",
|
||||
"music/frozen_jam.ogg", "music/sound_and_silence.ogg"
|
||||
};
|
||||
#endif
|
||||
|
||||
switch(game.area)
|
||||
switch (game.area)
|
||||
{
|
||||
#ifndef OLD_MUSIC
|
||||
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;
|
||||
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_ELAMALE:
|
||||
case MISN_ELLESH:
|
||||
case MISN_EARTH:
|
||||
#ifdef OLD_MUSIC
|
||||
audio_playMusic("music/HardTranceDub.mod", -1);
|
||||
#else
|
||||
audio_playMusic("music/orbital_colossus.ogg", -1);
|
||||
#endif
|
||||
break;
|
||||
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;
|
||||
default:
|
||||
audio_playMusic(track[rand() % tracks], -1);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -29,6 +29,7 @@ void audio_haltMusic();
|
|||
void audio_pauseMusic();
|
||||
void audio_resumeMusic();
|
||||
void audio_setMusicVolume(int volume);
|
||||
void audio_setMusicPosition(double position);
|
||||
void audio_playMusic(const char *filename, int loops);
|
||||
void audio_playRandomTrack();
|
||||
void audio_free();
|
||||
|
|
11
src/bullet.c
11
src/bullet.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -94,6 +94,15 @@ void bullet_add(Object *theWeapon, Object *attacker, int y, int dy)
|
|||
|
||||
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 (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -45,8 +45,8 @@ void collectable_add(float x, float y, int type, int value, int life)
|
|||
&& (weapons[W_PLAYER_WEAPON].damage <= game.minPlasmaDamage))
|
||||
|| (player.ammo[0] >= game.maxPlasmaAmmo));
|
||||
|
||||
shield_useless = ((game.difficulty == DIFFICULTY_NIGHTMARE) ||
|
||||
(player.shield >= player.maxShield));
|
||||
shield_useless = ((game.difficulty == DIFFICULTY_NIGHTMARE)
|
||||
|| (player.shield >= player.maxShield));
|
||||
|
||||
rockets_useless = ((player.weaponType[1] == W_CHARGER)
|
||||
|| (player.weaponType[1] == W_LASER)
|
||||
|
@ -124,8 +124,7 @@ void collectable_add(float x, float y, int type, int value, int life)
|
|||
type = P_PLASMA_RATE;
|
||||
|
||||
if ((game.difficulty == DIFFICULTY_NIGHTMARE)
|
||||
|| ((game.difficulty != DIFFICULTY_SUPEREASY)
|
||||
&& (game.difficulty != DIFFICULTY_EASY)
|
||||
|| ((game.difficulty > DIFFICULTY_EASY)
|
||||
&& (game.difficulty != DIFFICULTY_ORIGINAL)
|
||||
&& ((game.area == MISN_MOEBO)
|
||||
|| (game.area == MISN_ELAMALE)
|
||||
|
@ -187,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.
|
||||
if ((type == P_SHIELD) && (game.difficulty != DIFFICULTY_ORIGINAL))
|
||||
{
|
||||
if ((game.difficulty == DIFFICULTY_NIGHTMARE) ||
|
||||
(player.shield >= player.maxShield))
|
||||
if ((game.difficulty == DIFFICULTY_NIGHTMARE)
|
||||
|| (player.shield >= player.maxShield))
|
||||
{
|
||||
type = P_CASH;
|
||||
}
|
||||
|
@ -338,24 +337,27 @@ int collectable_numGood()
|
|||
|
||||
while (col != NULL)
|
||||
{
|
||||
if ((col->type != P_MINE) && (col->type != P_ORE) &&
|
||||
((col->type != P_SHIELD) || (player.shield < player.maxShield)) &&
|
||||
((col->type != P_ROCKET) || (player.ammo[1] < game.maxRocketAmmo)) &&
|
||||
((col->type != P_PLASMA_AMMO) || (player.ammo[0] < game.maxPlasmaAmmo)) &&
|
||||
((col->type != P_PLASMA_SHOT) ||
|
||||
(player.ammo[0] < game.maxPlasmaAmmo) ||
|
||||
(weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput)) &&
|
||||
((col->type != P_PLASMA_DAMAGE) ||
|
||||
(player.ammo[0] < game.maxPlasmaAmmo) ||
|
||||
(weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage)) &&
|
||||
((col->type != P_PLASMA_RATE) ||
|
||||
(player.ammo[0] < game.maxPlasmaAmmo) ||
|
||||
(weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate])) &&
|
||||
((col->type != P_SUPER) ||
|
||||
(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])))
|
||||
if ((col->type != P_MINE) && (col->type != P_ORE)
|
||||
&& ((col->type != P_SHIELD)
|
||||
|| (player.shield < player.maxShield))
|
||||
&& ((col->type != P_ROCKET)
|
||||
|| (player.ammo[1] < game.maxRocketAmmo))
|
||||
&& ((col->type != P_PLASMA_AMMO)
|
||||
|| (player.ammo[0] < game.maxPlasmaAmmo))
|
||||
&& ((col->type != P_PLASMA_SHOT)
|
||||
|| (player.ammo[0] < game.maxPlasmaAmmo)
|
||||
|| (weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput))
|
||||
&& ((col->type != P_PLASMA_DAMAGE)
|
||||
|| (player.ammo[0] < game.maxPlasmaAmmo)
|
||||
|| (weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage))
|
||||
&& ((col->type != P_PLASMA_RATE)
|
||||
|| (player.ammo[0] < game.maxPlasmaAmmo)
|
||||
|| (weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate]))
|
||||
&& ((col->type != P_SUPER)
|
||||
|| (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++;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2012, 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012 Guus Sliepen
|
||||
Copyright (C) 2012, 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
18
src/defs.h
18
src/defs.h
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012 Guus Sliepen
|
||||
Copyright (C) 2012, 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -29,8 +29,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#define WRAP_ADD(x, y, a, b) x = (((x) + (y)) + \
|
||||
((x) + (y) < (a) ? ((b) - (a)) : 0) + \
|
||||
((x) + (y) > (b) ? ((a) - (b)) : 0))
|
||||
#define CHANCE(x) ((rand() % RAND_MAX) < ((x) * RAND_MAX))
|
||||
#define RANDRANGE(x, y) (((x) < (y)) ? ((x) + (rand() % (long)(1 + (y) - (x)))) : (x))
|
||||
#define CHANCE(x) (((double)rand() / ((double)RAND_MAX+1)) < (x))
|
||||
#define RANDRANGE(x, y) (((x) < (y)) ? \
|
||||
((x) + (rand() % (long)(1 + (y) - (x)))) : (x))
|
||||
#define DRAND ((double)rand() / RAND_MAX)
|
||||
#define _(s) gettext(s)
|
||||
#define CSDLP(x) (((x) == SDL_PRESSED) ? 1 : 0)
|
||||
|
@ -107,6 +108,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#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
|
||||
|
@ -548,8 +556,10 @@ enum {
|
|||
// Text sprites
|
||||
enum {
|
||||
// Main menu
|
||||
TS_PRESENTS = MAX_INFOLINES,
|
||||
TS_DILIGENTCIRCLE = MAX_INFOLINES,
|
||||
TS_PRESENTS,
|
||||
TS_AN_SDL_GAME,
|
||||
TS_ORIGINALLY_BY,
|
||||
TS_START_NEW_GAME,
|
||||
TS_LOAD_GAME,
|
||||
TS_CONTINUE_CURRENT_GAME,
|
||||
|
|
10
src/engine.c
10
src/engine.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -56,7 +56,7 @@ Engine engine;
|
|||
|
||||
void engine_init()
|
||||
{
|
||||
engine.musicVolume = 100;
|
||||
engine.musicVolume = MIX_MAX_VOLUME;
|
||||
engine.useAudio = 1;
|
||||
|
||||
engine.maxAliens = 9;
|
||||
|
@ -376,7 +376,7 @@ void engine_resetLists()
|
|||
LinkedRect *r1, *r2;
|
||||
|
||||
ob = engine.bulletHead->next;
|
||||
while(ob != NULL)
|
||||
while (ob != NULL)
|
||||
{
|
||||
ob2 = ob;
|
||||
ob = ob->next;
|
||||
|
@ -386,7 +386,7 @@ void engine_resetLists()
|
|||
engine.bulletTail = engine.bulletHead;
|
||||
|
||||
ob = engine.explosionHead->next;
|
||||
while(ob != NULL)
|
||||
while (ob != NULL)
|
||||
{
|
||||
ob2 = ob;
|
||||
ob = ob->next;
|
||||
|
@ -418,7 +418,7 @@ void engine_resetLists()
|
|||
screen_bufferTail = screen_bufferHead;
|
||||
|
||||
ob = engine.debrisHead->next;
|
||||
while(ob != NULL)
|
||||
while (ob != NULL)
|
||||
{
|
||||
ob2 = ob;
|
||||
ob = ob->next;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
10
src/event.c
10
src/event.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2012, 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -48,8 +48,8 @@ void events_init()
|
|||
switch (game.area)
|
||||
{
|
||||
case MISN_INTERCEPTION:
|
||||
if ((aliens[ALIEN_KLINE].classDef == CD_KLINE) &&
|
||||
(aliens[ALIEN_KLINE].active))
|
||||
if ((aliens[ALIEN_KLINE].classDef == CD_KLINE)
|
||||
&& (aliens[ALIEN_KLINE].active))
|
||||
{
|
||||
events[0].time = 2;
|
||||
events[0].face = FS_KLINE;
|
||||
|
@ -399,6 +399,10 @@ void events_init()
|
|||
events[1].face = FS_KLINE;
|
||||
/// Dialog (Kline Kethlan)
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
402
src/game.c
402
src/game.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2012, 2014-2020 Layla Marchant <diligentcircle@riseup.net>
|
||||
Copyright (C) 2012, 2014-2020 The Diligent Circle <diligentcircle@riseup.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -24,6 +24,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "SDL.h"
|
||||
|
||||
#ifndef NOSOUND
|
||||
#include "SDL_mixer.h"
|
||||
#endif
|
||||
|
||||
#include "colors.h"
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
@ -100,6 +104,8 @@ void game_init()
|
|||
game.slavesRescued = 0;
|
||||
game.experimentalShield = 1000;
|
||||
|
||||
game.forceMisnTarget = 1;
|
||||
|
||||
game.timeTaken = 0;
|
||||
|
||||
game.stationedPlanet = -1;
|
||||
|
@ -175,12 +181,7 @@ void game_init()
|
|||
player.weaponType[0] = W_PLAYER_WEAPON;
|
||||
player.weaponType[1] = W_ROCKETS;
|
||||
|
||||
for (int i = 0 ; i < STARS_NUM ; i++)
|
||||
{
|
||||
stars[i].x = rand() % screen->w;
|
||||
stars[i].y = rand() % screen->h;
|
||||
stars[i].speed = 1 + (rand() % 3);
|
||||
}
|
||||
game_setStars();
|
||||
|
||||
weapons_init();
|
||||
mission_init();
|
||||
|
@ -228,6 +229,19 @@ static void game_addDebris(int x, int y, int amount)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Sets star positions. Must do this any time the window size changes.
|
||||
*/
|
||||
void game_setStars()
|
||||
{
|
||||
for (int i = 0 ; i < STARS_NUM ; i++)
|
||||
{
|
||||
stars[i].x = rand() % screen->w;
|
||||
stars[i].y = rand() % screen->h;
|
||||
stars[i].speed = 1 + (rand() % 3);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Simply draws the stars in their positions on screen and moves
|
||||
them around.
|
||||
|
@ -294,10 +308,10 @@ static void game_doCollectables()
|
|||
|
||||
if (collectable->active)
|
||||
{
|
||||
if ((collectable->x + collectable->image->w > 0) &&
|
||||
(collectable->x < screen->w) &&
|
||||
(collectable->y + collectable->image->h > 0) &&
|
||||
(collectable->y < screen->h))
|
||||
if ((collectable->x + collectable->image->w > 0)
|
||||
&& (collectable->x < screen->w)
|
||||
&& (collectable->y + collectable->image->h > 0)
|
||||
&& (collectable->y < screen->h))
|
||||
screen_blit(collectable->image, (int)collectable->x, (int)collectable->y);
|
||||
|
||||
collectable->x += engine.ssx + engine.smx;
|
||||
|
@ -567,9 +581,9 @@ static void game_doCollectables()
|
|||
if (collectable->life < 1)
|
||||
{
|
||||
collectable->active = 0;
|
||||
if ((collectable->type == P_CARGO) ||
|
||||
(collectable->type == P_ESCAPEPOD) ||
|
||||
(collectable->type == P_SLAVES))
|
||||
if ((collectable->type == P_CARGO)
|
||||
|| (collectable->type == P_ESCAPEPOD)
|
||||
|| (collectable->type == P_SLAVES))
|
||||
mission_updateRequirements(M_PROTECT_PICKUP, collectable->type, 1);
|
||||
}
|
||||
|
||||
|
@ -580,9 +594,9 @@ static void game_doCollectables()
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((collectable->type == P_MINE) && (collectable->x >= 0) &&
|
||||
(collectable->x <= screen->w) && (collectable->y >= 0) &&
|
||||
(collectable->y <= screen->h))
|
||||
if ((collectable->type == P_MINE) && (collectable->x >= 0)
|
||||
&& (collectable->x <= screen->w) && (collectable->y >= 0)
|
||||
&& (collectable->y <= screen->h))
|
||||
collectable_explode(collectable);
|
||||
prevCollectable->next = collectable->next;
|
||||
free(collectable);
|
||||
|
@ -708,8 +722,8 @@ static void game_doBullets()
|
|||
okayToHit = 1;
|
||||
if ((bullet->flags & WF_WEAPCO) && (aliens[i].flags & FL_FRIEND))
|
||||
okayToHit = 1;
|
||||
if ((bullet->id == WT_ROCKET) || (bullet->id == WT_LASER) ||
|
||||
(bullet->id == WT_CHARGER))
|
||||
if ((bullet->id == WT_ROCKET) || (bullet->id == WT_LASER)
|
||||
|| (bullet->id == WT_CHARGER))
|
||||
okayToHit = 1;
|
||||
|
||||
if (bullet->owner == aliens[i].owner)
|
||||
|
@ -815,11 +829,12 @@ static void game_doBullets()
|
|||
}
|
||||
|
||||
// Check for bullets hitting player
|
||||
if ((bullet->flags & WF_WEAPCO) || (bullet->id == WT_ROCKET) ||
|
||||
(bullet->id == WT_LASER) || (bullet->id == WT_CHARGER))
|
||||
if ((bullet->flags & WF_WEAPCO) || (bullet->id == WT_ROCKET)
|
||||
|| (bullet->id == WT_LASER) || (bullet->id == WT_CHARGER))
|
||||
{
|
||||
if (bullet->active && (player.shield > 0) &&
|
||||
(bullet->owner != &player) && bullet_collision(bullet, &player))
|
||||
if (bullet->active && (player.shield > 0)
|
||||
&& (bullet->owner != &player)
|
||||
&& bullet_collision(bullet, &player))
|
||||
{
|
||||
old_shield = player.shield;
|
||||
|
||||
|
@ -888,8 +903,7 @@ static void game_doBullets()
|
|||
}
|
||||
}
|
||||
|
||||
if ((game.difficulty != DIFFICULTY_SUPEREASY)
|
||||
&& (game.difficulty != DIFFICULTY_EASY)
|
||||
if ((game.difficulty > DIFFICULTY_EASY)
|
||||
&& ((bullet->owner == &player) || (bullet->id == WT_ROCKET)))
|
||||
{
|
||||
for (int j = 0 ; j < 20 ; j++)
|
||||
|
@ -1024,14 +1038,16 @@ static void game_doAliens()
|
|||
if (aliens[i].face == 0)
|
||||
aliens[i].x = aliens[i].owner->x - aliens[i].dx;
|
||||
else
|
||||
aliens[i].x = aliens[i].owner->x + aliens[i].owner->image[0]->w + aliens[i].dx - aliens[i].image[0]->w;
|
||||
aliens[i].x = (aliens[i].owner->x + aliens[i].dx
|
||||
+ aliens[i].owner->image[0]->w
|
||||
- aliens[i].image[0]->w);
|
||||
|
||||
aliens[i].y = (aliens[i].owner->y + aliens[i].dy);
|
||||
|
||||
if (aliens[i].owner->shield < 1)
|
||||
{
|
||||
if ((aliens[i].classDef != CD_URANUSBOSSWING1) &&
|
||||
(aliens[i].classDef != CD_URANUSBOSSWING2))
|
||||
if ((aliens[i].classDef != CD_URANUSBOSSWING1)
|
||||
&& (aliens[i].classDef != CD_URANUSBOSSWING2))
|
||||
{
|
||||
aliens[i].shield = 0;
|
||||
}
|
||||
|
@ -1052,8 +1068,8 @@ static void game_doAliens()
|
|||
aliens[i].target = &aliens[i];
|
||||
|
||||
// Specific to Sid to stop him pissing about(!)
|
||||
if ((aliens[i].classDef == CD_SID) &&
|
||||
(aliens[i].target->flags & FL_DISABLED))
|
||||
if ((aliens[i].classDef == CD_SID)
|
||||
&& (aliens[i].target->flags & FL_DISABLED))
|
||||
aliens[i].target = &aliens[i];
|
||||
|
||||
if (aliens[i].target == &aliens[i])
|
||||
|
@ -1072,9 +1088,9 @@ static void game_doAliens()
|
|||
}
|
||||
}
|
||||
|
||||
if ((!(aliens[i].flags & FL_DISABLED)) &&
|
||||
(aliens[i].thinktime == 0) && (aliens[i].target != &aliens[i]) &&
|
||||
(aliens[i].owner == &aliens[i]))
|
||||
if ((!(aliens[i].flags & FL_DISABLED))
|
||||
&& (aliens[i].thinktime == 0) && (aliens[i].target != &aliens[i])
|
||||
&& (aliens[i].owner == &aliens[i]))
|
||||
{
|
||||
if (aliens[i].classDef == CD_KLINE)
|
||||
alien_setKlineAI(&aliens[i]);
|
||||
|
@ -1101,9 +1117,9 @@ static void game_doAliens()
|
|||
if (aliens[i].x > aliens[i].target->x) aliens[i].face = 1;
|
||||
}
|
||||
|
||||
if ((game.area == MISN_ELLESH) &&
|
||||
((aliens[i].classDef == CD_BOSS) ||
|
||||
(game.difficulty != DIFFICULTY_ORIGINAL)))
|
||||
if ((game.area == MISN_ELLESH)
|
||||
&& ((aliens[i].classDef == CD_BOSS)
|
||||
|| (game.difficulty != DIFFICULTY_ORIGINAL)))
|
||||
aliens[i].face = 0;
|
||||
|
||||
if ((aliens[i].flags & FL_DEPLOYDRONES) && ((rand() % 300) == 0))
|
||||
|
@ -1122,8 +1138,8 @@ static void game_doAliens()
|
|||
|
||||
if (aliens[i].x >= 5000)
|
||||
{
|
||||
aliens[i].flags -= FL_LEAVESECTOR;
|
||||
aliens[i].flags += FL_ESCAPED;
|
||||
aliens[i].flags &= ~FL_LEAVESECTOR;
|
||||
aliens[i].flags |= FL_ESCAPED;
|
||||
aliens[i].active = 0;
|
||||
|
||||
if (aliens[i].classDef == CD_CLOAKFIGHTER)
|
||||
|
@ -1163,9 +1179,9 @@ static void game_doAliens()
|
|||
aliens[i].dy = 20 + (cosf(barrierLoop + aliens[i].speed) * 40);
|
||||
}
|
||||
|
||||
if ((aliens[i].classDef == CD_MOBILESHIELD) &&
|
||||
(aliens[ALIEN_BOSS].active) &&
|
||||
(aliens[ALIEN_BOSS].shield > 0))
|
||||
if ((aliens[i].classDef == CD_MOBILESHIELD)
|
||||
&& (aliens[ALIEN_BOSS].active)
|
||||
&& (aliens[ALIEN_BOSS].shield > 0))
|
||||
{
|
||||
LIMIT_ADD(aliens[ALIEN_BOSS].shield, 1, 0,
|
||||
aliens[ALIEN_BOSS].maxShield);
|
||||
|
@ -1174,14 +1190,14 @@ static void game_doAliens()
|
|||
LIMIT_ADD(aliens[i].reload[0], -1, 0, 999);
|
||||
LIMIT_ADD(aliens[i].reload[1], -1, 0, 999);
|
||||
|
||||
if ((!(aliens[i].flags & FL_DISABLED)) &&
|
||||
(!(aliens[i].flags & FL_NOFIRE)))
|
||||
if ((!(aliens[i].flags & FL_DISABLED))
|
||||
&& (!(aliens[i].flags & FL_NOFIRE)))
|
||||
{
|
||||
if ((aliens[i].target->shield > 0))
|
||||
canFire = alien_checkTarget(&aliens[i]);
|
||||
|
||||
if (((aliens[i].thinktime % 2) == 0) &&
|
||||
(aliens[i].flags & FL_FRIEND))
|
||||
if (((aliens[i].thinktime % 2) == 0)
|
||||
&& (aliens[i].flags & FL_FRIEND))
|
||||
canFire = alien_enemiesInFront(&aliens[i]);
|
||||
}
|
||||
else
|
||||
|
@ -1193,12 +1209,12 @@ static void game_doAliens()
|
|||
{
|
||||
for (int j = 0 ; j < 2 ; j++)
|
||||
{
|
||||
if ((aliens[i].reload[j] == 0) &&
|
||||
((rand() % 1000 < aliens[i].chance[j]) ||
|
||||
(aliens[i].flags & FL_CONTINUOUS_FIRE)))
|
||||
if ((aliens[i].reload[j] == 0)
|
||||
&& ((rand() % 1000 < aliens[i].chance[j])
|
||||
|| (aliens[i].flags & FL_CONTINUOUS_FIRE)))
|
||||
{
|
||||
if ((aliens[i].weaponType[j] != W_ENERGYRAY) &&
|
||||
(aliens[i].weaponType[j] != W_LASER))
|
||||
if ((aliens[i].weaponType[j] != W_ENERGYRAY)
|
||||
&& (aliens[i].weaponType[j] != W_LASER))
|
||||
{
|
||||
if (aliens[i].weaponType[j] == W_CHARGER)
|
||||
aliens[i].ammo[j] = 50 + rand() % 150;
|
||||
|
@ -1211,8 +1227,8 @@ static void game_doAliens()
|
|||
// Note: ammo[0] is required whether the ray is primary
|
||||
// or secondary because futher below, ammo[0] increases on
|
||||
// any alien that isn't currently firing a ray.
|
||||
else if ((aliens[i].weaponType[j] == W_ENERGYRAY) &&
|
||||
(aliens[i].ammo[0] >= RAY_INTERVAL))
|
||||
else if ((aliens[i].weaponType[j] == W_ENERGYRAY)
|
||||
&& (aliens[i].ammo[0] >= RAY_INTERVAL))
|
||||
{
|
||||
aliens[i].flags += FL_FIRERAY;
|
||||
audio_playSound(SFX_ENERGYRAY, aliens[i].x, aliens[i].y);
|
||||
|
@ -1259,16 +1275,17 @@ static void game_doAliens()
|
|||
|
||||
LIMIT_ADD(aliens[i].hit, -1, 0, 100);
|
||||
|
||||
if ((aliens[i].x + aliens[i].image[0]->w > 0) &&
|
||||
(aliens[i].x < screen->w) &&
|
||||
(aliens[i].y + aliens[i].image[0]->h > 0) &&
|
||||
(aliens[i].y < screen->h))
|
||||
if ((aliens[i].x + aliens[i].image[0]->w > 0)
|
||||
&& (aliens[i].x < screen->w)
|
||||
&& (aliens[i].y + aliens[i].image[0]->h > 0)
|
||||
&& (aliens[i].y < screen->h))
|
||||
{
|
||||
if ((!(aliens[i].flags & FL_DISABLED)) &&
|
||||
(aliens[i].classDef != CD_ASTEROID) &&
|
||||
(aliens[i].classDef != CD_ASTEROID2))
|
||||
if ((!(aliens[i].flags & FL_DISABLED))
|
||||
&& (aliens[i].classDef != CD_ASTEROID)
|
||||
&& (aliens[i].classDef != CD_ASTEROID2))
|
||||
explosion_addEngine(&aliens[i]);
|
||||
if ((!(aliens[i].flags & FL_ISCLOAKED)) || (aliens[i].hit > 0))
|
||||
if ((!(aliens[i].flags & FL_ISCLOAKED))
|
||||
|| (aliens[i].hit > 0))
|
||||
screen_blit(gfx_shipSprites[shapeToUse], (int)aliens[i].x,
|
||||
(int)aliens[i].y);
|
||||
if (aliens[i].flags & FL_DISABLED)
|
||||
|
@ -1320,8 +1337,8 @@ static void game_doAliens()
|
|||
}
|
||||
|
||||
// Adjust the movement even whilst exploding
|
||||
if ((!(aliens[i].flags & FL_NOMOVE)) &&
|
||||
(!(aliens[i].flags & FL_DISABLED)))
|
||||
if ((!(aliens[i].flags & FL_NOMOVE))
|
||||
&& (!(aliens[i].flags & FL_DISABLED)))
|
||||
alien_move(&aliens[i]);
|
||||
|
||||
if ((game.area != MISN_ELLESH) || (aliens[i].shield < 0))
|
||||
|
@ -1360,8 +1377,9 @@ static void game_doPlayer()
|
|||
|
||||
if ((engine.keyState[KEY_ALTFIRE]) && (player.weaponType[1] != W_NONE))
|
||||
{
|
||||
if ((player.weaponType[1] != W_CHARGER) &&
|
||||
(player.weaponType[1] != W_LASER) && (player.ammo[1] > 0))
|
||||
if ((player.weaponType[1] != W_CHARGER)
|
||||
&& (player.weaponType[1] != W_LASER)
|
||||
&& (player.ammo[1] > 0))
|
||||
{
|
||||
ship_fireBullet(&player, 1);
|
||||
}
|
||||
|
@ -1386,9 +1404,9 @@ static void game_doPlayer()
|
|||
|
||||
if (player.weaponType[1] == W_CHARGER)
|
||||
{
|
||||
if (engine.keyState[KEY_ALTFIRE] &&
|
||||
((game.difficulty == DIFFICULTY_ORIGINAL) ||
|
||||
!(engine.keyState[KEY_FIRE])))
|
||||
if (engine.keyState[KEY_ALTFIRE]
|
||||
&& ((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
|| !(engine.keyState[KEY_FIRE])))
|
||||
{
|
||||
if (!player_chargerFired)
|
||||
{
|
||||
|
@ -1424,8 +1442,9 @@ static void game_doPlayer()
|
|||
|
||||
if ((engine.keyState[KEY_SWITCH]))
|
||||
{
|
||||
if ((weapons[W_PLAYER_WEAPON].ammo[0] >= 3) &&
|
||||
(weapons[W_PLAYER_WEAPON].ammo[0] <= game.maxPlasmaOutput))
|
||||
if ((weapons[W_PLAYER_WEAPON].ammo[0] >= 3)
|
||||
&& ((weapons[W_PLAYER_WEAPON].ammo[0] <= game.maxPlasmaOutput)
|
||||
|| (game.difficulty == DIFFICULTY_ORIGINAL)))
|
||||
{
|
||||
weapons[W_PLAYER_WEAPON].flags ^= WF_SPREAD;
|
||||
|
||||
|
@ -1470,9 +1489,9 @@ static void game_doPlayer()
|
|||
|
||||
if (engine.keyState[KEY_ESCAPE])
|
||||
{
|
||||
if ((engine.done == ENGINE_RUNNING) &&
|
||||
(engine.gameSection == SECTION_GAME) &&
|
||||
(mission.remainingObjectives1 == 0))
|
||||
if ((engine.done == ENGINE_RUNNING)
|
||||
&& (engine.gameSection == SECTION_GAME)
|
||||
&& (mission.remainingObjectives1 == 0))
|
||||
{
|
||||
audio_playSound(SFX_FLY, screen->w / 2, screen->h / 2);
|
||||
engine.done = ENGINE_SYSEXIT;
|
||||
|
@ -1486,8 +1505,8 @@ static void game_doPlayer()
|
|||
engine.keyState[KEY_PAUSE] = 0;
|
||||
}
|
||||
|
||||
if ((game.area == MISN_ELLESH) ||
|
||||
(game.area == MISN_MARS))
|
||||
if ((game.area == MISN_ELLESH)
|
||||
|| (game.area == MISN_MARS))
|
||||
{
|
||||
player.face = 0;
|
||||
xmoved = 1;
|
||||
|
@ -1575,8 +1594,8 @@ static void game_doPlayer()
|
|||
LIMIT_ADD(player.hit, -1, 0, 100);
|
||||
|
||||
screen_blit(gfx_shipSprites[shapeToUse], (int)player.x, (int)player.y);
|
||||
if ((player.maxShield > 1) && (player.shield <= engine.lowShield) &&
|
||||
CHANCE(1. / 10))
|
||||
if ((player.maxShield > 1) && (player.shield <= engine.lowShield)
|
||||
&& CHANCE(player.shield > 1 ? 1. / 10 : 3. / 10))
|
||||
explosion_add(player.x + RANDRANGE(-10, 10),
|
||||
player.y + RANDRANGE(-10, 20), SP_SMOKE);
|
||||
}
|
||||
|
@ -1601,7 +1620,7 @@ static void game_doPlayer()
|
|||
/// following the English version only as a general guideline. Any
|
||||
/// number of insults is permitted.
|
||||
"Fool.\n"
|
||||
"And now you're nothing but a DEAD hero.\n"
|
||||
"And now you're nothing but a DEAD hero."
|
||||
));
|
||||
radio_setMessage(FS_KLINE, msg, 1);
|
||||
}
|
||||
|
@ -1658,8 +1677,8 @@ static void game_doPlayer()
|
|||
LIMIT(engine.ssy, -CAMERA_MAX_SPEED, CAMERA_MAX_SPEED);
|
||||
|
||||
// Specific for the mission were you have to chase the Executive Transport
|
||||
if (((game.area == MISN_ELLESH) && (player.shield > 0)) ||
|
||||
(game.area == MISN_MARS))
|
||||
if (((game.area == MISN_ELLESH) && (player.shield > 0))
|
||||
|| (game.area == MISN_MARS))
|
||||
{
|
||||
engine.ssx = -6;
|
||||
engine.ssy = 0;
|
||||
|
@ -1816,41 +1835,41 @@ static void game_doArrow(int i)
|
|||
if (aliens[i].x + aliens[i].image[0]->w < 0)
|
||||
{
|
||||
if (aliens[i].y + aliens[i].image[0]->h < 0)
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
|
||||
(aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_NORTHWEST : SP_ARROW_NORTHWEST);
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||
&& (aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_NORTHWEST : SP_ARROW_NORTHWEST);
|
||||
else if (aliens[i].y > screen->h)
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
|
||||
(aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_SOUTHWEST : SP_ARROW_SOUTHWEST);
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||
&& (aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_SOUTHWEST : SP_ARROW_SOUTHWEST);
|
||||
else
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
|
||||
(aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_WEST : SP_ARROW_WEST);
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||
&& (aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_WEST : SP_ARROW_WEST);
|
||||
}
|
||||
else if (aliens[i].x > screen->w)
|
||||
{
|
||||
if (aliens[i].y + aliens[i].image[0]->h < 0)
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
|
||||
(aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_NORTHEAST : SP_ARROW_NORTHEAST);
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||
&& (aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_NORTHEAST : SP_ARROW_NORTHEAST);
|
||||
else if (aliens[i].y > screen->h)
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
|
||||
(aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_SOUTHEAST : SP_ARROW_SOUTHEAST);
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||
&& (aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_SOUTHEAST : SP_ARROW_SOUTHEAST);
|
||||
else
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
|
||||
(aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_EAST : SP_ARROW_EAST);
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||
&& (aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_EAST : SP_ARROW_EAST);
|
||||
}
|
||||
else if (aliens[i].y + aliens[i].image[0]->h < 0)
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
|
||||
(aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_NORTH : SP_ARROW_NORTH);
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||
&& (aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_NORTH : SP_ARROW_NORTH);
|
||||
else if (aliens[i].y > screen->h)
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
|
||||
(aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_SOUTH : SP_ARROW_SOUTH);
|
||||
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
|
||||
&& (aliens[i].flags & FL_FRIEND)) ?
|
||||
SP_ARROW_FRIEND_SOUTH : SP_ARROW_SOUTH);
|
||||
|
||||
if (arrow != -1)
|
||||
{
|
||||
|
@ -1908,6 +1927,7 @@ static void game_doHud()
|
|||
int tTextIndex;
|
||||
char text[STRMAX_SHORT];
|
||||
float nbars; // A float for the sake of float division
|
||||
float min_shield, max_shield;
|
||||
float shield_pct;
|
||||
int i;
|
||||
int c;
|
||||
|
@ -2038,8 +2058,8 @@ static void game_doHud()
|
|||
events_check();
|
||||
}
|
||||
|
||||
if ((engine.timeMission) && (player.shield > 0) &&
|
||||
((!engine.cheatTime) || (game.area == MISN_MARS)))
|
||||
if ((engine.timeMission) && (player.shield > 0)
|
||||
&& ((!engine.cheatTime) || (game.area == MISN_MARS)))
|
||||
{
|
||||
if (SDL_GetTicks() >= engine.counter)
|
||||
{
|
||||
|
@ -2113,8 +2133,8 @@ static void game_doHud()
|
|||
// Do the target's remaining shield (if required)
|
||||
if (game.area != MISN_DORIM)
|
||||
{
|
||||
if ((engine.targetIndex > -1) && (aliens[engine.targetIndex].shield > 0) &&
|
||||
(engine.targetIndex > engine.maxAliens))
|
||||
if ((engine.targetIndex > -1) && (aliens[engine.targetIndex].shield > 0)
|
||||
&& (engine.targetIndex > engine.maxAliens))
|
||||
{
|
||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
{
|
||||
|
@ -2139,8 +2159,62 @@ static void game_doHud()
|
|||
bar.x = screen->w * 11 / 16 + gfx_textSprites[tTextIndex].image->w + 10;
|
||||
bar.y = screen->h - 50;
|
||||
nbars = 85.;
|
||||
shield_pct = ((float)aliens[engine.targetIndex].shield
|
||||
/ (float)aliens[engine.targetIndex].maxShield);
|
||||
if (engine.targetIndex == ALIEN_KLINE
|
||||
&& game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
{
|
||||
if (game.area == MISN_ELAMALE)
|
||||
{
|
||||
max_shield = aliens[engine.targetIndex].maxShield;
|
||||
min_shield = max_shield - KLINE_SHIELD_MEDIUM;
|
||||
}
|
||||
else if (game.area == MISN_EARTH)
|
||||
{
|
||||
max_shield = aliens[engine.targetIndex].maxShield;
|
||||
min_shield = max_shield - KLINE_SHIELD_SMALL;
|
||||
}
|
||||
else if (game.area == MISN_VENUS)
|
||||
{
|
||||
if (aliens[ALIEN_KLINE].shield > KLINE_STAGE1_SHIELD)
|
||||
{
|
||||
max_shield = aliens[engine.targetIndex].maxShield;
|
||||
min_shield = KLINE_STAGE1_SHIELD;
|
||||
}
|
||||
else if (aliens[ALIEN_KLINE].shield > KLINE_STAGE2_SHIELD)
|
||||
{
|
||||
max_shield = KLINE_STAGE1_SHIELD;
|
||||
min_shield = KLINE_STAGE2_SHIELD;
|
||||
}
|
||||
else if (aliens[ALIEN_KLINE].shield > KLINE_STAGE3_SHIELD)
|
||||
{
|
||||
max_shield = KLINE_STAGE2_SHIELD;
|
||||
min_shield = KLINE_STAGE3_SHIELD;
|
||||
}
|
||||
else
|
||||
{
|
||||
max_shield = KLINE_STAGE3_SHIELD;
|
||||
min_shield = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
max_shield = aliens[engine.targetIndex].maxShield;
|
||||
min_shield = max_shield - KLINE_SHIELD_TINY;
|
||||
}
|
||||
|
||||
if (min_shield > 0)
|
||||
shield_pct = (
|
||||
MAX((float)aliens[engine.targetIndex].shield - min_shield, 1.)
|
||||
/ (max_shield-min_shield));
|
||||
else
|
||||
shield_pct = (
|
||||
((float)aliens[engine.targetIndex].shield - min_shield)
|
||||
/ (max_shield-min_shield));
|
||||
}
|
||||
else
|
||||
{
|
||||
shield_pct = ((float)aliens[engine.targetIndex].shield
|
||||
/ (float)aliens[engine.targetIndex].maxShield);
|
||||
}
|
||||
|
||||
for (i = 0 ; i < nbars ; i++)
|
||||
{
|
||||
|
@ -2379,7 +2453,11 @@ static void game_showGameOver()
|
|||
screen_clear(black);
|
||||
SDL_Delay(1000);
|
||||
|
||||
audio_playMusic("music/death.ogg", -1);
|
||||
#ifdef OLD_MUSIC
|
||||
audio_playMusic("music/Wybierak.mod", -1);
|
||||
#else
|
||||
audio_playMusic("music/sleeping_with_androids.ogg", 0);
|
||||
#endif
|
||||
|
||||
int x = (screen->w - gameover->w) / 2;
|
||||
int y = (screen->h - gameover->h) / 2;
|
||||
|
@ -2416,8 +2494,8 @@ void game_getDifficultyText(char *dest, int difficulty)
|
|||
switch (difficulty)
|
||||
{
|
||||
case DIFFICULTY_SUPEREASY:
|
||||
/// DIFFICULTY_SUPEREASY
|
||||
strcpy(dest, _("Super-Easy"));
|
||||
/// DIFFICULTY_SUPEREASY (Assisted)
|
||||
strcpy(dest, _("Assisted"));
|
||||
break;
|
||||
case DIFFICULTY_EASY:
|
||||
/// DIFFICULTY_EASY
|
||||
|
@ -2446,6 +2524,7 @@ void game_getDifficultyText(char *dest, int difficulty)
|
|||
|
||||
int game_mainLoop()
|
||||
{
|
||||
int spawnedMisnTarget;
|
||||
float chance;
|
||||
|
||||
engine_resetLists();
|
||||
|
@ -2464,8 +2543,12 @@ int game_mainLoop()
|
|||
if (game.area == MISN_ELAMALE)
|
||||
aliens[ALIEN_KLINE].active = 0;
|
||||
|
||||
spawnedMisnTarget = 0;
|
||||
for (int i = 0 ; i < engine.maxAliens ; i++)
|
||||
alien_add();
|
||||
alien_add(&spawnedMisnTarget);
|
||||
|
||||
if (!spawnedMisnTarget)
|
||||
game.forceMisnTarget = 1;
|
||||
|
||||
if (game.hasWingMate1)
|
||||
alien_addFriendly(ALIEN_PHOEBE);
|
||||
|
@ -2473,9 +2556,9 @@ int game_mainLoop()
|
|||
if (game.hasWingMate2)
|
||||
alien_addFriendly(ALIEN_URSULA);
|
||||
|
||||
if ((game.area == MISN_URUSOR) ||
|
||||
(game.area == MISN_POSWIC) ||
|
||||
(game.area == MISN_EARTH))
|
||||
if ((game.area == MISN_URUSOR)
|
||||
|| (game.area == MISN_POSWIC)
|
||||
|| (game.area == MISN_EARTH))
|
||||
alien_addFriendly(ALIEN_SID);
|
||||
|
||||
// Disable Wingmates for certain missions
|
||||
|
@ -2504,7 +2587,7 @@ int game_mainLoop()
|
|||
// Some specifics for interception missions
|
||||
if (game.area == MISN_INTERCEPTION)
|
||||
{
|
||||
if ((game.system > SYSTEM_EYANANTH) && ((rand() % 5) == 0))
|
||||
if ((game.system > SYSTEM_EYANANTH) && CHANCE(1. / 5.))
|
||||
{
|
||||
aliens[ALIEN_KLINE] = alien_defs[CD_KLINE];
|
||||
aliens[ALIEN_KLINE].owner = &aliens[ALIEN_KLINE];
|
||||
|
@ -2517,7 +2600,9 @@ int game_mainLoop()
|
|||
|
||||
if ((game.system == SYSTEM_MORDOR) && (game.experimentalShield > 0))
|
||||
{
|
||||
if ((rand() % 5) > 0)
|
||||
if (CHANCE(4. / 5.)
|
||||
|| (game.difficulty != DIFFICULTY_ORIGINAL
|
||||
&& game.forceMisnTarget))
|
||||
{
|
||||
aliens[ALIEN_BOSS] = alien_defs[CD_CLOAKFIGHTER];
|
||||
aliens[ALIEN_BOSS].owner = &aliens[ALIEN_BOSS];
|
||||
|
@ -2528,14 +2613,33 @@ int game_mainLoop()
|
|||
aliens[ALIEN_BOSS].y = player.y;
|
||||
player_setTarget(ALIEN_BOSS);
|
||||
aliens[ALIEN_BOSS].shield = game.experimentalShield;
|
||||
game.forceMisnTarget = 0;
|
||||
}
|
||||
else
|
||||
game.forceMisnTarget = 1;
|
||||
}
|
||||
|
||||
// Note: music is started here only for interceptions. For
|
||||
// regular missions, it is instead started by
|
||||
// mission_showStartScreen(). This is necessary to ensure the
|
||||
// proper music can be played when Kline or the cloak fighter
|
||||
// are active.
|
||||
audio_playRandomTrack();
|
||||
}
|
||||
|
||||
if (game.area == MISN_VENUS)
|
||||
{
|
||||
aliens[ALIEN_KLINE].x = player.x + 1000;
|
||||
aliens[ALIEN_KLINE].y = player.y;
|
||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
{
|
||||
aliens[ALIEN_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE | FL_NOMOVE;
|
||||
aliens[ALIEN_KLINE].x = screen->w * 3 / 4;
|
||||
aliens[ALIEN_KLINE].y = screen->h / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
aliens[ALIEN_KLINE].x = player.x + 1000;
|
||||
aliens[ALIEN_KLINE].y = player.y;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
||||
|
@ -2596,7 +2700,7 @@ int game_mainLoop()
|
|||
engine.counter2 = (SDL_GetTicks() + 1000);
|
||||
|
||||
engine.missionCompleteTimer = 0;
|
||||
engine.musicVolume = 100;
|
||||
engine.musicVolume = MIX_MAX_VOLUME;
|
||||
|
||||
int rtn = 0;
|
||||
|
||||
|
@ -2604,8 +2708,8 @@ int game_mainLoop()
|
|||
|
||||
for (int i = 0 ; i < 3 ; i++)
|
||||
{
|
||||
if ((mission.primaryType[i] == M_DESTROY_TARGET_TYPE) &&
|
||||
(mission.target1[i] == CD_ANY))
|
||||
if ((mission.primaryType[i] == M_DESTROY_TARGET_TYPE)
|
||||
&& (mission.target1[i] == CD_ANY))
|
||||
allowableAliens = mission.targetValue1[i];
|
||||
|
||||
if (mission.primaryType[i] == M_DESTROY_ALL_TARGETS)
|
||||
|
@ -2650,41 +2754,41 @@ int game_mainLoop()
|
|||
engine.gameSection = SECTION_INTERMISSION;
|
||||
if (player.shield > 0)
|
||||
{
|
||||
if ((SDL_GetTicks() >= engine.missionCompleteTimer) &&
|
||||
((game.difficulty == DIFFICULTY_ORIGINAL) ||
|
||||
(game.difficulty == DIFFICULTY_NIGHTMARE) ||
|
||||
(game.area == MISN_INTERCEPTION) ||
|
||||
(game.area == MISN_ELLESH) ||
|
||||
(game.area == MISN_MARS) ||
|
||||
(mission_checkFailed()) ||
|
||||
(collectable_numGood() <= 0) ||
|
||||
(engine.done == ENGINE_SYSEXIT)))
|
||||
if ((SDL_GetTicks() >= engine.missionCompleteTimer)
|
||||
&& ((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
|| (game.difficulty == DIFFICULTY_NIGHTMARE)
|
||||
|| (game.area == MISN_INTERCEPTION)
|
||||
|| (game.area == MISN_ELLESH)
|
||||
|| (game.area == MISN_MARS)
|
||||
|| (mission_checkFailed())
|
||||
|| (collectable_numGood() <= 0)
|
||||
|| (engine.done == ENGINE_SYSEXIT)))
|
||||
{
|
||||
if ((!mission_checkFailed()) && (game.area != MISN_VENUS))
|
||||
{
|
||||
player_leaveSector();
|
||||
if ((engine.done == ENGINE_SYSEXIT) &&
|
||||
(game.area != MISN_DORIM) &&
|
||||
(game.area != MISN_SIVEDI))
|
||||
if ((engine.done == ENGINE_SYSEXIT)
|
||||
&& (game.area != MISN_DORIM)
|
||||
&& (game.area != MISN_SIVEDI))
|
||||
{
|
||||
if ((aliens[ALIEN_PHOEBE].shield > 0) &&
|
||||
(game.area != MISN_EARTH))
|
||||
if ((aliens[ALIEN_PHOEBE].shield > 0)
|
||||
&& (game.area != MISN_EARTH))
|
||||
{
|
||||
aliens[ALIEN_PHOEBE].x = player.x - 40;
|
||||
aliens[ALIEN_PHOEBE].y = player.y - 35;
|
||||
aliens[ALIEN_PHOEBE].face = 0;
|
||||
}
|
||||
|
||||
if ((aliens[ALIEN_URSULA].shield > 0) &&
|
||||
(game.area != MISN_EARTH))
|
||||
if ((aliens[ALIEN_URSULA].shield > 0)
|
||||
&& (game.area != MISN_EARTH))
|
||||
{
|
||||
aliens[ALIEN_URSULA].x = player.x - 40;
|
||||
aliens[ALIEN_URSULA].y = player.y + 45;
|
||||
aliens[ALIEN_URSULA].face = 0;
|
||||
}
|
||||
|
||||
if ((game.area == MISN_URUSOR) ||
|
||||
(game.area == MISN_POSWIC))
|
||||
if ((game.area == MISN_URUSOR)
|
||||
|| (game.area == MISN_POSWIC))
|
||||
{
|
||||
aliens[ALIEN_SID].x = player.x - 100;
|
||||
aliens[ALIEN_SID].y = player.y;
|
||||
|
@ -2692,9 +2796,10 @@ int game_mainLoop()
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ((game.area == MISN_VENUS) &&
|
||||
(engine.musicVolume > 0))
|
||||
else if ((game.area == MISN_VENUS)
|
||||
&& (engine.musicVolume > 0))
|
||||
{
|
||||
player_getInput();
|
||||
engine.keyState[KEY_UP] = 0;
|
||||
engine.keyState[KEY_DOWN] = 0;
|
||||
engine.keyState[KEY_LEFT] = 0;
|
||||
|
@ -2703,7 +2808,7 @@ int game_mainLoop()
|
|||
engine.keyState[KEY_ALTFIRE] = 0;
|
||||
engine.xaxis = 0;
|
||||
engine.yaxis = 0;
|
||||
LIMIT_ADD(engine.musicVolume, -0.2, 0, 100);
|
||||
LIMIT_ADD(engine.musicVolume, -0.2, 0, MIX_MAX_VOLUME);
|
||||
audio_setMusicVolume(engine.musicVolume);
|
||||
}
|
||||
else
|
||||
|
@ -2718,7 +2823,8 @@ int game_mainLoop()
|
|||
}
|
||||
else
|
||||
{
|
||||
LIMIT_ADD(engine.musicVolume, -0.2, 0, 100);
|
||||
player_getInput();
|
||||
LIMIT_ADD(engine.musicVolume, -0.2, 0, MIX_MAX_VOLUME);
|
||||
audio_setMusicVolume(engine.musicVolume);
|
||||
if (SDL_GetTicks() >= engine.missionCompleteTimer)
|
||||
{
|
||||
|
@ -2798,7 +2904,7 @@ int game_mainLoop()
|
|||
WRAP_ADD(engine.addAliens, -1, 0, mission.addAliens);
|
||||
if ((engine.addAliens == 0) && (allowableAliens > 0))
|
||||
{
|
||||
allowableAliens -= alien_add();
|
||||
allowableAliens -= alien_add(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2806,8 +2912,8 @@ int game_mainLoop()
|
|||
engine.missionCompleteTimer = SDL_GetTicks() + 7000;
|
||||
|
||||
// specific to Boss 1
|
||||
if ((game.area == MISN_MOEBO) &&
|
||||
(aliens[ALIEN_BOSS].flags & FL_ESCAPED))
|
||||
if ((game.area == MISN_MOEBO)
|
||||
&& (aliens[ALIEN_BOSS].flags & FL_ESCAPED))
|
||||
{
|
||||
audio_playSound(SFX_DEATH, aliens[ALIEN_BOSS].x, aliens[ALIEN_BOSS].y);
|
||||
screen_clear(white);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -64,6 +64,9 @@ typedef struct Game_ {
|
|||
// remaining shield for experimental fighter
|
||||
int experimentalShield;
|
||||
|
||||
// Whether to force interception targets to appear
|
||||
int forceMisnTarget;
|
||||
|
||||
Uint32 timeTaken; // In seconds
|
||||
int missionCompleted[MAX_PLANETS];
|
||||
|
||||
|
@ -99,6 +102,7 @@ extern Game game;
|
|||
extern char game_systemNames[SYSTEM_MAX][STRMAX_SHORT];
|
||||
|
||||
void game_init();
|
||||
void game_setStars();
|
||||
void game_doStars();
|
||||
void game_doExplosions();
|
||||
void game_delayFrame();
|
||||
|
|
10
src/gfx.c
10
src/gfx.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -646,9 +646,11 @@ void gfx_createTextObject(int index, const char *inString, int x, int y, int fon
|
|||
gfx_textSprites[index].life = 0;
|
||||
|
||||
/* 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 &&
|
||||
gfx_textSprites[index].fontColor == fontColor &&
|
||||
!strcmp(gfx_textSprites[index].text, inString))
|
||||
// TODO: Double-check this, I think it's trying to test if gfx_textSprites[index].image is NULL.
|
||||
// Also, check what `text` will be when "empty".
|
||||
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].y = y;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2012, 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -179,6 +179,7 @@ void intermission_updateSystemStatus()
|
|||
game.stationedPlanet = 0;
|
||||
game.system = 1;
|
||||
game.area = MISN_RESCUESLAVES;
|
||||
game.forceMisnTarget = 1;
|
||||
intermission_initPlanets(game.system);
|
||||
|
||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
|
@ -189,6 +190,7 @@ void intermission_updateSystemStatus()
|
|||
game.stationedPlanet = 0;
|
||||
game.system = 2;
|
||||
game.area = MISN_CLOAKFIGHTER;
|
||||
game.forceMisnTarget = 1;
|
||||
intermission_initPlanets(game.system);
|
||||
|
||||
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);
|
||||
screen_blit(intermission_planets[planet].image, r.x, r.y);
|
||||
|
||||
if (selectable &&
|
||||
game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6,
|
||||
r.x, r.y, intermission_planets[planet].image->w,
|
||||
intermission_planets[planet].image->h))
|
||||
if (selectable
|
||||
&& game_collision(engine.cursor_x + 13, engine.cursor_y + 13,
|
||||
6, 6, r.x, r.y, intermission_planets[planet].image->w,
|
||||
intermission_planets[planet].image->h))
|
||||
{
|
||||
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++)
|
||||
{
|
||||
y += 20;
|
||||
if ((i == TS_CHRIS_HEADER) || (i == TS_PHOEBE_HEADER) ||
|
||||
(i == TS_URSULA_HEADER))
|
||||
if ((i == TS_CHRIS_HEADER) || (i == TS_PHOEBE_HEADER)
|
||||
|| (i == TS_URSULA_HEADER))
|
||||
y += 25;
|
||||
|
||||
gfx_textSprites[i].y = y;
|
||||
|
@ -1057,7 +1059,7 @@ static void intermission_createMissionDetailSurface(SDL_Surface *comms, int miss
|
|||
|
||||
case MISN_FELLON:
|
||||
/// 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);
|
||||
|
||||
/// Mission dialog: Mordor, Fellon (Chris Bainfield)
|
||||
|
@ -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))
|
||||
{
|
||||
engine.useMusic = 1;
|
||||
#ifdef OLD_MUSIC
|
||||
audio_playMusic("music/3DParadise.mod", -1);
|
||||
#else
|
||||
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))
|
||||
|
@ -1461,8 +1467,7 @@ int intermission()
|
|||
intermission_createCommsSurface(commsSurface);
|
||||
|
||||
// Remove the Supercharge, if it is there
|
||||
if ((game.difficulty != DIFFICULTY_SUPEREASY)
|
||||
&& (game.difficulty != DIFFICULTY_EASY)
|
||||
if ((game.difficulty > DIFFICULTY_EASY)
|
||||
&& (game.difficulty != DIFFICULTY_ORIGINAL))
|
||||
{
|
||||
weapons[W_PLAYER_WEAPON].reload[0] = MAX(
|
||||
|
@ -1500,7 +1505,11 @@ int intermission()
|
|||
}
|
||||
|
||||
if ((engine.useAudio) && (engine.useMusic))
|
||||
#ifdef OLD_MUSIC
|
||||
audio_playMusic("music/3DParadise.mod", -1);
|
||||
#else
|
||||
audio_playMusic("music/through_space.ogg", -1);
|
||||
#endif
|
||||
|
||||
/// Retain "%s" as-is. It is replaced with the current system name.
|
||||
snprintf(string, STRMAX_SHORT, _("System : %s"), game_systemNames[game.system]);
|
||||
|
@ -1729,8 +1738,8 @@ int intermission()
|
|||
x = screen->w / 16;
|
||||
y = screen->h - 80;
|
||||
w = screen->w - 2 * x - 32;
|
||||
if ((game.stationedPlanet == game.destinationPlanet) &&
|
||||
(!intermission_planets[game.stationedPlanet].missionCompleted))
|
||||
if ((game.stationedPlanet == game.destinationPlanet)
|
||||
&& (!intermission_planets[game.stationedPlanet].missionCompleted))
|
||||
screen_blit(gfx_sprites[SP_START_MISSION], x, y);
|
||||
else if (game.stationedPlanet != game.destinationPlanet)
|
||||
screen_blit(gfx_sprites[SP_GOTO], x, y);
|
||||
|
@ -1743,9 +1752,9 @@ int intermission()
|
|||
screen_blit(gfx_sprites[SP_OPTIONS], x + 6 * w / 7, 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) &&
|
||||
((game.stationedPlanet != game.destinationPlanet) ||
|
||||
(!intermission_planets[game.stationedPlanet].missionCompleted)))
|
||||
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x, y, 32, 32)
|
||||
&& ((game.stationedPlanet != game.destinationPlanet)
|
||||
|| (!intermission_planets[game.stationedPlanet].missionCompleted)))
|
||||
{
|
||||
if (game.stationedPlanet == game.destinationPlanet)
|
||||
screen_blitText(TS_INFO_START_MISSION, -1, screen->h - 25);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2012, 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -565,8 +565,8 @@ static void mission_killAllEnemies()
|
|||
{
|
||||
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
||||
{
|
||||
if ((aliens[i].flags & FL_WEAPCO) && (aliens[i].active) &&
|
||||
(aliens[i].shield > 0))
|
||||
if ((aliens[i].flags & FL_WEAPCO) && (aliens[i].active)
|
||||
&& (aliens[i].shield > 0))
|
||||
aliens[i].shield = 0;
|
||||
}
|
||||
}
|
||||
|
@ -596,13 +596,13 @@ void mission_checkTimer()
|
|||
}
|
||||
|
||||
// specific to Spirit Boss
|
||||
if ((game.area == MISN_MOEBO) &&
|
||||
(mission.completed1[0] < OB_INCOMPLETE))
|
||||
if ((game.area == MISN_MOEBO)
|
||||
&& (mission.completed1[0] < OB_INCOMPLETE))
|
||||
engine.timeMission = 1;
|
||||
|
||||
// specific to the Asteroid belt
|
||||
if ((game.area == MISN_MARS) &&
|
||||
(mission.completed1[0] < OB_INCOMPLETE))
|
||||
if ((game.area == MISN_MARS)
|
||||
&& (mission.completed1[0] < OB_INCOMPLETE))
|
||||
{
|
||||
mission.completed1[0] = OB_COMPLETED;
|
||||
mission_killAllEnemies();
|
||||
|
@ -616,8 +616,8 @@ static void mission_evaluate(int type, int id, int *completed, int *targetValue,
|
|||
char message[STRMAX_SHORT];
|
||||
char fmt[STRMAX_SHORT];
|
||||
|
||||
if ((*targetValue <= 0) && (type != M_PROTECT_TARGET) &&
|
||||
(type != M_PROTECT_PICKUP))
|
||||
if ((*targetValue <= 0) && (type != M_PROTECT_TARGET)
|
||||
&& (type != M_PROTECT_PICKUP))
|
||||
{
|
||||
*completed = OB_JUST_COMPLETED;
|
||||
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.primaryType[i] == type) &&
|
||||
((mission.target1[i] == id) ||
|
||||
(mission.target1[i] == CD_ANY)))
|
||||
if ((mission.primaryType[i] == type)
|
||||
&& ((mission.target1[i] == id)
|
||||
|| (mission.target1[i] == CD_ANY)))
|
||||
{
|
||||
matched = 1;
|
||||
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.secondaryType[i] == type) &&
|
||||
((mission.target2[i] == id) ||
|
||||
(mission.target2[i] == CD_ANY)))
|
||||
if ((mission.secondaryType[i] == type)
|
||||
&& ((mission.target2[i] == id)
|
||||
|| (mission.target2[i] == CD_ANY)))
|
||||
{
|
||||
mission.targetValue2[i] -= value;
|
||||
mission_evaluate(type, id, &mission.completed2[i], &mission.targetValue2[i], FONT_YELLOW);
|
||||
|
@ -924,7 +924,11 @@ static int mission_revealObjectives()
|
|||
aliens[ALIEN_KLINE].y = player.y;
|
||||
aliens[ALIEN_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE;
|
||||
player_setTarget(ALIEN_KLINE);
|
||||
#ifdef OLD_MUSIC
|
||||
audio_playMusic("music/TranceGeneration.mod", -1);
|
||||
#else
|
||||
audio_playMusic("music/last_cyber_dance.ogg", -1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -937,7 +941,9 @@ int mission_checkCompleted()
|
|||
{
|
||||
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_checkTimer();
|
||||
|
@ -949,7 +955,9 @@ int mission_checkCompleted()
|
|||
{
|
||||
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_checkTimer();
|
||||
|
@ -983,10 +991,10 @@ int mission_checkCompleted()
|
|||
mission.completed1[i] = OB_COMPLETED;
|
||||
|
||||
// do some area specific things
|
||||
if ((game.area == MISN_MOEBO) ||
|
||||
(game.area == MISN_DORIM) ||
|
||||
(game.area == MISN_ELLESH) ||
|
||||
(game.area == MISN_MARS))
|
||||
if ((game.area == MISN_MOEBO)
|
||||
|| (game.area == MISN_DORIM)
|
||||
|| (game.area == MISN_ELLESH)
|
||||
|| (game.area == MISN_MARS))
|
||||
{
|
||||
if (mission.remainingObjectives2 == 0)
|
||||
{
|
||||
|
@ -1017,8 +1025,8 @@ int mission_checkCompleted()
|
|||
mission.completed2[i] = OB_COMPLETED;
|
||||
|
||||
// do some area specific things
|
||||
if ((game.area == MISN_DORIM) &&
|
||||
(mission.remainingObjectives1 == 0))
|
||||
if ((game.area == MISN_DORIM)
|
||||
&& (mission.remainingObjectives1 == 0))
|
||||
{
|
||||
mission_killAllEnemies();
|
||||
engine.addAliens = -1;
|
||||
|
@ -1167,10 +1175,12 @@ void mission_showStartScreen()
|
|||
gfx_createTextObject(TS_POWER, "Power", 0, 0, FONT_WHITE);
|
||||
gfx_createTextObject(TS_OUTPUT, "Output", 0, 0, FONT_WHITE);
|
||||
gfx_createTextObject(TS_COOLER, "Cooler", 0, 0, FONT_WHITE);
|
||||
audio_playRandomTrack();
|
||||
|
||||
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();
|
||||
|
||||
player_flushInput();
|
||||
|
@ -1222,17 +1232,17 @@ void mission_showStartScreen()
|
|||
break;
|
||||
}
|
||||
|
||||
if ((game.area == MISN_URUSOR) ||
|
||||
(game.area == MISN_POSWIC) ||
|
||||
(game.area == MISN_EARTH))
|
||||
if ((game.area == MISN_URUSOR)
|
||||
|| (game.area == MISN_POSWIC)
|
||||
|| (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);
|
||||
|
||||
renderer_update();
|
||||
|
||||
game_delayFrame();
|
||||
player_getInput();
|
||||
if ((engine.keyState[KEY_FIRE]) || (engine.keyState[KEY_ALTFIRE]) ||
|
||||
(engine.keyState[KEY_ESCAPE]))
|
||||
if ((engine.keyState[KEY_FIRE]) || (engine.keyState[KEY_ALTFIRE])
|
||||
|| (engine.keyState[KEY_ESCAPE]))
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
35
src/player.c
35
src/player.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2012, 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -49,8 +49,14 @@ Initialises the player for a new game.
|
|||
void player_init()
|
||||
{
|
||||
player.active = 1;
|
||||
player.x = screen->w / 2;
|
||||
player.y = screen->h / 2;
|
||||
if (game.difficulty == DIFFICULTY_ORIGINAL) {
|
||||
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.systemPower = player.maxShield;
|
||||
player.face = 0;
|
||||
|
@ -99,14 +105,14 @@ void player_damage(int amount, int delay)
|
|||
|
||||
player_resetDamageDelay = 0;
|
||||
|
||||
if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0) &&
|
||||
((!player.hit) ||
|
||||
(game.difficulty == DIFFICULTY_ORIGINAL) ||
|
||||
((player.shield != engine.lowShield) &&
|
||||
(player.shield != 1))))
|
||||
if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0)
|
||||
&& ((!player.hit)
|
||||
|| (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
|| ((player.shield != engine.lowShield)
|
||||
&& (player.shield != 1))))
|
||||
{
|
||||
if ((game.difficulty == DIFFICULTY_ORIGINAL) ||
|
||||
(player_damageDelay >= delay))
|
||||
if ((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||
|| (player_damageDelay >= delay))
|
||||
{
|
||||
player.shield -= amount;
|
||||
|
||||
|
@ -115,8 +121,8 @@ void player_damage(int amount, int delay)
|
|||
audio_playSound(SFX_HIT, player.x, player.y);
|
||||
|
||||
// Damage tiers (not in Classic mode)
|
||||
if ((oldshield > engine.lowShield) &&
|
||||
(player.shield <= engine.lowShield))
|
||||
if ((oldshield > engine.lowShield)
|
||||
&& (player.shield <= engine.lowShield))
|
||||
{
|
||||
info_setLine("!!! WARNING: SHIELD LOW !!!", FONT_RED);
|
||||
if (game.difficulty != DIFFICULTY_ORIGINAL)
|
||||
|
@ -452,6 +458,7 @@ void player_getInput()
|
|||
if (engine.event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED)
|
||||
{
|
||||
screen_adjustDimensions(engine.event.window.data1, engine.event.window.data2);
|
||||
game_setStars();
|
||||
renderer_reset();
|
||||
gfx_scaleBackground();
|
||||
screen_clear(black);
|
||||
|
@ -460,8 +467,8 @@ void player_getInput()
|
|||
screen_addBuffer(0, 0, screen->w, screen->h);
|
||||
}
|
||||
|
||||
if (engine.autoPause &&
|
||||
(engine.event.window.event == SDL_WINDOWEVENT_FOCUS_LOST))
|
||||
if (engine.autoPause
|
||||
&& (engine.event.window.event == SDL_WINDOWEVENT_FOCUS_LOST))
|
||||
engine.paused = 1;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
46
src/save.c
46
src/save.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -160,42 +160,42 @@ int save_load(int slot)
|
|||
{
|
||||
case 4:
|
||||
case 5:
|
||||
if ((fscanf(fp, "%d%*c", &game.difficulty) < 1) ||
|
||||
(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.minPlasmaOutputLimit, &game.maxPlasmaRateLimit,
|
||||
&game.maxPlasmaDamageLimit, &game.maxPlasmaOutputLimit,
|
||||
&game.maxPlasmaAmmoLimit, &game.maxRocketAmmoLimit) < 8) ||
|
||||
(fscanf(fp, "%d %d %d%*c%*[^\n]%*c", &game.system, &game.area,
|
||||
&game.stationedPlanet) < 3) ||
|
||||
(fscanf(fp, "%d %d%*c", &game.hasWingMate1, &game.hasWingMate2) < 2) ||
|
||||
(fscanf(fp, "%d %d %d %d%*c", &player.maxShield,
|
||||
&player.ammo[0], &player.ammo[1], &player.weaponType[1]) < 4) ||
|
||||
(fscanf(fp, "%d %d %d%*c",
|
||||
&game.maxPlasmaAmmoLimit, &game.maxRocketAmmoLimit) < 8)
|
||||
|| (fscanf(fp, "%d %d %d%*c%*[^\n]%*c", &game.system, &game.area,
|
||||
&game.stationedPlanet) < 3)
|
||||
|| (fscanf(fp, "%d %d%*c", &game.hasWingMate1, &game.hasWingMate2) < 2)
|
||||
|| (fscanf(fp, "%d %d %d %d%*c", &player.maxShield,
|
||||
&player.ammo[0], &player.ammo[1], &player.weaponType[1]) < 4)
|
||||
|| (fscanf(fp, "%d %d %d%*c",
|
||||
&weapons[W_PLAYER_WEAPON].ammo[0],
|
||||
&weapons[W_PLAYER_WEAPON].damage,
|
||||
&weapons[W_PLAYER_WEAPON].reload[0]) < 3) ||
|
||||
(fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
|
||||
&weapons[W_PLAYER_WEAPON].reload[0]) < 3)
|
||||
|| (fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
|
||||
&game.minPlasmaRate, &game.minPlasmaDamage,
|
||||
&game.minPlasmaOutput, &game.maxPlasmaRate,
|
||||
&game.maxPlasmaDamage, &game.maxPlasmaOutput,
|
||||
&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",
|
||||
&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",
|
||||
&game.missionCompleted[0], &game.missionCompleted[1],
|
||||
&game.missionCompleted[2], &game.missionCompleted[3],
|
||||
&game.missionCompleted[4], &game.missionCompleted[5],
|
||||
&game.missionCompleted[6], &game.missionCompleted[7],
|
||||
&game.missionCompleted[8], &game.missionCompleted[9]) < 10) ||
|
||||
(fscanf(fp, "%d%*c", &game.experimentalShield) < 1) ||
|
||||
(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",
|
||||
&game.missionCompleted[8], &game.missionCompleted[9]) < 10)
|
||||
|| (fscanf(fp, "%d%*c", &game.experimentalShield) < 1)
|
||||
|| (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",
|
||||
&game.shots, &game.hits, &game.accuracy, &game.totalKills,
|
||||
&game.wingMate1Kills, &game.wingMate2Kills,
|
||||
&game.wingMate1Ejects, &game.wingMate2Ejects,
|
||||
&game.totalOtherKills, &game.shieldPickups,
|
||||
&game.rocketPickups, &game.cellPickups, &game.powerups,
|
||||
&game.minesKilled, &game.slavesRescued) < 15) ||
|
||||
(fscanf(fp, "%lu%*c", &timeTaken) < 1))
|
||||
&game.minesKilled, &game.slavesRescued) < 15)
|
||||
|| (fscanf(fp, "%lu%*c", &timeTaken) < 1))
|
||||
{
|
||||
printf("Warning: Save data is not correctly formatted. Some data may be lost.\n");
|
||||
}
|
||||
|
@ -352,9 +352,9 @@ void save_createSurface(SDL_Surface *savesSurface, int clickedSlot)
|
|||
gfx_drawRect(savesSurface, 5, 265, 100, 25, 0x00, 0x99, 0x00);
|
||||
gfx_drawRect(savesSurface, 125, 265, 100, 25, 0x99, 0x99, 0x00);
|
||||
gfx_drawRect(savesSurface, 243, 265, 100, 25, 0x99, 0x00, 0x00);
|
||||
gfx_renderUnicode(_("SAVE"), 40, 270, FONT_WHITE, 0, savesSurface);
|
||||
gfx_renderUnicode(_("CANCEL"), 150, 270, FONT_WHITE, 0, savesSurface);
|
||||
gfx_renderUnicode(_("DELETE"), 270, 270, FONT_WHITE, 0, savesSurface);
|
||||
gfx_renderUnicode(_("SAVE"), 10, 270, FONT_WHITE, 0, savesSurface);
|
||||
gfx_renderUnicode(_("CANCEL"), 130, 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(_("CANCEL will unselect that slot"), 17, 220, 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) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
19
src/ship.c
19
src/ship.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -68,8 +68,8 @@ void ship_fireBullet(Object *ship, int weaponIndex)
|
|||
return;
|
||||
|
||||
// Remove some ammo from the player
|
||||
if ((ship == &player) && (player.weaponType[weaponIndex] != W_LASER) &&
|
||||
(player.ammo[weaponIndex] > 0) && (!engine.cheatAmmo))
|
||||
if ((ship == &player) && (player.weaponType[weaponIndex] != W_LASER)
|
||||
&& (player.ammo[weaponIndex] > 0) && (!engine.cheatAmmo))
|
||||
player.ammo[weaponIndex]--;
|
||||
|
||||
switch(theWeapon->id)
|
||||
|
@ -130,8 +130,8 @@ void ship_fireBullet(Object *ship, int weaponIndex)
|
|||
// Reset the weapon reload time. Double it if it is not friendly or
|
||||
// a boss or Kline
|
||||
ship->reload[weaponIndex] = theWeapon->reload[0];
|
||||
if ((ship->flags & FL_WEAPCO) && (ship != &aliens[ALIEN_BOSS]) &&
|
||||
(ship != &aliens[ALIEN_KLINE]) && (theWeapon->id != W_LASER))
|
||||
if ((ship->flags & FL_WEAPCO) && (ship != &aliens[ALIEN_BOSS])
|
||||
&& (ship != &aliens[ALIEN_KLINE]) && (theWeapon->id != W_LASER))
|
||||
ship->reload[weaponIndex] *= 2;
|
||||
|
||||
if ((ship == &player) && (weaponIndex == 0))
|
||||
|
@ -173,8 +173,9 @@ void ship_fireRay(Object *ship)
|
|||
if (player.shield > 0)
|
||||
{
|
||||
if (game_collision(player.x, player.y, player.image[0]->w,
|
||||
player.image[0]->h, ray.x, ray.y, ray.w, ray.h) &&
|
||||
(!engine.cheatShield) && (engine.missionCompleteTimer == 0))
|
||||
player.image[0]->h, ray.x, ray.y, ray.w, ray.h)
|
||||
&& (!engine.cheatShield)
|
||||
&& (engine.missionCompleteTimer == 0))
|
||||
{
|
||||
player_damage(1, RAY_DAMAGE_DELAY);
|
||||
explosion_add(player.x, player.y, SP_SMALL_EXPLOSION);
|
||||
|
@ -187,8 +188,8 @@ void ship_fireRay(Object *ship)
|
|||
if (aliens[i].flags & FL_IMMORTAL)
|
||||
continue;
|
||||
|
||||
if ((aliens[i].shield > 0) && (ship != &aliens[i]) &&
|
||||
(ship->classDef != aliens[i].classDef))
|
||||
if ((aliens[i].shield > 0) && (ship != &aliens[i])
|
||||
&& (ship->classDef != aliens[i].classDef))
|
||||
{
|
||||
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))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2015-2020 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
|
||||
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) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
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]);
|
||||
|
||||
if ((player.weaponType[1] != W_LASER) &&
|
||||
(player.weaponType[1] != W_CHARGER) && (player.weaponType[1] != W_NONE))
|
||||
if ((player.weaponType[1] != W_LASER)
|
||||
&& (player.weaponType[1] != W_CHARGER)
|
||||
&& (player.weaponType[1] != W_NONE))
|
||||
{
|
||||
/// Retain "%d" as-is. It is replaced with the rocket capacity of the Firefly.
|
||||
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_POWERUP] = gfx_createSurface(190, 91);
|
||||
gfx_shopSprites[SHOP_S_SECONDARY] = gfx_createSurface(190, 91);
|
||||
gfx_shopSprites[SHOP_S_PRIMARY] = gfx_createSurface(194, 91);
|
||||
gfx_shopSprites[SHOP_S_POWERUP] = gfx_createSurface(203, 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, 189, 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, 189, 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, 189, 20, 0x00, 0x00, 0x99);
|
||||
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 193, 90, 0x00, 0x00, 0x55);
|
||||
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 193, 20, 0x00, 0x00, 0x99);
|
||||
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 202, 90, 0x00, 0x00, 0x55);
|
||||
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 202, 20, 0x00, 0x00, 0x99);
|
||||
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 193, 90, 0x00, 0x00, 0x55);
|
||||
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_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_RATE:
|
||||
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, 189, 20, 0x99, 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, 202, 20, 0x99, 0x00, 0x00);
|
||||
break;
|
||||
case SHOP_PLASMA_MIN_OUTPUT:
|
||||
case SHOP_PLASMA_MIN_DAMAGE:
|
||||
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, 189, 20, 0x99, 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, 193, 20, 0x99, 0x00, 0x00);
|
||||
break;
|
||||
case SHOP_PLASMA_AMMO:
|
||||
case SHOP_ROCKET_AMMO:
|
||||
gfx_drawRect(gfx_shopSprites[SHOP_S_SHIP_INFO], 0, 0, SHOP_WIDTH, 40, 0x33, 0x00, 0x00);
|
||||
break;
|
||||
default:
|
||||
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 189, 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, 90, 0x55, 0x00, 0x00);
|
||||
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 193, 20, 0x99, 0x00, 0x00);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -365,7 +366,7 @@ static void drawShop()
|
|||
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, 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)
|
||||
{
|
||||
|
@ -373,40 +374,40 @@ static void drawShop()
|
|||
break;
|
||||
case SHOP_ERROR_INSUFFICIENT_FUNDS:
|
||||
/// 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;
|
||||
case SHOP_ERROR_CANNOT_UPGRADE:
|
||||
/// 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).
|
||||
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;
|
||||
case SHOP_ERROR_AMMO_LIMIT:
|
||||
/// 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;
|
||||
case SHOP_ERROR_CANNOT_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;
|
||||
case SHOP_ERROR_NOTHING_TO_SELL:
|
||||
/// 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;
|
||||
case SHOP_ERROR_IS_NOT_ROCKETS:
|
||||
/// For when the player attempts to buy rockets or rocket capacity
|
||||
/// 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;
|
||||
case SHOP_ERROR_ALREADY_OWNED:
|
||||
/// 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;
|
||||
case SHOP_ERROR_WEAPON_CAPACITY:
|
||||
/// For when the player attempts to increase rocket capacity beyond
|
||||
/// 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;
|
||||
default:
|
||||
if (shopItems[shopSelectedItem].price != 0)
|
||||
|
@ -425,9 +426,9 @@ static void drawShop()
|
|||
snprintf(description, STRMAX, _("%s (N/A)"),
|
||||
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]);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -645,8 +646,8 @@ static void buy(int i)
|
|||
break;
|
||||
|
||||
case SHOP_ROCKET_AMMO:
|
||||
if ((player.weaponType[1] == W_CHARGER) ||
|
||||
(player.weaponType[1] == W_LASER))
|
||||
if ((player.weaponType[1] == W_CHARGER)
|
||||
|| (player.weaponType[1] == W_LASER))
|
||||
{
|
||||
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
|
||||
return;
|
||||
|
@ -656,20 +657,20 @@ static void buy(int i)
|
|||
shopSelectedItem = SHOP_ERROR_AMMO_LIMIT;
|
||||
return;
|
||||
}
|
||||
if ((player.weaponType[1] == W_HOMING_MISSILE) &&
|
||||
(player.ammo[1] >= MAX_HOMING))
|
||||
if ((player.weaponType[1] == W_HOMING_MISSILE)
|
||||
&& (player.ammo[1] >= MAX_HOMING))
|
||||
{
|
||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||
return;
|
||||
}
|
||||
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES) &&
|
||||
(player.ammo[1] >= MAX_DOUBLE_HOMING))
|
||||
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES)
|
||||
&& (player.ammo[1] >= MAX_DOUBLE_HOMING))
|
||||
{
|
||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||
return;
|
||||
}
|
||||
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES) &&
|
||||
(player.ammo[1] >= MAX_MICRO_HOMING))
|
||||
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES)
|
||||
&& (player.ammo[1] >= MAX_MICRO_HOMING))
|
||||
{
|
||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||
return;
|
||||
|
@ -723,26 +724,26 @@ static void buy(int i)
|
|||
break;
|
||||
|
||||
case SHOP_ROCKET_MAX_AMMO:
|
||||
if ((player.weaponType[1] == W_CHARGER) ||
|
||||
(player.weaponType[1] == W_LASER))
|
||||
if ((player.weaponType[1] == W_CHARGER)
|
||||
|| (player.weaponType[1] == W_LASER))
|
||||
{
|
||||
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
|
||||
return;
|
||||
}
|
||||
if ((player.weaponType[1] == W_HOMING_MISSILE) &&
|
||||
(game.maxRocketAmmo >= MAX_HOMING))
|
||||
if ((player.weaponType[1] == W_HOMING_MISSILE)
|
||||
&& (game.maxRocketAmmo >= MAX_HOMING))
|
||||
{
|
||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||
return;
|
||||
}
|
||||
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES) &&
|
||||
(game.maxRocketAmmo >= MAX_DOUBLE_HOMING))
|
||||
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES)
|
||||
&& (game.maxRocketAmmo >= MAX_DOUBLE_HOMING))
|
||||
{
|
||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||
return;
|
||||
}
|
||||
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES) &&
|
||||
(game.maxRocketAmmo >= MAX_MICRO_HOMING))
|
||||
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES)
|
||||
&& (game.maxRocketAmmo >= MAX_MICRO_HOMING))
|
||||
{
|
||||
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
|
||||
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_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_POWERUP], SHOP_X + 203, SHOP_Y + 245);
|
||||
screen_blit(gfx_shopSprites[SHOP_S_SECONDARY], SHOP_X + 406, 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 + 407, SHOP_Y + 245);
|
||||
|
||||
if (shopSelectedItem > SHOP_NOTHING)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
50
src/title.c
50
src/title.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2012, 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -245,8 +245,10 @@ int title_show()
|
|||
prlogo = gfx_loadImage("gfx/prlogo.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_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_LOAD_GAME, _("LOAD GAME"), 0, 0, FONT_WHITE);
|
||||
gfx_createTextObject(TS_CONTINUE_CURRENT_GAME, _("CONTINUE CURRENT GAME"), 0, 0, FONT_WHITE);
|
||||
|
@ -266,7 +268,7 @@ int title_show()
|
|||
5, 0, FONT_WHITE, 0, copyrightText);
|
||||
gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012",
|
||||
5, MENU_SPACING, FONT_WHITE, 0, copyrightText);
|
||||
gfx_renderString("Copyright 2015-2020 Layla Marchant",
|
||||
gfx_renderString("Copyright 2015-2020 The Diligent Circle",
|
||||
5, 2 * MENU_SPACING, FONT_WHITE, 0, copyrightText);
|
||||
|
||||
snprintf(buildVersion, STRMAX_SHORT, "Version %s", VERSION );
|
||||
|
@ -313,7 +315,11 @@ int title_show()
|
|||
player_flushInput();
|
||||
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)
|
||||
{
|
||||
|
@ -338,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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
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));
|
||||
|
||||
if ((now - then >= 27500) || (skip))
|
||||
if ((now - then >= 33250) || (skip))
|
||||
{
|
||||
optionRec.x = screen->w / 2 - optionRec.w / 2;
|
||||
optionRec.y = (MENU_Y - 4 - MENU_SPACING) + MENU_SPACING * selectedOption;
|
||||
|
@ -510,7 +521,11 @@ int title_show()
|
|||
|
||||
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
|
||||
{
|
||||
|
@ -643,7 +658,11 @@ void title_showCredits()
|
|||
|
||||
screen_drawBackground();
|
||||
|
||||
#ifdef OLD_MUSIC
|
||||
audio_playMusic("music/Solace.s3m", 1);
|
||||
#else
|
||||
audio_playMusic("music/rise_of_spirit.ogg", 1);
|
||||
#endif
|
||||
|
||||
fp = fopen("data/credits.txt", "rb");
|
||||
|
||||
|
@ -695,10 +714,17 @@ void title_showCredits()
|
|||
screen_unBuffer();
|
||||
|
||||
player_getInput();
|
||||
if (engine.keyState[KEY_ESCAPE] || engine.keyState[KEY_FIRE] ||
|
||||
engine.keyState[KEY_ALTFIRE])
|
||||
if (engine.keyState[KEY_ESCAPE] || engine.keyState[KEY_FIRE]
|
||||
|| engine.keyState[KEY_ALTFIRE])
|
||||
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;
|
||||
if (engine.keyState[KEY_DOWN])
|
||||
speed = 2;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015-2020 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
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
# Helper script to cross-compile for Windows with MXE.
|
||||
# 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
|
||||
mv src/starfighter.exe .
|
||||
|
|
Loading…
Reference in New Issue